]>
Commit | Line | Data |
---|---|---|
9cf514cc CH |
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 | ||
38 | __be32 nfsd4_preprocess_layout_stateid(struct svc_rqst *rqstp, | |
39 | struct nfsd4_compound_state *cstate, stateid_t *stateid, | |
40 | bool create, u32 layout_type, struct nfs4_layout_stateid **lsp); | |
41 | __be32 nfsd4_insert_layout(struct nfsd4_layoutget *lgp, | |
42 | struct nfs4_layout_stateid *ls); | |
43 | __be32 nfsd4_return_file_layouts(struct svc_rqst *rqstp, | |
44 | struct nfsd4_compound_state *cstate, | |
45 | struct nfsd4_layoutreturn *lrp); | |
46 | __be32 nfsd4_return_client_layouts(struct svc_rqst *rqstp, | |
47 | struct nfsd4_compound_state *cstate, | |
48 | struct nfsd4_layoutreturn *lrp); | |
49 | int nfsd4_set_deviceid(struct nfsd4_deviceid *id, const struct svc_fh *fhp, | |
50 | u32 device_generation); | |
51 | struct nfsd4_deviceid_map *nfsd4_find_devid_map(int idx); | |
52 | ||
53 | #ifdef CONFIG_NFSD_PNFS | |
54 | void nfsd4_setup_layout_type(struct svc_export *exp); | |
55 | void nfsd4_return_all_client_layouts(struct nfs4_client *); | |
56 | void nfsd4_return_all_file_layouts(struct nfs4_client *clp, | |
57 | struct nfs4_file *fp); | |
58 | int nfsd4_init_pnfs(void); | |
59 | void nfsd4_exit_pnfs(void); | |
60 | #else | |
61 | static inline void nfsd4_setup_layout_type(struct svc_export *exp) | |
62 | { | |
63 | } | |
64 | ||
65 | static inline void nfsd4_return_all_client_layouts(struct nfs4_client *clp) | |
66 | { | |
67 | } | |
68 | static inline void nfsd4_return_all_file_layouts(struct nfs4_client *clp, | |
69 | struct nfs4_file *fp) | |
70 | { | |
71 | } | |
72 | static inline void nfsd4_exit_pnfs(void) | |
73 | { | |
74 | } | |
75 | static inline int nfsd4_init_pnfs(void) | |
76 | { | |
77 | return 0; | |
78 | } | |
79 | #endif /* CONFIG_NFSD_PNFS */ | |
80 | #endif /* _FS_NFSD_PNFS_H */ |