nfs_fs_sb.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #ifndef _NFS_FS_SB
  2. #define _NFS_FS_SB
  3. #include <linux/list.h>
  4. #include <linux/backing-dev.h>
  5. struct nfs_iostats;
  6. /*
  7. * The nfs_client identifies our client state to the server.
  8. */
  9. struct nfs_client {
  10. atomic_t cl_count;
  11. int cl_cons_state; /* current construction state (-ve: init error) */
  12. #define NFS_CS_READY 0 /* ready to be used */
  13. #define NFS_CS_INITING 1 /* busy initialising */
  14. int cl_nfsversion; /* NFS protocol version */
  15. unsigned long cl_res_state; /* NFS resources state */
  16. #define NFS_CS_RPCIOD 0 /* - rpciod started */
  17. #define NFS_CS_CALLBACK 1 /* - callback started */
  18. #define NFS_CS_IDMAP 2 /* - idmap started */
  19. struct sockaddr_in cl_addr; /* server identifier */
  20. char * cl_hostname; /* hostname of server */
  21. struct list_head cl_share_link; /* link in global client list */
  22. struct list_head cl_superblocks; /* List of nfs_server structs */
  23. struct rpc_clnt * cl_rpcclient;
  24. #ifdef CONFIG_NFS_V4
  25. u64 cl_clientid; /* constant */
  26. nfs4_verifier cl_confirm;
  27. unsigned long cl_state;
  28. u32 cl_lockowner_id;
  29. /*
  30. * The following rwsem ensures exclusive access to the server
  31. * while we recover the state following a lease expiration.
  32. */
  33. struct rw_semaphore cl_sem;
  34. struct list_head cl_delegations;
  35. struct list_head cl_state_owners;
  36. struct list_head cl_unused;
  37. int cl_nunused;
  38. spinlock_t cl_lock;
  39. unsigned long cl_lease_time;
  40. unsigned long cl_last_renewal;
  41. struct work_struct cl_renewd;
  42. struct work_struct cl_recoverd;
  43. struct rpc_wait_queue cl_rpcwaitq;
  44. /* used for the setclientid verifier */
  45. struct timespec cl_boot_time;
  46. /* idmapper */
  47. struct idmap * cl_idmap;
  48. /* Our own IP address, as a null-terminated string.
  49. * This is used to generate the clientid, and the callback address.
  50. */
  51. char cl_ipaddr[16];
  52. unsigned char cl_id_uniquifier;
  53. #endif
  54. };
  55. /*
  56. * NFS client parameters stored in the superblock.
  57. */
  58. struct nfs_server {
  59. struct nfs_client * nfs_client; /* shared client and NFS4 state */
  60. struct rpc_clnt * client; /* RPC client handle */
  61. struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */
  62. struct rpc_clnt * client_acl; /* ACL RPC client handle */
  63. const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */
  64. struct nfs_iostats * io_stats; /* I/O statistics */
  65. struct backing_dev_info backing_dev_info;
  66. int flags; /* various flags */
  67. unsigned int caps; /* server capabilities */
  68. unsigned int rsize; /* read size */
  69. unsigned int rpages; /* read size (in pages) */
  70. unsigned int wsize; /* write size */
  71. unsigned int wpages; /* write size (in pages) */
  72. unsigned int wtmult; /* server disk block size */
  73. unsigned int dtsize; /* readdir size */
  74. unsigned int bsize; /* server block size */
  75. unsigned int acregmin; /* attr cache timeouts */
  76. unsigned int acregmax;
  77. unsigned int acdirmin;
  78. unsigned int acdirmax;
  79. unsigned long retrans_timeo; /* retransmit timeout */
  80. unsigned int retrans_count; /* number of retransmit tries */
  81. unsigned int namelen;
  82. char * hostname; /* remote hostname */
  83. struct nfs_fh fh;
  84. struct sockaddr_in addr;
  85. struct nfs_fsid fsid;
  86. unsigned long mount_time; /* when this fs was mounted */
  87. #ifdef CONFIG_NFS_V4
  88. /* Our own IP address, as a null-terminated string.
  89. * This is used to generate the clientid, and the callback address.
  90. */
  91. char ip_addr[16];
  92. char * mnt_path;
  93. struct list_head nfs4_siblings; /* List of other nfs_server structs
  94. * that share the same clientid
  95. */
  96. u32 attr_bitmask[2];/* V4 bitmask representing the set
  97. of attributes supported on this
  98. filesystem */
  99. u32 acl_bitmask; /* V4 bitmask representing the ACEs
  100. that are supported on this
  101. filesystem */
  102. #endif
  103. };
  104. /* Server capabilities */
  105. #define NFS_CAP_READDIRPLUS (1U << 0)
  106. #define NFS_CAP_HARDLINKS (1U << 1)
  107. #define NFS_CAP_SYMLINKS (1U << 2)
  108. #define NFS_CAP_ACLS (1U << 3)
  109. #define NFS_CAP_ATOMIC_OPEN (1U << 4)
  110. #endif