2 * include/linux/nfsd/syscall.h
4 * This file holds all declarations for the knfsd syscall interface.
6 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
10 #define NFSD_SYSCALL_H
12 #include <asm/types.h>
14 # include <linux/config.h>
15 # include <linux/types.h>
16 # include <linux/in.h>
18 #include <linux/posix_types.h>
19 #include <linux/nfsd/const.h>
20 #include <linux/nfsd/export.h>
21 #include <linux/nfsd/nfsfh.h>
22 #include <linux/nfsd/auth.h>
25 * Version of the syscall interface
27 #define NFSCTL_VERSION 0x0201
30 * These are the commands understood by nfsctl().
32 #define NFSCTL_SVC 0 /* This is a server process. */
33 #define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
34 #define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
35 #define NFSCTL_EXPORT 3 /* export a file system. */
36 #define NFSCTL_UNEXPORT 4 /* unexport a file system. */
37 /*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */
38 /*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */
39 #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
40 #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
43 * Macros used to set version
45 #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v)))
46 #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
47 #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
49 #if defined(CONFIG_NFSD_V4)
50 #define NFSCTL_VERALL (0x1c /* 0b011100 */)
51 #elif defined(CONFIG_NFSD_V3)
52 #define NFSCTL_VERALL (0x0c /* 0b001100 */)
54 #define NFSCTL_VERALL (0x04 /* 0b000100 */)
59 unsigned short svc_port
;
63 /* ADDCLIENT/DELCLIENT */
64 struct nfsctl_client
{
65 char cl_ident
[NFSCLNT_IDMAX
+1];
67 struct in_addr cl_addrlist
[NFSCLNT_ADDRMAX
];
70 unsigned char cl_fhkey
[NFSCLNT_KEYMAX
];
74 struct nfsctl_export
{
75 char ex_client
[NFSCLNT_IDMAX
+1];
76 char ex_path
[NFS_MAXPATHLEN
+1];
77 __kernel_old_dev_t ex_dev
;
78 __kernel_ino_t ex_ino
;
80 __kernel_uid_t ex_anon_uid
;
81 __kernel_gid_t ex_anon_gid
;
85 struct nfsctl_fdparm
{
86 struct sockaddr gd_addr
;
87 char gd_path
[NFS_MAXPATHLEN
+1];
91 /* GETFS - GET Filehandle with Size */
92 struct nfsctl_fsparm
{
93 struct sockaddr gd_addr
;
94 char gd_path
[NFS_MAXPATHLEN
+1];
99 * This is the argument union.
102 int ca_version
; /* safeguard */
104 struct nfsctl_svc u_svc
;
105 struct nfsctl_client u_client
;
106 struct nfsctl_export u_export
;
107 struct nfsctl_fdparm u_getfd
;
108 struct nfsctl_fsparm u_getfs
;
110 * The following dummy member is needed to preserve binary compatibility
111 * on platforms where alignof(void*)>alignof(int). It's needed because
112 * this union used to contain a member (u_umap) which contained a
117 #define ca_svc u.u_svc
118 #define ca_client u.u_client
119 #define ca_export u.u_export
120 #define ca_getfd u.u_getfd
121 #define ca_getfs u.u_getfs
125 __u8 cr_getfh
[NFS_FHSIZE
];
126 struct knfsd_fh cr_getfs
;
131 * Kernel syscall implementation.
133 extern int exp_addclient(struct nfsctl_client
*ncp
);
134 extern int exp_delclient(struct nfsctl_client
*ncp
);
135 extern int exp_export(struct nfsctl_export
*nxp
);
136 extern int exp_unexport(struct nfsctl_export
*nxp
);
138 extern unsigned int nfsd_versbits
;
140 #endif /* __KERNEL__ */
142 #endif /* NFSD_SYSCALL_H */