Linux Audio

Check our new training course

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