Re: [RFC PATCH 5 1/7] kmod - add workqueue service thread store

From: David Howells
Date: Thu Apr 02 2015 - 08:43:48 EST


Ian Kent <raven@xxxxxxxxxx> wrote:

> +static struct umh_wq_entry *umh_wq_find_entry(int token)
> +{
> + struct umh_wq_entry *this, *entry;
> + struct hlist_head *bucket;
> + unsigned int hash;
> +
> + hash = hash_32((unsigned long) token, UMH_WQ_HASH_SHIFT);
> + bucket = &umh_wq_hash[hash];
> +
> + entry = ERR_PTR(-ENOENT);
> + if (hlist_empty(bucket))
> + goto out;
> +
> + hlist_for_each_entry(this, bucket, umh_wq_hlist) {
> + if (this->token == token) {
> + entry = this;
> + break;
> + }
> + }
> +out:
> + return entry;
> +}

Can "struct umh_wq_entry *" be used as the token?

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/