Commit a59c30ac authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Get rid of redundant NFS4CLNT_LAYOUTRECALL tests

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 591ad7fe
...@@ -966,8 +966,7 @@ pnfs_update_layout(struct inode *ino, ...@@ -966,8 +966,7 @@ pnfs_update_layout(struct inode *ino,
} }
/* Do we even need to bother with this? */ /* Do we even need to bother with this? */
if (test_bit(NFS4CLNT_LAYOUTRECALL, &clp->cl_state) || if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
dprintk("%s matches recall, use MDS\n", __func__); dprintk("%s matches recall, use MDS\n", __func__);
goto out_unlock; goto out_unlock;
} }
...@@ -1032,7 +1031,6 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) ...@@ -1032,7 +1031,6 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
struct nfs4_layoutget_res *res = &lgp->res; struct nfs4_layoutget_res *res = &lgp->res;
struct pnfs_layout_segment *lseg; struct pnfs_layout_segment *lseg;
struct inode *ino = lo->plh_inode; struct inode *ino = lo->plh_inode;
struct nfs_client *clp = NFS_SERVER(ino)->nfs_client;
int status = 0; int status = 0;
/* Inject layout blob into I/O device driver */ /* Inject layout blob into I/O device driver */
...@@ -1048,8 +1046,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) ...@@ -1048,8 +1046,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
} }
spin_lock(&ino->i_lock); spin_lock(&ino->i_lock);
if (test_bit(NFS4CLNT_LAYOUTRECALL, &clp->cl_state) || if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
dprintk("%s forget reply due to recall\n", __func__); dprintk("%s forget reply due to recall\n", __func__);
goto out_forget_reply; goto out_forget_reply;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment