All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Krishna Kumar <krkumar2@in.ibm.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/4] nfsd: Minor cleanup of find_stateid
Date: Mon, 20 Oct 2008 16:26:32 -0400	[thread overview]
Message-ID: <20081020202632.GA27702@fieldses.org> (raw)
In-Reply-To: <20081020061428.17722.68145.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

On Mon, Oct 20, 2008 at 11:44:28AM +0530, Krishna Kumar wrote:
> From: Krishna Kumar <krkumar2@in.ibm.com>
> 
> Minor cleanup/rewrite of find_stateid. Compile tested.

Thanks, applied.--b.

> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
> ---
>  fs/nfsd/nfs4state.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff -ruNp linux-2.6.27.org/fs/nfsd/nfs4state.c linux-2.6.27.new/fs/nfsd/nfs4state.c
> --- linux-2.6.27.org/fs/nfsd/nfs4state.c	2008-10-20 10:47:23.000000000 +0530
> +++ linux-2.6.27.new/fs/nfsd/nfs4state.c	2008-10-20 10:48:29.000000000 +0530
> @@ -2421,13 +2421,13 @@ static struct list_head lockstateid_hash
>  static struct nfs4_stateid *
>  find_stateid(stateid_t *stid, int flags)
>  {
> -	struct nfs4_stateid *local = NULL;
> +	struct nfs4_stateid *local;
>  	u32 st_id = stid->si_stateownerid;
>  	u32 f_id = stid->si_fileid;
>  	unsigned int hashval;
>  
>  	dprintk("NFSD: find_stateid flags 0x%x\n",flags);
> -	if ((flags & LOCK_STATE) || (flags & RD_STATE) || (flags & WR_STATE)) {
> +	if (flags & (LOCK_STATE | RD_STATE | WR_STATE)) {
>  		hashval = stateid_hashval(st_id, f_id);
>  		list_for_each_entry(local, &lockstateid_hashtbl[hashval], st_hash) {
>  			if ((local->st_stateid.si_stateownerid == st_id) &&
> @@ -2435,7 +2435,8 @@ find_stateid(stateid_t *stid, int flags)
>  				return local;
>  		}
>  	} 
> -	if ((flags & OPEN_STATE) || (flags & RD_STATE) || (flags & WR_STATE)) {
> +
> +	if (flags & (OPEN_STATE | RD_STATE | WR_STATE)) {
>  		hashval = stateid_hashval(st_id, f_id);
>  		list_for_each_entry(local, &stateid_hashtbl[hashval], st_hash) {
>  			if ((local->st_stateid.si_stateownerid == st_id) &&
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2008-10-20 20:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20  6:14 [PATCH 1/4] nfsd: Minor cleanup of find_stateid Krishna Kumar
     [not found] ` <20081020061428.17722.68145.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-10-20  6:14   ` [PATCH 2/4] nfsd: Drop reference in expkey_parse error cases Krishna Kumar
     [not found]     ` <20081020061440.17722.70281.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-10-20 20:53       ` J. Bruce Fields
2008-10-20 20:26   ` J. Bruce Fields [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081020202632.GA27702@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=krkumar2@in.ibm.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.