Linux NFS development
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Yang Hongyang <yanghy@cn.fujitsu.com>,
	"J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 03/14] nfsd4: remove redundant "if" in	nfs4_preprocess_stateid_op
Date: Wed, 11 Mar 2009 20:05:31 +0200	[thread overview]
Message-ID: <49B7FD6B.5060203@panasas.com> (raw)
In-Reply-To: <49B7133E.10804@cn.fujitsu.com>

On Mar. 11, 2009, 3:26 +0200, Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
> J. Bruce Fields wrote:
>> On Wed, Mar 11, 2009 at 09:12:46AM +0800, Yang Hongyang wrote:
>>> J. Bruce Fields wrote:
>>>> From: J. Bruce Fields <bfields@citi.umich.edu>
>>>>
>>>> Note that we exit this first big "if" with stp == NULL iff we took the
>>>                                                                                         ^^ typo
>> The "iff"?  That's short for "if and only if".  I can try to get out of
>> the "iff" habit if it's too obscure.
> 
> Sorry for mis-understanding,My pool englishT_T Maybe "if and only if"
> are more understandable.

Although using this iffy math/cs school lingo does not seem too obscure
to me (one can find it easily on the net, e.g.
http://www.tfd.com/?Word=iff), as a non-native English speaker I'd be
inclined to simplify commentary language as much as possible and
refrain from using acronyms if they are not obvious to the linux
developers community.

Benny

> 
>> --b.
>>
>>>> first branch; therefore, the second "if" is redundant, and we can just
>>>> combine the two, simplifying the logic.
>>>>
>>>> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
>>>> ---
>>>>  fs/nfsd/nfs4state.c |   19 ++++++++-----------
>>>>  1 files changed, 8 insertions(+), 11 deletions(-)
>>>>
>>>> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
>>>> index d6ca2be..16fcb65 100644
>>>> --- a/fs/nfsd/nfs4state.c
>>>> +++ b/fs/nfsd/nfs4state.c
>>>> @@ -2087,6 +2087,14 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
>>>>  		status = check_stateid_generation(stateid, stidp);
>>>>  		if (status)
>>>>  			goto out;
>>>> +		status = nfs4_check_delegmode(dp, flags);
>>>> +		if (status)
>>>> +			goto out;
>>>> +		renew_client(dp->dl_client);
>>>> +		if (flags & DELEG_RET)
>>>> +			unhash_delegation(dp);
>>>> +		if (filpp)
>>>> +			*filpp = dp->dl_vfs_file;
>>>>  	} else { /* open or lock stateid */
>>>>  		stp = find_stateid(stateid, flags);
>>>>  		if (!stp) {
>>>> @@ -2101,23 +2109,12 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
>>>>  		status = check_stateid_generation(stateid, stidp);
>>>>  		if (status)
>>>>  			goto out;
>>>> -	}
>>>> -	if (stp) {
>>>>  		status = nfs4_check_openmode(stp, flags);
>>>>  		if (status)
>>>>  			goto out;
>>>>  		renew_client(stp->st_stateowner->so_client);
>>>>  		if (filpp)
>>>>  			*filpp = stp->st_vfs_file;
>>>> -	} else {
>>>> -		status = nfs4_check_delegmode(dp, flags);
>>>> -		if (status)
>>>> -			goto out;
>>>> -		renew_client(dp->dl_client);
>>>> -		if (flags & DELEG_RET)
>>>> -			unhash_delegation(dp);
>>>> -		if (filpp)
>>>> -			*filpp = dp->dl_vfs_file;
>>>>  	}
>>>>  	status = nfs_ok;
>>>>  out:
>>> -- 
>>> Regards
>>> Yang Hongyang
>>
> 
> 

  reply	other threads:[~2009-03-11 18:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11  0:26 miscellaneous nfsd4 state changes J. Bruce Fields
2009-03-11  0:26 ` [PATCH 01/14] nfsd4: trivial preprocess_stateid_op cleanup J. Bruce Fields
2009-03-11  0:26   ` [PATCH 02/14] nfsd4: move check_stateid_generation check J. Bruce Fields
2009-03-11  0:26     ` [PATCH 03/14] nfsd4: remove redundant "if" in nfs4_preprocess_stateid_op J. Bruce Fields
2009-03-11  0:26       ` [PATCH 04/14] nfsd4: remove unneeded local variable J. Bruce Fields
2009-03-11  0:26         ` [PATCH 05/14] nfsd4: remove some dprintk's J. Bruce Fields
2009-03-11  0:26           ` [PATCH 06/14] nfsd4: add a helper function to decide if stateid is delegation J. Bruce Fields
2009-03-11  0:26             ` [PATCH 07/14] nfsd4: separate delegreturn case from preprocess_stateid_op J. Bruce Fields
2009-03-11  0:26               ` [PATCH 08/14] nfsd4: fail when delegreturn gets a non-delegation stateid J. Bruce Fields
2009-03-11  0:26                 ` [PATCH 09/14] nfsd4: remove unused CHECK_FH flag J. Bruce Fields
2009-03-11  0:26                   ` [PATCH 10/14] nfsd4: rename io_during_grace_disallowed J. Bruce Fields
2009-03-11  0:26                     ` [PATCH 11/14] nfsd4: put_nfs4_client does not require state lock J. Bruce Fields
2009-03-11  0:27                       ` [PATCH 12/14] nfsd4: remove use of mutex for file_hashtable J. Bruce Fields
2009-03-11  0:27                         ` [PATCH 13/14] nfsd4: fix do_probe_callback errors J. Bruce Fields
2009-03-11  0:27                           ` [PATCH 14/14] nfsd4: move rpc_client setup to a separate function J. Bruce Fields
2009-03-12 10:59                             ` Benny Halevy
2009-03-12 10:55                           ` [PATCH 13/14] nfsd4: fix do_probe_callback errors Benny Halevy
2009-03-12 21:41                             ` J. Bruce Fields
2009-03-11 18:52                         ` [PATCH 12/14] nfsd4: remove use of mutex for file_hashtable Benny Halevy
2009-03-12  0:05                           ` J. Bruce Fields
2009-03-12 10:49                             ` Benny Halevy
2009-03-13 17:18                               ` J. Bruce Fields
2009-03-18 20:28                                 ` J. Bruce Fields
2009-03-18 20:40                                   ` Benny Halevy
2009-03-18 21:03                                     ` J. Bruce Fields
2009-03-18 21:07                                       ` Benny Halevy
2009-03-11  1:52                 ` [PATCH 08/14] nfsd4: fail when delegreturn gets a non-delegation stateid Yang Hongyang
2009-03-11 20:07                   ` J. Bruce Fields
2009-03-11 18:29                 ` Benny Halevy
2009-03-12  0:03                   ` J. Bruce Fields
2009-03-11  1:47               ` [PATCH 07/14] nfsd4: separate delegreturn case from preprocess_stateid_op Yang Hongyang
2009-03-11 19:51                 ` J. Bruce Fields
2009-03-11  1:12       ` [PATCH 03/14] nfsd4: remove redundant "if" in nfs4_preprocess_stateid_op Yang Hongyang
2009-03-11  1:23         ` J. Bruce Fields
2009-03-11  1:26           ` Yang Hongyang
2009-03-11 18:05             ` Benny Halevy [this message]
2009-03-11 19:49               ` J. Bruce Fields
2009-03-11  2:09   ` [PATCH 01/14] nfsd4: trivial preprocess_stateid_op cleanup Yang Hongyang

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=49B7FD6B.5060203@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=yanghy@cn.fujitsu.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox