From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbbDBMno (ORCPT ); Thu, 2 Apr 2015 08:43:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59601 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbbDBMnl (ORCPT ); Thu, 2 Apr 2015 08:43:41 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20150331031441.10464.24655.stgit@pluto.fritz.box> References: <20150331031441.10464.24655.stgit@pluto.fritz.box> <20150331030340.10464.30272.stgit@pluto.fritz.box> To: Ian Kent Cc: dhowells@redhat.com, Kernel Mailing List , Oleg Nesterov , Trond Myklebust , "J. Bruce Fields" , Benjamin Coddington , Al Viro , Jeff Layton , "Eric W. Biederman" Subject: Re: [RFC PATCH 5 1/7] kmod - add workqueue service thread store MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18728.1427978611.1@warthog.procyon.org.uk> Date: Thu, 02 Apr 2015 13:43:31 +0100 Message-ID: <18729.1427978611@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ian Kent 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