diff options
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r-- | fs/nfs/pnfs.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 61531f338576..4ed1b48c71b1 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -34,6 +34,11 @@ | |||
34 | 34 | ||
35 | #define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" | 35 | #define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" |
36 | 36 | ||
37 | enum { | ||
38 | NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ | ||
39 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ | ||
40 | }; | ||
41 | |||
37 | /* Per-layout driver specific registration structure */ | 42 | /* Per-layout driver specific registration structure */ |
38 | struct pnfs_layoutdriver_type { | 43 | struct pnfs_layoutdriver_type { |
39 | struct list_head pnfs_tblid; | 44 | struct list_head pnfs_tblid; |
@@ -44,14 +49,48 @@ struct pnfs_layoutdriver_type { | |||
44 | int (*uninitialize_mountpoint) (struct nfs_server *); | 49 | int (*uninitialize_mountpoint) (struct nfs_server *); |
45 | }; | 50 | }; |
46 | 51 | ||
52 | struct pnfs_layout_hdr { | ||
53 | unsigned long refcount; | ||
54 | unsigned long state; | ||
55 | struct inode *inode; | ||
56 | }; | ||
57 | |||
47 | extern int pnfs_register_layoutdriver(struct pnfs_layoutdriver_type *); | 58 | extern int pnfs_register_layoutdriver(struct pnfs_layoutdriver_type *); |
48 | extern void pnfs_unregister_layoutdriver(struct pnfs_layoutdriver_type *); | 59 | extern void pnfs_unregister_layoutdriver(struct pnfs_layoutdriver_type *); |
49 | 60 | ||
61 | struct pnfs_layout_segment * | ||
62 | pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx, | ||
63 | enum pnfs_iomode access_type); | ||
50 | void set_pnfs_layoutdriver(struct nfs_server *, u32 id); | 64 | void set_pnfs_layoutdriver(struct nfs_server *, u32 id); |
51 | void unset_pnfs_layoutdriver(struct nfs_server *); | 65 | void unset_pnfs_layoutdriver(struct nfs_server *); |
66 | void pnfs_destroy_layout(struct nfs_inode *); | ||
67 | |||
68 | |||
69 | static inline int lo_fail_bit(u32 iomode) | ||
70 | { | ||
71 | return iomode == IOMODE_RW ? | ||
72 | NFS_LAYOUT_RW_FAILED : NFS_LAYOUT_RO_FAILED; | ||
73 | } | ||
74 | |||
75 | /* Return true if a layout driver is being used for this mountpoint */ | ||
76 | static inline int pnfs_enabled_sb(struct nfs_server *nfss) | ||
77 | { | ||
78 | return nfss->pnfs_curr_ld != NULL; | ||
79 | } | ||
52 | 80 | ||
53 | #else /* CONFIG_NFS_V4_1 */ | 81 | #else /* CONFIG_NFS_V4_1 */ |
54 | 82 | ||
83 | static inline void pnfs_destroy_layout(struct nfs_inode *nfsi) | ||
84 | { | ||
85 | } | ||
86 | |||
87 | static inline struct pnfs_layout_segment * | ||
88 | pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx, | ||
89 | enum pnfs_iomode access_type) | ||
90 | { | ||
91 | return NULL; | ||
92 | } | ||
93 | |||
55 | static inline void set_pnfs_layoutdriver(struct nfs_server *s, u32 id) | 94 | static inline void set_pnfs_layoutdriver(struct nfs_server *s, u32 id) |
56 | { | 95 | { |
57 | } | 96 | } |