const.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef NFS_SUPER_MAGIC
  27. # define NFS_SUPER_MAGIC 0x6969
  28. #endif
  29. /*
  30. * Largest number of bytes we need to allocate for an NFS
  31. * call or reply. Used to control buffer sizes. We use
  32. * the length of v3 WRITE, READDIR and READDIR replies
  33. * which are an RPC header, up to 26 XDR units of reply
  34. * data, and some page data.
  35. *
  36. * Note that accuracy here doesn't matter too much as the
  37. * size is rounded up to a page size when allocating space.
  38. */
  39. #define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE)
  40. #ifdef CONFIG_NFSD_V4
  41. # define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE
  42. #elif defined(CONFIG_NFSD_V3)
  43. # define NFSSVC_XDRSIZE NFS3_SVC_XDRSIZE
  44. #else
  45. # define NFSSVC_XDRSIZE NFS2_SVC_XDRSIZE
  46. #endif
  47. #endif /* __KERNEL__ */
  48. #endif /* _LINUX_NFSD_CONST_H */