Commit | Line | Data |
---|---|---|
9cf514cc CH |
1 | #ifndef _FS_NFSD_PNFS_H |
2 | #define _FS_NFSD_PNFS_H 1 | |
3 | ||
a51f25a5 | 4 | #ifdef CONFIG_NFSD_V4 |
9cf514cc CH |
5 | #include <linux/exportfs.h> |
6 | #include <linux/nfsd/export.h> | |
7 | ||
8 | #include "state.h" | |
9 | #include "xdr4.h" | |
10 | ||
11 | struct xdr_stream; | |
12 | ||
13 | struct nfsd4_deviceid_map { | |
14 | struct list_head hash; | |
15 | u64 idx; | |
16 | int fsid_type; | |
17 | u32 fsid[]; | |
18 | }; | |
19 | ||
20 | struct nfsd4_layout_ops { | |
21 | u32 notify_types; | |
22 | ||
23 | __be32 (*proc_getdeviceinfo)(struct super_block *sb, | |
d7c920d1 | 24 | struct svc_rqst *rqstp, |
f99d4fbd | 25 | struct nfs4_client *clp, |
9cf514cc CH |
26 | struct nfsd4_getdeviceinfo *gdevp); |
27 | __be32 (*encode_getdeviceinfo)(struct xdr_stream *xdr, | |
28 | struct nfsd4_getdeviceinfo *gdevp); | |
29 | ||
30 | __be32 (*proc_layoutget)(struct inode *, const struct svc_fh *fhp, | |
31 | struct nfsd4_layoutget *lgp); | |
32 | __be32 (*encode_layoutget)(struct xdr_stream *, | |
33 | struct nfsd4_layoutget *lgp); | |
34 | ||
35 | __be32 (*proc_layoutcommit)(struct inode *inode, | |
36 | struct nfsd4_layoutcommit *lcp); | |
f99d4fbd CH |
37 | |
38 | void (*fence_client)(struct nfs4_layout_stateid *ls); | |
9cf514cc CH |
39 | }; |
40 | ||
41 | extern const struct nfsd4_layout_ops *nfsd4_layout_ops[]; | |
81c39329 | 42 | #ifdef CONFIG_NFSD_BLOCKLAYOUT |
8650b8a0 | 43 | extern const struct nfsd4_layout_ops bl_layout_ops; |
81c39329 | 44 | #endif |
f99d4fbd CH |
45 | #ifdef CONFIG_NFSD_SCSILAYOUT |
46 | extern const struct nfsd4_layout_ops scsi_layout_ops; | |
47 | #endif | |
9cf514cc CH |
48 | |
49 | __be32 nfsd4_preprocess_layout_stateid(struct svc_rqst *rqstp, | |
50 | struct nfsd4_compound_state *cstate, stateid_t *stateid, | |
51 | bool create, u32 layout_type, struct nfs4_layout_stateid **lsp); | |
52 | __be32 nfsd4_insert_layout(struct nfsd4_layoutget *lgp, | |
53 | struct nfs4_layout_stateid *ls); | |
54 | __be32 nfsd4_return_file_layouts(struct svc_rqst *rqstp, | |
55 | struct nfsd4_compound_state *cstate, | |
56 | struct nfsd4_layoutreturn *lrp); | |
57 | __be32 nfsd4_return_client_layouts(struct svc_rqst *rqstp, | |
58 | struct nfsd4_compound_state *cstate, | |
59 | struct nfsd4_layoutreturn *lrp); | |
60 | int nfsd4_set_deviceid(struct nfsd4_deviceid *id, const struct svc_fh *fhp, | |
61 | u32 device_generation); | |
62 | struct nfsd4_deviceid_map *nfsd4_find_devid_map(int idx); | |
a51f25a5 | 63 | #endif /* CONFIG_NFSD_V4 */ |
9cf514cc CH |
64 | |
65 | #ifdef CONFIG_NFSD_PNFS | |
66 | void nfsd4_setup_layout_type(struct svc_export *exp); | |
67 | void nfsd4_return_all_client_layouts(struct nfs4_client *); | |
68 | void nfsd4_return_all_file_layouts(struct nfs4_client *clp, | |
69 | struct nfs4_file *fp); | |
70 | int nfsd4_init_pnfs(void); | |
71 | void nfsd4_exit_pnfs(void); | |
72 | #else | |
a51f25a5 BF |
73 | struct nfs4_client; |
74 | struct nfs4_file; | |
75 | ||
9cf514cc CH |
76 | static inline void nfsd4_setup_layout_type(struct svc_export *exp) |
77 | { | |
78 | } | |
79 | ||
80 | static inline void nfsd4_return_all_client_layouts(struct nfs4_client *clp) | |
81 | { | |
82 | } | |
83 | static inline void nfsd4_return_all_file_layouts(struct nfs4_client *clp, | |
84 | struct nfs4_file *fp) | |
85 | { | |
86 | } | |
87 | static inline void nfsd4_exit_pnfs(void) | |
88 | { | |
89 | } | |
90 | static inline int nfsd4_init_pnfs(void) | |
91 | { | |
92 | return 0; | |
93 | } | |
94 | #endif /* CONFIG_NFSD_PNFS */ | |
95 | #endif /* _FS_NFSD_PNFS_H */ |