diff options
Diffstat (limited to 'include/linux/nfsd')
| -rw-r--r-- | include/linux/nfsd/Kbuild | 6 | ||||
| -rw-r--r-- | include/linux/nfsd/const.h | 55 | ||||
| -rw-r--r-- | include/linux/nfsd/syscall.h | 116 |
3 files changed, 177 insertions, 0 deletions
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild new file mode 100644 index 00000000000..55d1467de3c --- /dev/null +++ b/include/linux/nfsd/Kbuild | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | header-y += const.h | ||
| 2 | header-y += debug.h | ||
| 3 | header-y += export.h | ||
| 4 | header-y += nfsfh.h | ||
| 5 | header-y += stats.h | ||
| 6 | header-y += syscall.h | ||
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h new file mode 100644 index 00000000000..323f8cfa060 --- /dev/null +++ b/include/linux/nfsd/const.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/nfsd/const.h | ||
| 3 | * | ||
| 4 | * Various constants related to NFS. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _LINUX_NFSD_CONST_H | ||
| 10 | #define _LINUX_NFSD_CONST_H | ||
| 11 | |||
| 12 | #include <linux/nfs.h> | ||
| 13 | #include <linux/nfs2.h> | ||
| 14 | #include <linux/nfs3.h> | ||
| 15 | #include <linux/nfs4.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * Maximum protocol version supported by knfsd | ||
| 19 | */ | ||
| 20 | #define NFSSVC_MAXVERS 3 | ||
| 21 | |||
| 22 | /* | ||
| 23 | * Maximum blocksizes supported by daemon under various circumstances. | ||
| 24 | */ | ||
| 25 | #define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD | ||
| 26 | /* NFSv2 is limited by the protocol specification, see RFC 1094 */ | ||
| 27 | #define NFSSVC_MAXBLKSIZE_V2 (8*1024) | ||
| 28 | |||
| 29 | #ifdef __KERNEL__ | ||
| 30 | |||
| 31 | #include <linux/sunrpc/msg_prot.h> | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Largest number of bytes we need to allocate for an NFS | ||
| 35 | * call or reply. Used to control buffer sizes. We use | ||
| 36 | * the length of v3 WRITE, READDIR and READDIR replies | ||
| 37 | * which are an RPC header, up to 26 XDR units of reply | ||
| 38 | * data, and some page data. | ||
| 39 | * | ||
| 40 | * Note that accuracy here doesn't matter too much as the | ||
| 41 | * size is rounded up to a page size when allocating space. | ||
| 42 | */ | ||
| 43 | #define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE) | ||
| 44 | |||
| 45 | #ifdef CONFIG_NFSD_V4 | ||
| 46 | # define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE | ||
| 47 | #elif defined(CONFIG_NFSD_V3) | ||
| 48 | # define NFSSVC_XDRSIZE NFS3_SVC_XDRSIZE | ||
| 49 | #else | ||
| 50 | # define NFSSVC_XDRSIZE NFS2_SVC_XDRSIZE | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #endif /* __KERNEL__ */ | ||
| 54 | |||
| 55 | #endif /* _LINUX_NFSD_CONST_H */ | ||
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h new file mode 100644 index 00000000000..812bc1e160d --- /dev/null +++ b/include/linux/nfsd/syscall.h | |||
| @@ -0,0 +1,116 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/nfsd/syscall.h | ||
| 3 | * | ||
| 4 | * This file holds all declarations for the knfsd syscall interface. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef NFSD_SYSCALL_H | ||
| 10 | #define NFSD_SYSCALL_H | ||
| 11 | |||
| 12 | #include <linux/types.h> | ||
| 13 | #include <linux/nfsd/export.h> | ||
| 14 | |||
| 15 | /* | ||
| 16 | * Version of the syscall interface | ||
| 17 | */ | ||
| 18 | #define NFSCTL_VERSION 0x0201 | ||
| 19 | |||
| 20 | /* | ||
| 21 | * These are the commands understood by nfsctl(). | ||
| 22 | */ | ||
| 23 | #define NFSCTL_SVC 0 /* This is a server process. */ | ||
| 24 | #define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */ | ||
| 25 | #define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */ | ||
| 26 | #define NFSCTL_EXPORT 3 /* export a file system. */ | ||
| 27 | #define NFSCTL_UNEXPORT 4 /* unexport a file system. */ | ||
| 28 | /*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */ | ||
| 29 | /*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */ | ||
| 30 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ | ||
| 31 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ | ||
| 32 | |||
| 33 | /* SVC */ | ||
| 34 | struct nfsctl_svc { | ||
| 35 | unsigned short svc_port; | ||
| 36 | int svc_nthreads; | ||
| 37 | }; | ||
| 38 | |||
| 39 | /* ADDCLIENT/DELCLIENT */ | ||
| 40 | struct nfsctl_client { | ||
| 41 | char cl_ident[NFSCLNT_IDMAX+1]; | ||
| 42 | int cl_naddr; | ||
| 43 | struct in_addr cl_addrlist[NFSCLNT_ADDRMAX]; | ||
| 44 | int cl_fhkeytype; | ||
| 45 | int cl_fhkeylen; | ||
| 46 | unsigned char cl_fhkey[NFSCLNT_KEYMAX]; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* EXPORT/UNEXPORT */ | ||
| 50 | struct nfsctl_export { | ||
| 51 | char ex_client[NFSCLNT_IDMAX+1]; | ||
| 52 | char ex_path[NFS_MAXPATHLEN+1]; | ||
| 53 | __kernel_old_dev_t ex_dev; | ||
| 54 | __kernel_ino_t ex_ino; | ||
| 55 | int ex_flags; | ||
| 56 | __kernel_uid_t ex_anon_uid; | ||
| 57 | __kernel_gid_t ex_anon_gid; | ||
| 58 | }; | ||
| 59 | |||
| 60 | /* GETFD */ | ||
| 61 | struct nfsctl_fdparm { | ||
| 62 | struct sockaddr gd_addr; | ||
| 63 | char gd_path[NFS_MAXPATHLEN+1]; | ||
| 64 | int gd_version; | ||
| 65 | }; | ||
| 66 | |||
| 67 | /* GETFS - GET Filehandle with Size */ | ||
| 68 | struct nfsctl_fsparm { | ||
| 69 | struct sockaddr gd_addr; | ||
| 70 | char gd_path[NFS_MAXPATHLEN+1]; | ||
| 71 | int gd_maxlen; | ||
| 72 | }; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * This is the argument union. | ||
| 76 | */ | ||
| 77 | struct nfsctl_arg { | ||
| 78 | int ca_version; /* safeguard */ | ||
| 79 | union { | ||
| 80 | struct nfsctl_svc u_svc; | ||
| 81 | struct nfsctl_client u_client; | ||
| 82 | struct nfsctl_export u_export; | ||
| 83 | struct nfsctl_fdparm u_getfd; | ||
| 84 | struct nfsctl_fsparm u_getfs; | ||
| 85 | /* | ||
| 86 | * The following dummy member is needed to preserve binary compatibility | ||
| 87 | * on platforms where alignof(void*)>alignof(int). It's needed because | ||
| 88 | * this union used to contain a member (u_umap) which contained a | ||
| 89 | * pointer. | ||
| 90 | */ | ||
| 91 | void *u_ptr; | ||
| 92 | } u; | ||
| 93 | #define ca_svc u.u_svc | ||
| 94 | #define ca_client u.u_client | ||
| 95 | #define ca_export u.u_export | ||
| 96 | #define ca_getfd u.u_getfd | ||
| 97 | #define ca_getfs u.u_getfs | ||
| 98 | }; | ||
| 99 | |||
| 100 | union nfsctl_res { | ||
| 101 | __u8 cr_getfh[NFS_FHSIZE]; | ||
| 102 | struct knfsd_fh cr_getfs; | ||
| 103 | }; | ||
| 104 | |||
| 105 | #ifdef __KERNEL__ | ||
| 106 | /* | ||
| 107 | * Kernel syscall implementation. | ||
| 108 | */ | ||
| 109 | extern int exp_addclient(struct nfsctl_client *ncp); | ||
| 110 | extern int exp_delclient(struct nfsctl_client *ncp); | ||
| 111 | extern int exp_export(struct nfsctl_export *nxp); | ||
| 112 | extern int exp_unexport(struct nfsctl_export *nxp); | ||
| 113 | |||
| 114 | #endif /* __KERNEL__ */ | ||
| 115 | |||
| 116 | #endif /* NFSD_SYSCALL_H */ | ||
