aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-01-06 06:36:30 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:32 -0500
commit43f1b3da8b35d706d6c47880fc211d2519b4a587 (patch)
tree67fdbaaab9658cf79b17fa905c62a59d7355d613 /fs/nfs/pnfs.h
parentf2a625616045fe46e1d5fceebdd825f5acdecdb7 (diff)
pnfs: add CB_LAYOUTRECALL handling
This is the heart of the wave 2 submission. Add the code to trigger drain and forget of any afected layouts. In addition, we set a "barrier", below which any LAYOUTGET reply is ignored. This is to compensate for the fact that we do not wait for outstanding LAYOUTGETs to complete as per section 12.5.5.2.1 of RFC 5661. 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.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 8aaab56b794f..f91d0d45551c 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -49,6 +49,7 @@ struct pnfs_layout_segment {
49enum { 49enum {
50 NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ 50 NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */
51 NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ 51 NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */
52 NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */
52 NFS_LAYOUT_DESTROYED, /* no new use of layout allowed */ 53 NFS_LAYOUT_DESTROYED, /* no new use of layout allowed */
53}; 54};
54 55
@@ -67,9 +68,11 @@ struct pnfs_layoutdriver_type {
67struct pnfs_layout_hdr { 68struct pnfs_layout_hdr {
68 atomic_t plh_refcount; 69 atomic_t plh_refcount;
69 struct list_head plh_layouts; /* other client layouts */ 70 struct list_head plh_layouts; /* other client layouts */
71 struct list_head plh_bulk_recall; /* clnt list of bulk recalls */
70 struct list_head plh_segs; /* layout segments list */ 72 struct list_head plh_segs; /* layout segments list */
71 nfs4_stateid plh_stateid; 73 nfs4_stateid plh_stateid;
72 atomic_t plh_outstanding; /* number of RPCs out */ 74 atomic_t plh_outstanding; /* number of RPCs out */
75 u32 plh_barrier; /* ignore lower seqids */
73 unsigned long plh_flags; 76 unsigned long plh_flags;
74 struct inode *plh_inode; 77 struct inode *plh_inode;
75}; 78};
@@ -139,18 +142,26 @@ extern int nfs4_proc_getdeviceinfo(struct nfs_server *server,
139extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp); 142extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp);
140 143
141/* pnfs.c */ 144/* pnfs.c */
145void get_layout_hdr(struct pnfs_layout_hdr *lo);
142struct pnfs_layout_segment * 146struct pnfs_layout_segment *
143pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx, 147pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx,
144 enum pnfs_iomode access_type); 148 enum pnfs_iomode access_type);
145void set_pnfs_layoutdriver(struct nfs_server *, u32 id); 149void set_pnfs_layoutdriver(struct nfs_server *, u32 id);
146void unset_pnfs_layoutdriver(struct nfs_server *); 150void unset_pnfs_layoutdriver(struct nfs_server *);
147int pnfs_layout_process(struct nfs4_layoutget *lgp); 151int pnfs_layout_process(struct nfs4_layoutget *lgp);
152void pnfs_free_lseg_list(struct list_head *tmp_list);
148void pnfs_destroy_layout(struct nfs_inode *); 153void pnfs_destroy_layout(struct nfs_inode *);
149void pnfs_destroy_all_layouts(struct nfs_client *); 154void pnfs_destroy_all_layouts(struct nfs_client *);
150void put_layout_hdr(struct pnfs_layout_hdr *lo); 155void put_layout_hdr(struct pnfs_layout_hdr *lo);
156void pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo,
157 const nfs4_stateid *new,
158 bool update_barrier);
151int pnfs_choose_layoutget_stateid(nfs4_stateid *dst, 159int pnfs_choose_layoutget_stateid(nfs4_stateid *dst,
152 struct pnfs_layout_hdr *lo, 160 struct pnfs_layout_hdr *lo,
153 struct nfs4_state *open_state); 161 struct nfs4_state *open_state);
162int mark_matching_lsegs_invalid(struct pnfs_layout_hdr *lo,
163 struct list_head *tmp_list,
164 u32 iomode);
154 165
155 166
156static inline int lo_fail_bit(u32 iomode) 167static inline int lo_fail_bit(u32 iomode)