2 * include/linux/nfsd/export.h
4 * Public declarations for NFS exports. The definitions for the
5 * syscall interface are in nfsctl.h
7 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
13 #include <asm/types.h>
15 # include <linux/types.h>
16 # include <linux/in.h>
20 * Important limits for the exports stuff.
22 #define NFSCLNT_IDMAX 1024
23 #define NFSCLNT_ADDRMAX 16
24 #define NFSCLNT_KEYMAX 32
29 #define NFSEXP_READONLY 0x0001
30 #define NFSEXP_INSECURE_PORT 0x0002
31 #define NFSEXP_ROOTSQUASH 0x0004
32 #define NFSEXP_ALLSQUASH 0x0008
33 #define NFSEXP_ASYNC 0x0010
34 #define NFSEXP_GATHERED_WRITES 0x0020
35 #define NFSEXP_UIDMAP 0x0040
36 #define NFSEXP_KERBEROS 0x0080 /* not available */
37 #define NFSEXP_SUNSECURE 0x0100
38 #define NFSEXP_CROSSMNT 0x0200
39 #define NFSEXP_NOSUBTREECHECK 0x0400
40 #define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */
41 #define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */
42 #define NFSEXP_ALLFLAGS 0x1FFF
47 /* The following are hashtable sizes and must be powers of 2 */
48 #define NFSCLNT_EXPMAX 16
51 struct svc_client
* cl_next
;
52 char cl_ident
[NFSCLNT_IDMAX
];
55 struct in_addr cl_addr
[NFSCLNT_ADDRMAX
];
56 struct svc_uidmap
* cl_umap
;
57 struct svc_export
* cl_export
[NFSCLNT_EXPMAX
];
61 struct svc_export
* ex_next
;
62 char ex_path
[NFS_MAXPATHLEN
+1];
63 struct svc_export
* ex_parent
;
64 struct svc_client
* ex_client
;
66 struct vfsmount
* ex_mnt
;
67 struct dentry
* ex_dentry
;
74 #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
75 #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC))
76 #define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY)
77 #define EX_CROSSMNT(exp) ((exp)->ex_flags & NFSEXP_CROSSMNT)
78 #define EX_SUNSECURE(exp) ((exp)->ex_flags & NFSEXP_SUNSECURE)
79 #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
83 * Function declarations
85 void nfsd_export_init(void);
86 void nfsd_export_shutdown(void);
87 void exp_readlock(void);
88 int exp_writelock(void);
89 void exp_unlock(void);
90 struct svc_client
* exp_getclient(struct sockaddr_in
*sin
);
91 void exp_putclient(struct svc_client
*clp
);
92 struct svc_export
* exp_get(struct svc_client
*clp
, kdev_t dev
, ino_t ino
);
93 int exp_rootfh(struct svc_client
*, kdev_t
, ino_t
,
94 char *path
, struct knfsd_fh
*, int maxsize
);
95 int nfserrno(int errno
);
96 void exp_nlmdetach(void);
99 #endif /* __KERNEL__ */
101 #endif /* NFSD_EXPORT_H */