aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-20 15:07:45 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-28 16:03:12 -0400
commit965938b83b19aeffdc1d16ce9947c8c127e8f59b (patch)
tree40288cb09fb91d508cc7e43ce565aa9b3a2a6137 /fs
parent1f7977c1368afc483908281daaffd31bca5a8d1e (diff)
NFSv4.1: Get rid of pNFS layout state "NFS_LAYOUT_INVALID"
In all cases where we set NFS_LAYOUT_INVALID, we also set NFS_LAYOUT_DESTROYED. Furthermore, in all cases where we test for NFS_LAYOUT_INVALID, we should also be testing for NFS_LAYOUT_DESTROYED, since the latter means that we hold no valid layout segments. Ergo the two are redundant. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4filelayout.c4
-rw-r--r--fs/nfs/nfs4filelayout.h6
-rw-r--r--fs/nfs/pnfs.h7
3 files changed, 7 insertions, 10 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index dac2162c3ac..6cce57e7fe5 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -190,8 +190,6 @@ static int filelayout_async_handle_error(struct rpc_task *task,
190 * i/o and all i/o waiting on the slot table to the MDS until 190 * i/o and all i/o waiting on the slot table to the MDS until
191 * layout is destroyed and a new valid layout is obtained. 191 * layout is destroyed and a new valid layout is obtained.
192 */ 192 */
193 set_bit(NFS_LAYOUT_INVALID,
194 &NFS_I(inode)->layout->plh_flags);
195 pnfs_destroy_layout(NFS_I(inode)); 193 pnfs_destroy_layout(NFS_I(inode));
196 rpc_wake_up(&tbl->slot_tbl_waitq); 194 rpc_wake_up(&tbl->slot_tbl_waitq);
197 goto reset; 195 goto reset;
@@ -281,7 +279,7 @@ filelayout_reset_to_mds(struct pnfs_layout_segment *lseg)
281{ 279{
282 struct nfs4_deviceid_node *node = FILELAYOUT_DEVID_NODE(lseg); 280 struct nfs4_deviceid_node *node = FILELAYOUT_DEVID_NODE(lseg);
283 281
284 return filelayout_test_layout_invalid(lseg->pls_layout) || 282 return pnfs_test_layout_destroyed(lseg->pls_layout) ||
285 filelayout_test_devid_unavailable(node); 283 filelayout_test_devid_unavailable(node);
286} 284}
287 285
diff --git a/fs/nfs/nfs4filelayout.h b/fs/nfs/nfs4filelayout.h
index 10b0f134400..dca47d78671 100644
--- a/fs/nfs/nfs4filelayout.h
+++ b/fs/nfs/nfs4filelayout.h
@@ -129,12 +129,6 @@ filelayout_mark_devid_invalid(struct nfs4_deviceid_node *node)
129} 129}
130 130
131static inline bool 131static inline bool
132filelayout_test_layout_invalid(struct pnfs_layout_hdr *lo)
133{
134 return test_bit(NFS_LAYOUT_INVALID, &lo->plh_flags);
135}
136
137static inline bool
138filelayout_test_devid_invalid(struct nfs4_deviceid_node *node) 132filelayout_test_devid_invalid(struct nfs4_deviceid_node *node)
139{ 133{
140 return test_bit(NFS_DEVICEID_INVALID, &node->flags); 134 return test_bit(NFS_DEVICEID_INVALID, &node->flags);
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index aa9fa1b1ff4..aacda7fbb53 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -63,7 +63,6 @@ enum {
63 NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ 63 NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */
64 NFS_LAYOUT_ROC, /* some lseg had roc bit set */ 64 NFS_LAYOUT_ROC, /* some lseg had roc bit set */
65 NFS_LAYOUT_DESTROYED, /* no new use of layout allowed */ 65 NFS_LAYOUT_DESTROYED, /* no new use of layout allowed */
66 NFS_LAYOUT_INVALID, /* layout is being destroyed */
67 NFS_LAYOUT_RETURNED, /* layout has already been returned */ 66 NFS_LAYOUT_RETURNED, /* layout has already been returned */
68}; 67};
69 68
@@ -279,6 +278,12 @@ pnfs_test_layout_returned(struct pnfs_layout_hdr *lo)
279 return test_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags); 278 return test_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags);
280} 279}
281 280
281static inline bool
282pnfs_test_layout_destroyed(struct pnfs_layout_hdr *lo)
283{
284 return test_bit(NFS_LAYOUT_DESTROYED, &lo->plh_flags);
285}
286
282static inline struct pnfs_layout_segment * 287static inline struct pnfs_layout_segment *
283pnfs_get_lseg(struct pnfs_layout_segment *lseg) 288pnfs_get_lseg(struct pnfs_layout_segment *lseg)
284{ 289{