Blame view

fs/nfsd/export.h 2.96 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
   * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
4
5
  #ifndef NFSD_EXPORT_H
  #define NFSD_EXPORT_H
9c69de4c9   Christoph Hellwig   nfsd: remove <lin...
6
  #include <linux/sunrpc/cache.h>
616d1ca5d   David Howells   UAPI: (Scripted) ...
7
  #include <uapi/linux/nfsd/export.h>
4bc660377   Jeff Layton   nfsd: include lin...
8
  #include <linux/nfs4.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9

9c69de4c9   Christoph Hellwig   nfsd: remove <lin...
10
11
12
  struct knfsd_fh;
  struct svc_fh;
  struct svc_rqst;
933469190   Manoj Naik   [PATCH] knfsd: nf...
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  /*
   * FS Locations
   */
  
  #define MAX_FS_LOCATIONS	128
  
  struct nfsd4_fs_location {
  	char *hosts; /* colon separated list of hosts */
  	char *path;  /* slash separated list of path components */
  };
  
  struct nfsd4_fs_locations {
  	uint32_t locations_count;
  	struct nfsd4_fs_location *locations;
  /* If we're not actually serving this data ourselves (only providing a
   * list of replicas that do serve it) then we set "migrated": */
  	int migrated;
  };
e677bfe4d   Andy Adamson   knfsd: nfsd4: par...
31
32
  /*
   * We keep an array of pseudoflavors with the export, in order from most
25985edce   Lucas De Marchi   Fix common misspe...
33
   * to least preferred.  For the foreseeable future, we don't expect more
e677bfe4d   Andy Adamson   knfsd: nfsd4: par...
34
35
36
37
   * than the eight pseudoflavors null, unix, krb5, krb5i, krb5p, skpm3,
   * spkm3i, and spkm3p (and using all 8 at once should be rare).
   */
  #define MAX_SECINFO_LIST	8
94eb36892   Kinglong Mee   NFSD: Adds macro ...
38
  #define EX_UUID_LEN		16
e677bfe4d   Andy Adamson   knfsd: nfsd4: par...
39
40
41
42
43
  
  struct exp_flavor_info {
  	u32	pseudoflavor;
  	u32	flags;
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
44
45
46
47
  struct svc_export {
  	struct cache_head	h;
  	struct auth_domain *	ex_client;
  	int			ex_flags;
547754916   Jan Blunck   Use struct path i...
48
  	struct path		ex_path;
4c1e1b34d   Eric W. Biederman   nfsd: Store ex_an...
49
50
  	kuid_t			ex_anon_uid;
  	kgid_t			ex_anon_gid;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
51
  	int			ex_fsid;
af6a4e280   NeilBrown   [PATCH] knfsd: ad...
52
  	unsigned char *		ex_uuid; /* 16 byte fsid */
933469190   Manoj Naik   [PATCH] knfsd: nf...
53
  	struct nfsd4_fs_locations ex_fslocs;
1f53146da   Kinglong Mee   NFSD: Using type ...
54
  	uint32_t		ex_nflavors;
e677bfe4d   Andy Adamson   knfsd: nfsd4: par...
55
  	struct exp_flavor_info	ex_flavors[MAX_SECINFO_LIST];
8a4c39268   Jeff Layton   nfsd: allow nfsd ...
56
  	u32			ex_layout_types;
9cf514ccf   Christoph Hellwig   nfsd: implement p...
57
  	struct nfsd4_deviceid_map *ex_devid_map;
db3a35326   Stanislav Kinsbursky   nfsd: add link to...
58
  	struct cache_detail	*cd;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
59
60
61
  };
  
  /* an "export key" (expkey) maps a filehandlefragement to an
af6a4e280   NeilBrown   [PATCH] knfsd: ad...
62
63
   * svc_export for a given client.  There can be several per export,
   * for the different fsid types.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
64
65
66
67
68
69
   */
  struct svc_expkey {
  	struct cache_head	h;
  
  	struct auth_domain *	ek_client;
  	int			ek_fsidtype;
af6a4e280   NeilBrown   [PATCH] knfsd: ad...
70
  	u32			ek_fsid[6];
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
71

e83aece3a   Jan Blunck   Use struct path i...
72
  	struct path		ek_path;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
73
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
74
  #define EX_ISSYNC(exp)		(!((exp)->ex_flags & NFSEXP_ASYNC))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
75
76
  #define EX_NOHIDE(exp)		((exp)->ex_flags & NFSEXP_NOHIDE)
  #define EX_WGATHER(exp)		((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
c7d51402d   J. Bruce Fields   knfsd: clean up E...
77
  int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp);
32c1eb0cd   Andy Adamson   knfsd: nfsd4: ret...
78
  __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
79
80
81
82
  
  /*
   * Function declarations
   */
b89109bef   Stanislav Kinsbursky   nfsd: pass networ...
83
84
  int			nfsd_export_init(struct net *);
  void			nfsd_export_shutdown(struct net *);
b3853e0ea   Stanislav Kinsbursky   nfsd: make export...
85
  void			nfsd_export_flush(struct net *);
0989a7889   J. Bruce Fields   knfsd: nfsd: prov...
86
  struct svc_export *	rqst_exp_get_by_name(struct svc_rqst *,
91c9fa8f7   Al Viro   switch rqst_exp_g...
87
  					     struct path *);
0989a7889   J. Bruce Fields   knfsd: nfsd: prov...
88
  struct svc_export *	rqst_exp_parent(struct svc_rqst *,
e64c390ca   Al Viro   switch rqst_exp_p...
89
  					struct path *);
ed748aacb   Trond Myklebust   NFSD: Cleanup for...
90
  struct svc_export *	rqst_find_fsidzero_export(struct svc_rqst *);
b3853e0ea   Stanislav Kinsbursky   nfsd: make export...
91
  int			exp_rootfh(struct net *, struct auth_domain *,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
92
  					char *path, struct knfsd_fh *, int maxsize);
df547efb0   J. Bruce Fields   knfsd: nfsd4: sim...
93
  __be32			exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
63f103111   Al Viro   [PATCH] nfsd: nfs...
94
  __be32			nfserrno(int errno);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
95

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
96
97
  static inline void exp_put(struct svc_export *exp)
  {
71234978e   Stanislav Kinsbursky   nfsd: use cache d...
98
  	cache_put(&exp->h, exp->cd);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
99
  }
bf18f163e   Kinglong Mee   NFSD: Using exp_g...
100
  static inline struct svc_export *exp_get(struct svc_export *exp)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
101
102
  {
  	cache_get(&exp->h);
bf18f163e   Kinglong Mee   NFSD: Using exp_g...
103
  	return exp;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
104
  }
0989a7889   J. Bruce Fields   knfsd: nfsd: prov...
105
  struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
106

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
107
  #endif /* NFSD_EXPORT_H */