1 #ifndef _FS_NFSD_PNFS_H
2 #define _FS_NFSD_PNFS_H 1
4 #include <linux/exportfs.h>
5 #include <linux/nfsd/export.h>
12 struct nfsd4_deviceid_map {
13 struct list_head hash;
19 struct nfsd4_layout_ops {
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);
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);
32 __be32 (*proc_layoutcommit)(struct inode *inode,
33 struct nfsd4_layoutcommit *lcp);
36 extern const struct nfsd4_layout_ops *nfsd4_layout_ops[];
37 extern const struct nfsd4_layout_ops bl_layout_ops;
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);
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);
62 static inline void nfsd4_setup_layout_type(struct svc_export *exp)
66 static inline void nfsd4_return_all_client_layouts(struct nfs4_client *clp)
69 static inline void nfsd4_return_all_file_layouts(struct nfs4_client *clp,
73 static inline void nfsd4_exit_pnfs(void)
76 static inline int nfsd4_init_pnfs(void)
80 #endif /* CONFIG_NFSD_PNFS */
81 #endif /* _FS_NFSD_PNFS_H */