diff options
Diffstat (limited to 'fs/nfs/nfs4_fs.h')
-rw-r--r-- | fs/nfs/nfs4_fs.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index ea790645fda6..4e4d33204376 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -38,8 +38,12 @@ struct idmap; | |||
38 | ((err) != NFSERR_NOFILEHANDLE)) | 38 | ((err) != NFSERR_NOFILEHANDLE)) |
39 | 39 | ||
40 | enum nfs4_client_state { | 40 | enum nfs4_client_state { |
41 | NFS4CLNT_STATE_RECOVER = 0, | 41 | NFS4CLNT_MANAGER_RUNNING = 0, |
42 | NFS4CLNT_CHECK_LEASE, | ||
42 | NFS4CLNT_LEASE_EXPIRED, | 43 | NFS4CLNT_LEASE_EXPIRED, |
44 | NFS4CLNT_RECLAIM_REBOOT, | ||
45 | NFS4CLNT_RECLAIM_NOGRACE, | ||
46 | NFS4CLNT_DELEGRETURN, | ||
43 | }; | 47 | }; |
44 | 48 | ||
45 | /* | 49 | /* |
@@ -90,12 +94,18 @@ struct nfs4_state_owner { | |||
90 | 94 | ||
91 | spinlock_t so_lock; | 95 | spinlock_t so_lock; |
92 | atomic_t so_count; | 96 | atomic_t so_count; |
97 | unsigned long so_flags; | ||
93 | struct list_head so_states; | 98 | struct list_head so_states; |
94 | struct list_head so_delegations; | 99 | struct list_head so_delegations; |
95 | struct nfs_seqid_counter so_seqid; | 100 | struct nfs_seqid_counter so_seqid; |
96 | struct rpc_sequence so_sequence; | 101 | struct rpc_sequence so_sequence; |
97 | }; | 102 | }; |
98 | 103 | ||
104 | enum { | ||
105 | NFS_OWNER_RECLAIM_REBOOT, | ||
106 | NFS_OWNER_RECLAIM_NOGRACE | ||
107 | }; | ||
108 | |||
99 | /* | 109 | /* |
100 | * struct nfs4_state maintains the client-side state for a given | 110 | * struct nfs4_state maintains the client-side state for a given |
101 | * (state_owner,inode) tuple (OPEN) or state_owner (LOCK). | 111 | * (state_owner,inode) tuple (OPEN) or state_owner (LOCK). |
@@ -128,6 +138,8 @@ enum { | |||
128 | NFS_O_RDONLY_STATE, /* OPEN stateid has read-only state */ | 138 | NFS_O_RDONLY_STATE, /* OPEN stateid has read-only state */ |
129 | NFS_O_WRONLY_STATE, /* OPEN stateid has write-only state */ | 139 | NFS_O_WRONLY_STATE, /* OPEN stateid has write-only state */ |
130 | NFS_O_RDWR_STATE, /* OPEN stateid has read/write state */ | 140 | NFS_O_RDWR_STATE, /* OPEN stateid has read/write state */ |
141 | NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */ | ||
142 | NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */ | ||
131 | }; | 143 | }; |
132 | 144 | ||
133 | struct nfs4_state { | 145 | struct nfs4_state { |
@@ -149,7 +161,7 @@ struct nfs4_state { | |||
149 | unsigned int n_rdonly; /* Number of read-only references */ | 161 | unsigned int n_rdonly; /* Number of read-only references */ |
150 | unsigned int n_wronly; /* Number of write-only references */ | 162 | unsigned int n_wronly; /* Number of write-only references */ |
151 | unsigned int n_rdwr; /* Number of read/write references */ | 163 | unsigned int n_rdwr; /* Number of read/write references */ |
152 | int state; /* State on the server (R,W, or RW) */ | 164 | fmode_t state; /* State on the server (R,W, or RW) */ |
153 | atomic_t count; | 165 | atomic_t count; |
154 | }; | 166 | }; |
155 | 167 | ||
@@ -157,9 +169,12 @@ struct nfs4_state { | |||
157 | struct nfs4_exception { | 169 | struct nfs4_exception { |
158 | long timeout; | 170 | long timeout; |
159 | int retry; | 171 | int retry; |
172 | struct nfs4_state *state; | ||
160 | }; | 173 | }; |
161 | 174 | ||
162 | struct nfs4_state_recovery_ops { | 175 | struct nfs4_state_recovery_ops { |
176 | int owner_flag_bit; | ||
177 | int state_flag_bit; | ||
163 | int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *); | 178 | int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *); |
164 | int (*recover_lock)(struct nfs4_state *, struct file_lock *); | 179 | int (*recover_lock)(struct nfs4_state *, struct file_lock *); |
165 | }; | 180 | }; |
@@ -174,7 +189,6 @@ extern ssize_t nfs4_listxattr(struct dentry *, char *, size_t); | |||
174 | 189 | ||
175 | 190 | ||
176 | /* nfs4proc.c */ | 191 | /* nfs4proc.c */ |
177 | extern int nfs4_map_errors(int err); | ||
178 | extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, struct rpc_cred *); | 192 | extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, struct rpc_cred *); |
179 | extern int nfs4_proc_setclientid_confirm(struct nfs_client *, struct rpc_cred *); | 193 | extern int nfs4_proc_setclientid_confirm(struct nfs_client *, struct rpc_cred *); |
180 | extern int nfs4_proc_async_renew(struct nfs_client *, struct rpc_cred *); | 194 | extern int nfs4_proc_async_renew(struct nfs_client *, struct rpc_cred *); |
@@ -187,7 +201,7 @@ extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, | |||
187 | struct nfs4_fs_locations *fs_locations, struct page *page); | 201 | struct nfs4_fs_locations *fs_locations, struct page *page); |
188 | 202 | ||
189 | extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops; | 203 | extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops; |
190 | extern struct nfs4_state_recovery_ops nfs4_network_partition_recovery_ops; | 204 | extern struct nfs4_state_recovery_ops nfs4_nograce_recovery_ops; |
191 | 205 | ||
192 | extern const u32 nfs4_fattr_bitmap[2]; | 206 | extern const u32 nfs4_fattr_bitmap[2]; |
193 | extern const u32 nfs4_statfs_bitmap[2]; | 207 | extern const u32 nfs4_statfs_bitmap[2]; |
@@ -202,16 +216,18 @@ extern void nfs4_kill_renewd(struct nfs_client *); | |||
202 | extern void nfs4_renew_state(struct work_struct *); | 216 | extern void nfs4_renew_state(struct work_struct *); |
203 | 217 | ||
204 | /* nfs4state.c */ | 218 | /* nfs4state.c */ |
205 | struct rpc_cred *nfs4_get_renew_cred(struct nfs_client *clp); | 219 | struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp); |
206 | 220 | ||
207 | extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *); | 221 | extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *); |
208 | extern void nfs4_put_state_owner(struct nfs4_state_owner *); | 222 | extern void nfs4_put_state_owner(struct nfs4_state_owner *); |
209 | extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *); | 223 | extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *); |
210 | extern void nfs4_put_open_state(struct nfs4_state *); | 224 | extern void nfs4_put_open_state(struct nfs4_state *); |
211 | extern void nfs4_close_state(struct path *, struct nfs4_state *, mode_t); | 225 | extern void nfs4_close_state(struct path *, struct nfs4_state *, fmode_t); |
212 | extern void nfs4_close_sync(struct path *, struct nfs4_state *, mode_t); | 226 | extern void nfs4_close_sync(struct path *, struct nfs4_state *, fmode_t); |
213 | extern void nfs4_state_set_mode_locked(struct nfs4_state *, mode_t); | 227 | extern void nfs4_state_set_mode_locked(struct nfs4_state *, fmode_t); |
214 | extern void nfs4_schedule_state_recovery(struct nfs_client *); | 228 | extern void nfs4_schedule_state_recovery(struct nfs_client *); |
229 | extern void nfs4_schedule_state_manager(struct nfs_client *); | ||
230 | extern int nfs4_state_mark_reclaim_nograce(struct nfs_client *clp, struct nfs4_state *state); | ||
215 | extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp); | 231 | extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp); |
216 | extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl); | 232 | extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl); |
217 | extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t); | 233 | extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t); |