aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2012-06-20 15:03:33 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-07-16 14:37:25 -0400
commit366d50521c57939e61e25dc27f009367447563e6 (patch)
treed69e02a6fad26e4d746710a7b8dd2caa0047efed /fs/nfs/pnfs.h
parentbaf6c2a44af02cf6f7cec1ff177189c78fc30f9a (diff)
NFSv4.1 mark layout when already returned
When the file layout driver is fencing a DS, _pnfs_return_layout can be called mulitple times per inode due to in-flight i/o referencing lsegs on it's plh_segs list. Remember that LAYOUTRETURN has been called, and do not call it again. Allow LAYOUTRETURNs after a subsequent LAYOUTGET. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 592beb02c955..2c6c80503ba4 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -64,6 +64,7 @@ enum {
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 */ 66 NFS_LAYOUT_INVALID, /* layout is being destroyed */
67 NFS_LAYOUT_RETURNED, /* layout has already been returned */
67}; 68};
68 69
69enum layoutdriver_policy_flags { 70enum layoutdriver_policy_flags {
@@ -255,6 +256,24 @@ struct nfs4_deviceid_node *nfs4_insert_deviceid_node(struct nfs4_deviceid_node *
255bool nfs4_put_deviceid_node(struct nfs4_deviceid_node *); 256bool nfs4_put_deviceid_node(struct nfs4_deviceid_node *);
256void nfs4_deviceid_purge_client(const struct nfs_client *); 257void nfs4_deviceid_purge_client(const struct nfs_client *);
257 258
259static inline void
260pnfs_mark_layout_returned(struct pnfs_layout_hdr *lo)
261{
262 set_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags);
263}
264
265static inline void
266pnfs_clear_layout_returned(struct pnfs_layout_hdr *lo)
267{
268 clear_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags);
269}
270
271static inline bool
272pnfs_test_layout_returned(struct pnfs_layout_hdr *lo)
273{
274 return test_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags);
275}
276
258static inline int lo_fail_bit(u32 iomode) 277static inline int lo_fail_bit(u32 iomode)
259{ 278{
260 return iomode == IOMODE_RW ? 279 return iomode == IOMODE_RW ?