1 #ifndef _FS_NFSD_PNFS_H
2 #define _FS_NFSD_PNFS_H 1
5 #include <linux/exportfs.h>
6 #include <linux/nfsd/export.h>
13 struct nfsd4_deviceid_map
{
14 struct list_head hash
;
20 struct nfsd4_layout_ops
{
23 __be32 (*proc_getdeviceinfo
)(struct super_block
*sb
,
24 struct nfs4_client
*clp
,
25 struct nfsd4_getdeviceinfo
*gdevp
);
26 __be32 (*encode_getdeviceinfo
)(struct xdr_stream
*xdr
,
27 struct nfsd4_getdeviceinfo
*gdevp
);
29 __be32 (*proc_layoutget
)(struct inode
*, const struct svc_fh
*fhp
,
30 struct nfsd4_layoutget
*lgp
);
31 __be32 (*encode_layoutget
)(struct xdr_stream
*,
32 struct nfsd4_layoutget
*lgp
);
34 __be32 (*proc_layoutcommit
)(struct inode
*inode
,
35 struct nfsd4_layoutcommit
*lcp
);
37 void (*fence_client
)(struct nfs4_layout_stateid
*ls
);
40 extern const struct nfsd4_layout_ops
*nfsd4_layout_ops
[];
41 #ifdef CONFIG_NFSD_BLOCKLAYOUT
42 extern const struct nfsd4_layout_ops bl_layout_ops
;
44 #ifdef CONFIG_NFSD_SCSILAYOUT
45 extern const struct nfsd4_layout_ops scsi_layout_ops
;
48 __be32
nfsd4_preprocess_layout_stateid(struct svc_rqst
*rqstp
,
49 struct nfsd4_compound_state
*cstate
, stateid_t
*stateid
,
50 bool create
, u32 layout_type
, struct nfs4_layout_stateid
**lsp
);
51 __be32
nfsd4_insert_layout(struct nfsd4_layoutget
*lgp
,
52 struct nfs4_layout_stateid
*ls
);
53 __be32
nfsd4_return_file_layouts(struct svc_rqst
*rqstp
,
54 struct nfsd4_compound_state
*cstate
,
55 struct nfsd4_layoutreturn
*lrp
);
56 __be32
nfsd4_return_client_layouts(struct svc_rqst
*rqstp
,
57 struct nfsd4_compound_state
*cstate
,
58 struct nfsd4_layoutreturn
*lrp
);
59 int nfsd4_set_deviceid(struct nfsd4_deviceid
*id
, const struct svc_fh
*fhp
,
60 u32 device_generation
);
61 struct nfsd4_deviceid_map
*nfsd4_find_devid_map(int idx
);
62 #endif /* CONFIG_NFSD_V4 */
64 #ifdef CONFIG_NFSD_PNFS
65 void nfsd4_setup_layout_type(struct svc_export
*exp
);
66 void nfsd4_return_all_client_layouts(struct nfs4_client
*);
67 void nfsd4_return_all_file_layouts(struct nfs4_client
*clp
,
68 struct nfs4_file
*fp
);
69 int nfsd4_init_pnfs(void);
70 void nfsd4_exit_pnfs(void);
75 static inline void nfsd4_setup_layout_type(struct svc_export
*exp
)
79 static inline void nfsd4_return_all_client_layouts(struct nfs4_client
*clp
)
82 static inline void nfsd4_return_all_file_layouts(struct nfs4_client
*clp
,
86 static inline void nfsd4_exit_pnfs(void)
89 static inline int nfsd4_init_pnfs(void)
93 #endif /* CONFIG_NFSD_PNFS */
94 #endif /* _FS_NFSD_PNFS_H */