syscall.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. #ifndef NFSD_SYSCALL_H
  9. #define NFSD_SYSCALL_H
  10. #include <linux/types.h>
  11. #include <linux/nfsd/export.h>
  12. /*
  13. * Version of the syscall interface
  14. */
  15. #define NFSCTL_VERSION 0x0201
  16. /*
  17. * These are the commands understood by nfsctl().
  18. */
  19. #define NFSCTL_SVC 0 /* This is a server process. */
  20. #define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
  21. #define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
  22. #define NFSCTL_EXPORT 3 /* export a file system. */
  23. #define NFSCTL_UNEXPORT 4 /* unexport a file system. */
  24. /*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */
  25. /*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */
  26. #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
  27. #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
  28. /* SVC */
  29. struct nfsctl_svc {
  30. unsigned short svc_port;
  31. int svc_nthreads;
  32. };
  33. /* ADDCLIENT/DELCLIENT */
  34. struct nfsctl_client {
  35. char cl_ident[NFSCLNT_IDMAX+1];
  36. int cl_naddr;
  37. struct in_addr cl_addrlist[NFSCLNT_ADDRMAX];
  38. int cl_fhkeytype;
  39. int cl_fhkeylen;
  40. unsigned char cl_fhkey[NFSCLNT_KEYMAX];
  41. };
  42. /* EXPORT/UNEXPORT */
  43. struct nfsctl_export {
  44. char ex_client[NFSCLNT_IDMAX+1];
  45. char ex_path[NFS_MAXPATHLEN+1];
  46. __kernel_old_dev_t ex_dev;
  47. __kernel_ino_t ex_ino;
  48. int ex_flags;
  49. __kernel_uid_t ex_anon_uid;
  50. __kernel_gid_t ex_anon_gid;
  51. };
  52. /* GETFD */
  53. struct nfsctl_fdparm {
  54. struct sockaddr gd_addr;
  55. char gd_path[NFS_MAXPATHLEN+1];
  56. int gd_version;
  57. };
  58. /* GETFS - GET Filehandle with Size */
  59. struct nfsctl_fsparm {
  60. struct sockaddr gd_addr;
  61. char gd_path[NFS_MAXPATHLEN+1];
  62. int gd_maxlen;
  63. };
  64. /*
  65. * This is the argument union.
  66. */
  67. struct nfsctl_arg {
  68. int ca_version; /* safeguard */
  69. union {
  70. struct nfsctl_svc u_svc;
  71. struct nfsctl_client u_client;
  72. struct nfsctl_export u_export;
  73. struct nfsctl_fdparm u_getfd;
  74. struct nfsctl_fsparm u_getfs;
  75. /*
  76. * The following dummy member is needed to preserve binary compatibility
  77. * on platforms where alignof(void*)>alignof(int). It's needed because
  78. * this union used to contain a member (u_umap) which contained a
  79. * pointer.
  80. */
  81. void *u_ptr;
  82. } u;
  83. #define ca_svc u.u_svc
  84. #define ca_client u.u_client
  85. #define ca_export u.u_export
  86. #define ca_getfd u.u_getfd
  87. #define ca_getfs u.u_getfs
  88. };
  89. union nfsctl_res {
  90. __u8 cr_getfh[NFS_FHSIZE];
  91. struct knfsd_fh cr_getfs;
  92. };
  93. #ifdef __KERNEL__
  94. /*
  95. * Kernel syscall implementation.
  96. */
  97. extern int exp_addclient(struct nfsctl_client *ncp);
  98. extern int exp_delclient(struct nfsctl_client *ncp);
  99. extern int exp_export(struct nfsctl_export *nxp);
  100. extern int exp_unexport(struct nfsctl_export *nxp);
  101. #endif /* __KERNEL__ */
  102. #endif /* NFSD_SYSCALL_H */