linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Schumaker <bjschuma@netapp.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] NFSv4.1: Get rid of redundant NFS4CLNT_LAYOUTRECALL tests
Date: Thu, 01 Mar 2012 10:39:20 -0500	[thread overview]
Message-ID: <4F4F9828.9040808@netapp.com> (raw)
In-Reply-To: <1330558445-4583-1-git-send-email-Trond.Myklebust@netapp.com>

On 02/29/2012 06:34 PM, Trond Myklebust wrote:

> The NFS4CLNT_LAYOUTRECALL tests in pnfs_layout_process and
> pnfs_update_layout are redundant.
> 
> In the case of a bulk layout recall, we're always testing for
> the NFS_LAYOUT_BULK_RECALL flay anyway.
> In the case of a file or segment recall, the call to
> pnfs_set_layout_stateid() updates the layout_header 'barrier'
> sequence id, which triggers the test in pnfs_layoutgets_blocked()
> and is less race-prone than NFS4CLNT_LAYOUTRECALL anyway.
> 
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
>  fs/nfs/pnfs.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index a534216..9c19f92 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -966,8 +966,7 @@ pnfs_update_layout(struct inode *ino,
>  	}
>  
>  	/* Do we even need to bother with this? */
> -	if (test_bit(NFS4CLNT_LAYOUTRECALL, &clp->cl_state) ||
> -	    test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
> +	if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
>  		dprintk("%s matches recall, use MDS\n", __func__);
>  		goto out_unlock;
>  	}
> @@ -1048,8 +1047,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
>  	}
>  
>  	spin_lock(&ino->i_lock);
> -	if (test_bit(NFS4CLNT_LAYOUTRECALL, &clp->cl_state) ||
> -	    test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {


This was the only place that the clp structure was used, so you could probably remove it to avoid this warning:

fs/nfs/pnfs.c: In function 'pnfs_layout_process':
fs/nfs/pnfs.c:1058:21: warning: unused variable 'clp' [-Wunused-variable]

- Bryan

> +	if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
>  		dprintk("%s forget reply due to recall\n", __func__);
>  		goto out_forget_reply;
>  	}



  parent reply	other threads:[~2012-03-01 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29 23:34 [PATCH 1/2] NFSv4.1: Get rid of redundant NFS4CLNT_LAYOUTRECALL tests Trond Myklebust
2012-02-29 23:34 ` [PATCH 2/2] NFSv4.1: Get rid of NFS4CLNT_LAYOUTRECALL Trond Myklebust
2012-03-01 15:39 ` Bryan Schumaker [this message]
2012-03-01 16:18   ` [PATCH 1/2] NFSv4.1: Get rid of redundant NFS4CLNT_LAYOUTRECALL tests Myklebust, Trond

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=4F4F9828.9040808@netapp.com \
    --to=bjschuma@netapp.com \
    --cc=Trond.Myklebust@netapp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).