const.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef _LINUX_NFSD_CONST_H
  9. #define _LINUX_NFSD_CONST_H
  10. #include <linux/nfs.h>
  11. #include <linux/nfs2.h>
  12. #include <linux/nfs3.h>
  13. #include <linux/nfs4.h>
  14. /*
  15. * Maximum protocol version supported by knfsd
  16. */
  17. #define NFSSVC_MAXVERS 3
  18. /*
  19. * Maximum blocksizes supported by daemon under various circumstances.
  20. */
  21. #define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
  22. /* NFSv2 is limited by the protocol specification, see RFC 1094 */
  23. #define NFSSVC_MAXBLKSIZE_V2 (8*1024)
  24. #ifdef __KERNEL__
  25. #include <linux/sunrpc/msg_prot.h>
  26. /*
  27. * Largest number of bytes we need to allocate for an NFS
  28. * call or reply. Used to control buffer sizes. We use
  29. * the length of v3 WRITE, READDIR and READDIR replies
  30. * which are an RPC header, up to 26 XDR units of reply
  31. * data, and some page data.
  32. *
  33. * Note that accuracy here doesn't matter too much as the
  34. * size is rounded up to a page size when allocating space.
  35. */
  36. #define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE)
  37. #ifdef CONFIG_NFSD_V4
  38. # define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE
  39. #elif defined(CONFIG_NFSD_V3)
  40. # define NFSSVC_XDRSIZE NFS3_SVC_XDRSIZE
  41. #else
  42. # define NFSSVC_XDRSIZE NFS2_SVC_XDRSIZE
  43. #endif
  44. #endif /* __KERNEL__ */
  45. #endif /* _LINUX_NFSD_CONST_H */