diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-01 11:17:47 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-01 11:17:47 -0500 |
commit | a59c30acfbe701dc991f4f84abce27818120a2ac (patch) | |
tree | 675fd98cb09e3d8bf021af05396defb4d3b6d51c /fs/nfs/pnfs.c | |
parent | 591ad7feaec5417681b4112f8df52fc43bb7c92e (diff) |
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index a53421604bc4..402efc2f5b70 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -966,8 +966,7 @@ pnfs_update_layout(struct inode *ino, | |||
966 | } | 966 | } |
967 | 967 | ||
968 | /* Do we even need to bother with this? */ | 968 | /* Do we even need to bother with this? */ |
969 | if (test_bit(NFS4CLNT_LAYOUTRECALL, &clp->cl_state) || | 969 | if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) { |
970 | test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) { | ||
971 | dprintk("%s matches recall, use MDS\n", __func__); | 970 | dprintk("%s matches recall, use MDS\n", __func__); |
972 | goto out_unlock; | 971 | goto out_unlock; |
973 | } | 972 | } |
@@ -1032,7 +1031,6 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) | |||
1032 | struct nfs4_layoutget_res *res = &lgp->res; | 1031 | struct nfs4_layoutget_res *res = &lgp->res; |
1033 | struct pnfs_layout_segment *lseg; | 1032 | struct pnfs_layout_segment *lseg; |
1034 | struct inode *ino = lo->plh_inode; | 1033 | struct inode *ino = lo->plh_inode; |
1035 | struct nfs_client *clp = NFS_SERVER(ino)->nfs_client; | ||
1036 | int status = 0; | 1034 | int status = 0; |
1037 | 1035 | ||
1038 | /* Inject layout blob into I/O device driver */ | 1036 | /* Inject layout blob into I/O device driver */ |
@@ -1048,8 +1046,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) | |||
1048 | } | 1046 | } |
1049 | 1047 | ||
1050 | spin_lock(&ino->i_lock); | 1048 | spin_lock(&ino->i_lock); |
1051 | if (test_bit(NFS4CLNT_LAYOUTRECALL, &clp->cl_state) || | 1049 | if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) { |
1052 | test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) { | ||
1053 | dprintk("%s forget reply due to recall\n", __func__); | 1050 | dprintk("%s forget reply due to recall\n", __func__); |
1054 | goto out_forget_reply; | 1051 | goto out_forget_reply; |
1055 | } | 1052 | } |