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, 1996 Olaf Kirch <okir@monad.swb.de>
13 #include <linux/types.h>
14 #include <linux/socket.h>
19 * Important limits for the exports stuff.
21 #define NFSCLNT_IDMAX 1024
22 #define NFSCLNT_ADDRMAX 16
23 #define NFSCLNT_KEYMAX 32
28 #define NFSEXP_READONLY 0x0001
29 #define NFSEXP_INSECURE_PORT 0x0002
30 #define NFSEXP_ROOTSQUASH 0x0004
31 #define NFSEXP_ALLSQUASH 0x0008
32 #define NFSEXP_ASYNC 0x0010
33 #define NFSEXP_GATHERED_WRITES 0x0020
34 #define NFSEXP_UIDMAP 0x0040
35 #define NFSEXP_KERBEROS 0x0080 /* not available */
36 #define NFSEXP_SUNSECURE 0x0100
37 #define NFSEXP_CROSSMNT 0x0200 /* not available */
38 #define NFSEXP_ALLFLAGS 0x03FF
43 /* The following are hashtable sizes and must be powers of 2 */
44 #define NFSCLNT_EXPMAX 16
47 struct svc_client
* cl_next
;
48 char cl_ident
[NFSCLNT_IDMAX
];
51 struct in_addr cl_addr
[NFSCLNT_ADDRMAX
];
52 struct svc_uidmap
* cl_umap
;
53 struct svc_export
* cl_export
[NFSCLNT_EXPMAX
];
57 struct svc_export
* ex_next
;
58 char ex_path
[NFS_MAXPATHLEN
+1];
59 struct svc_export
* ex_parent
;
60 struct svc_client
* ex_client
;
62 struct dentry
* ex_dentry
;
69 #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
70 #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC))
71 #define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY)
72 #define EX_CROSSMNT(exp) ((exp)->ex_flags & NFSEXP_CROSSMNT)
73 #define EX_SUNSECURE(exp) ((exp)->ex_flags & NFSEXP_SUNSECURE)
74 #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
78 * Function declarations
80 void nfsd_export_init(void);
81 void nfsd_export_shutdown(void);
82 void exp_readlock(void);
83 int exp_writelock(void);
84 void exp_unlock(void);
85 struct svc_client
* exp_getclient(struct sockaddr_in
*sin
);
86 void exp_putclient(struct svc_client
*clp
);
87 struct svc_export
* exp_get(struct svc_client
*clp
, kdev_t dev
, ino_t ino
);
88 int exp_rootfh(struct svc_client
*, kdev_t
, ino_t
,
89 char *path
, struct knfs_fh
*);
90 int nfserrno(int errno
);
91 void exp_nlmdetach(void);
95 exp_checkaddr(struct svc_client
*clp
, struct in_addr addr
)
97 struct in_addr
*ap
= clp
->cl_addr
;
100 for (i
= clp
->cl_naddr
; i
--; ap
++)
101 if (ap
->s_addr
== addr
.s_addr
)
106 #endif /* __KERNEL__ */
108 #endif /* NFSD_EXPORT_H */