aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-01-06 06:36:32 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:32 -0500
commitf7e8917a67980924651a9e244510e63ef05c7755 (patch)
treefb00db5ef8b3b26793fae7a1186f1cd16205ab9d /fs/nfs/pnfs.h
parent36840370845629e6cb4324d1dd4aff6778670503 (diff)
pnfs: layout roc code
A layout can request return-on-close. How this interacts with the forgetful model of never sending LAYOUTRETURNS is a bit ambiguous. We forget any layouts marked roc, and wait for them to be completely forgotten before continuing with the close. In addition, to compensate for races with any inflight LAYOUTGETs, and the fact that we do not get any layout stateid back from the server, we set the barrier to the worst case scenario of current_seqid + number of outstanding LAYOUTGETS. 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.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index f91d0d45551..e2612ea0cbe 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -32,6 +32,7 @@
32 32
33enum { 33enum {
34 NFS_LSEG_VALID = 0, /* cleared when lseg is recalled/returned */ 34 NFS_LSEG_VALID = 0, /* cleared when lseg is recalled/returned */
35 NFS_LSEG_ROC, /* roc bit received from server */
35}; 36};
36 37
37struct pnfs_layout_segment { 38struct pnfs_layout_segment {
@@ -50,6 +51,7 @@ enum {
50 NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ 51 NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */
51 NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ 52 NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */
52 NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ 53 NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */
54 NFS_LAYOUT_ROC, /* some lseg had roc bit set */
53 NFS_LAYOUT_DESTROYED, /* no new use of layout allowed */ 55 NFS_LAYOUT_DESTROYED, /* no new use of layout allowed */
54}; 56};
55 57
@@ -72,6 +74,7 @@ struct pnfs_layout_hdr {
72 struct list_head plh_segs; /* layout segments list */ 74 struct list_head plh_segs; /* layout segments list */
73 nfs4_stateid plh_stateid; 75 nfs4_stateid plh_stateid;
74 atomic_t plh_outstanding; /* number of RPCs out */ 76 atomic_t plh_outstanding; /* number of RPCs out */
77 unsigned long plh_block_lgets; /* block LAYOUTGET if >0 */
75 u32 plh_barrier; /* ignore lower seqids */ 78 u32 plh_barrier; /* ignore lower seqids */
76 unsigned long plh_flags; 79 unsigned long plh_flags;
77 struct inode *plh_inode; 80 struct inode *plh_inode;
@@ -162,6 +165,10 @@ int pnfs_choose_layoutget_stateid(nfs4_stateid *dst,
162int mark_matching_lsegs_invalid(struct pnfs_layout_hdr *lo, 165int mark_matching_lsegs_invalid(struct pnfs_layout_hdr *lo,
163 struct list_head *tmp_list, 166 struct list_head *tmp_list,
164 u32 iomode); 167 u32 iomode);
168bool pnfs_roc(struct inode *ino);
169void pnfs_roc_release(struct inode *ino);
170void pnfs_roc_set_barrier(struct inode *ino, u32 barrier);
171bool pnfs_roc_drain(struct inode *ino, u32 *barrier);
165 172
166 173
167static inline int lo_fail_bit(u32 iomode) 174static inline int lo_fail_bit(u32 iomode)
@@ -193,6 +200,28 @@ pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx,
193 return NULL; 200 return NULL;
194} 201}
195 202
203static inline bool
204pnfs_roc(struct inode *ino)
205{
206 return false;
207}
208
209static inline void
210pnfs_roc_release(struct inode *ino)
211{
212}
213
214static inline void
215pnfs_roc_set_barrier(struct inode *ino, u32 barrier)
216{
217}
218
219static inline bool
220pnfs_roc_drain(struct inode *ino, u32 *barrier)
221{
222 return false;
223}
224
196static inline void set_pnfs_layoutdriver(struct nfs_server *s, u32 id) 225static inline void set_pnfs_layoutdriver(struct nfs_server *s, u32 id)
197{ 226{
198} 227}