diff options
Diffstat (limited to 'fs/nfsd/pnfs.h')
| -rw-r--r-- | fs/nfsd/pnfs.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/fs/nfsd/pnfs.h b/fs/nfsd/pnfs.h new file mode 100644 index 000000000000..fedb4d620a81 --- /dev/null +++ b/fs/nfsd/pnfs.h | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | #ifndef _FS_NFSD_PNFS_H | ||
| 2 | #define _FS_NFSD_PNFS_H 1 | ||
| 3 | |||
| 4 | #include <linux/exportfs.h> | ||
| 5 | #include <linux/nfsd/export.h> | ||
| 6 | |||
| 7 | #include "state.h" | ||
| 8 | #include "xdr4.h" | ||
| 9 | |||
| 10 | struct xdr_stream; | ||
| 11 | |||
| 12 | struct nfsd4_deviceid_map { | ||
| 13 | struct list_head hash; | ||
| 14 | u64 idx; | ||
| 15 | int fsid_type; | ||
| 16 | u32 fsid[]; | ||
| 17 | }; | ||
| 18 | |||
| 19 | struct nfsd4_layout_ops { | ||
| 20 | u32 notify_types; | ||
| 21 | |||
| 22 | __be32 (*proc_getdeviceinfo)(struct super_block *sb, | ||
| 23 | struct nfsd4_getdeviceinfo *gdevp); | ||
| 24 | __be32 (*encode_getdeviceinfo)(struct xdr_stream *xdr, | ||
| 25 | struct nfsd4_getdeviceinfo *gdevp); | ||
| 26 | |||
| 27 | __be32 (*proc_layoutget)(struct inode *, const struct svc_fh *fhp, | ||
| 28 | struct nfsd4_layoutget *lgp); | ||
| 29 | __be32 (*encode_layoutget)(struct xdr_stream *, | ||
| 30 | struct nfsd4_layoutget *lgp); | ||
| 31 | |||
| 32 | __be32 (*proc_layoutcommit)(struct inode *inode, | ||
| 33 | struct nfsd4_layoutcommit *lcp); | ||
| 34 | }; | ||
| 35 | |||
| 36 | extern const struct nfsd4_layout_ops *nfsd4_layout_ops[]; | ||
| 37 | extern const struct nfsd4_layout_ops bl_layout_ops; | ||
| 38 | |||
| 39 | __be32 nfsd4_preprocess_layout_stateid(struct svc_rqst *rqstp, | ||
| 40 | struct nfsd4_compound_state *cstate, stateid_t *stateid, | ||
| 41 | bool create, u32 layout_type, struct nfs4_layout_stateid **lsp); | ||
| 42 | __be32 nfsd4_insert_layout(struct nfsd4_layoutget *lgp, | ||
| 43 | struct nfs4_layout_stateid *ls); | ||
| 44 | __be32 nfsd4_return_file_layouts(struct svc_rqst *rqstp, | ||
| 45 | struct nfsd4_compound_state *cstate, | ||
| 46 | struct nfsd4_layoutreturn *lrp); | ||
| 47 | __be32 nfsd4_return_client_layouts(struct svc_rqst *rqstp, | ||
| 48 | struct nfsd4_compound_state *cstate, | ||
| 49 | struct nfsd4_layoutreturn *lrp); | ||
| 50 | int nfsd4_set_deviceid(struct nfsd4_deviceid *id, const struct svc_fh *fhp, | ||
| 51 | u32 device_generation); | ||
| 52 | struct nfsd4_deviceid_map *nfsd4_find_devid_map(int idx); | ||
| 53 | |||
| 54 | #ifdef CONFIG_NFSD_PNFS | ||
| 55 | void nfsd4_setup_layout_type(struct svc_export *exp); | ||
| 56 | void nfsd4_return_all_client_layouts(struct nfs4_client *); | ||
| 57 | void nfsd4_return_all_file_layouts(struct nfs4_client *clp, | ||
| 58 | struct nfs4_file *fp); | ||
| 59 | int nfsd4_init_pnfs(void); | ||
| 60 | void nfsd4_exit_pnfs(void); | ||
| 61 | #else | ||
| 62 | static inline void nfsd4_setup_layout_type(struct svc_export *exp) | ||
| 63 | { | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline void nfsd4_return_all_client_layouts(struct nfs4_client *clp) | ||
| 67 | { | ||
| 68 | } | ||
| 69 | static inline void nfsd4_return_all_file_layouts(struct nfs4_client *clp, | ||
| 70 | struct nfs4_file *fp) | ||
| 71 | { | ||
| 72 | } | ||
| 73 | static inline void nfsd4_exit_pnfs(void) | ||
| 74 | { | ||
| 75 | } | ||
| 76 | static inline int nfsd4_init_pnfs(void) | ||
| 77 | { | ||
| 78 | return 0; | ||
| 79 | } | ||
| 80 | #endif /* CONFIG_NFSD_PNFS */ | ||
| 81 | #endif /* _FS_NFSD_PNFS_H */ | ||
