aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-01-06 11:36:23 +0000
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:31 -0500
commit4541d16c024ce40a0781e03c185ecdfe34aec46f (patch)
tree53574211b3de874869b09644b8de872ccf2d4fe1 /fs/nfs/pnfs.h
parentpnfs: change layout state seqlock to a spinlock (diff)
downloadlinux-dev-4541d16c024ce40a0781e03c185ecdfe34aec46f.tar.xz
linux-dev-4541d16c024ce40a0781e03c185ecdfe34aec46f.zip
pnfs: change how lsegs are removed from layout list
This is to prepare the way for sensible io draining. Instead of just removing the lseg from the list, we instead clear the VALID flag (preventing new io from grabbing references to the lseg) and remove the reference holding it in the list. Thus the lseg will be removed once any io in progress completes and any references still held are dropped. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 10937203d236..787253e6fca3 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -30,10 +30,15 @@
#ifndef FS_NFS_PNFS_H
#define FS_NFS_PNFS_H
+enum {
+ NFS_LSEG_VALID = 0, /* cleared when lseg is recalled/returned */
+};
+
struct pnfs_layout_segment {
struct list_head pls_list;
struct pnfs_layout_range pls_range;
- struct kref pls_refcount;
+ atomic_t pls_refcount;
+ unsigned long pls_flags;
struct pnfs_layout_hdr *pls_layout;
};
@@ -44,6 +49,7 @@ struct pnfs_layout_segment {
enum {
NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */
NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */
+ NFS_LAYOUT_DESTROYED, /* no new use of layout allowed */
};
/* Per-layout driver specific registration structure */