4 #include <linux/list.h>
5 #include <linux/backing-dev.h>
6 #include <linux/fscache.h>
11 * The nfs_client identifies our client state to the server.
15 int cl_cons_state; /* current construction state (-ve: init error) */
16 #define NFS_CS_READY 0 /* ready to be used */
17 #define NFS_CS_INITING 1 /* busy initialising */
18 int cl_nfsversion; /* NFS protocol version */
19 unsigned long cl_res_state; /* NFS resources state */
20 #define NFS_CS_RPCIOD 0 /* - rpciod started */
21 #define NFS_CS_CALLBACK 1 /* - callback started */
22 #define NFS_CS_IDMAP 2 /* - idmap started */
23 #define NFS_CS_RENEWD 3 /* - renewd started */
24 struct sockaddr_in cl_addr; /* server identifier */
25 char * cl_hostname; /* hostname of server */
26 struct list_head cl_share_link; /* link in global client list */
27 struct list_head cl_superblocks; /* List of nfs_server structs */
29 struct rpc_clnt * cl_rpcclient;
30 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */
31 unsigned long retrans_timeo; /* retransmit timeout */
32 unsigned int retrans_count; /* number of retransmit tries */
35 u64 cl_clientid; /* constant */
36 nfs4_verifier cl_confirm;
37 unsigned long cl_state;
42 * The following rwsem ensures exclusive access to the server
43 * while we recover the state following a lease expiration.
45 struct rw_semaphore cl_sem;
47 struct list_head cl_delegations;
48 struct list_head cl_state_owners;
49 struct list_head cl_unused;
53 unsigned long cl_lease_time;
54 unsigned long cl_last_renewal;
55 struct work_struct cl_renewd;
57 struct rpc_wait_queue cl_rpcwaitq;
59 /* used for the setclientid verifier */
60 struct timespec cl_boot_time;
63 struct idmap * cl_idmap;
65 /* Our own IP address, as a null-terminated string.
66 * This is used to generate the clientid, and the callback address.
69 unsigned char cl_id_uniquifier;
72 #ifdef CONFIG_NFS_FSCACHE
73 struct fscache_cookie *fscache; /* client index cache cookie */
78 * NFS client parameters stored in the superblock.
81 struct nfs_client * nfs_client; /* shared client and NFS4 state */
82 struct list_head client_link; /* List of other nfs_server structs
83 * that share the same client
85 struct list_head master_link; /* link in master servers list */
86 struct rpc_clnt * client; /* RPC client handle */
87 struct rpc_clnt * client_acl; /* ACL RPC client handle */
88 struct nfs_iostats * io_stats; /* I/O statistics */
89 struct backing_dev_info backing_dev_info;
90 int flags; /* various flags */
91 unsigned int caps; /* server capabilities */
92 unsigned int rsize; /* read size */
93 unsigned int rpages; /* read size (in pages) */
94 unsigned int wsize; /* write size */
95 unsigned int wpages; /* write size (in pages) */
96 unsigned int wtmult; /* server disk block size */
97 unsigned int dtsize; /* readdir size */
98 unsigned int bsize; /* server block size */
99 unsigned int acregmin; /* attr cache timeouts */
100 unsigned int acregmax;
101 unsigned int acdirmin;
102 unsigned int acdirmax;
103 unsigned int namelen;
105 struct nfs_fsid fsid;
106 __u64 maxfilesize; /* maximum file size */
107 unsigned long mount_time; /* when this fs was mounted */
108 dev_t s_dev; /* superblock dev numbers */
111 u32 attr_bitmask[2];/* V4 bitmask representing the set
112 of attributes supported on this
114 u32 acl_bitmask; /* V4 bitmask representing the ACEs
115 that are supported on this
118 void (*destroy)(struct nfs_server *);
121 /* Server capabilities */
122 #define NFS_CAP_READDIRPLUS (1U << 0)
123 #define NFS_CAP_HARDLINKS (1U << 1)
124 #define NFS_CAP_SYMLINKS (1U << 2)
125 #define NFS_CAP_ACLS (1U << 3)
126 #define NFS_CAP_ATOMIC_OPEN (1U << 4)