diff options
Diffstat (limited to 'fs/nfs/nfs4_fs.h')
| -rw-r--r-- | fs/nfs/nfs4_fs.h | 57 |
1 files changed, 47 insertions, 10 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index c538c6106e16..311e15cc8af0 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
| @@ -45,10 +45,29 @@ enum nfs4_client_state { | |||
| 45 | NFS4CLNT_RECLAIM_NOGRACE, | 45 | NFS4CLNT_RECLAIM_NOGRACE, |
| 46 | NFS4CLNT_DELEGRETURN, | 46 | NFS4CLNT_DELEGRETURN, |
| 47 | NFS4CLNT_SESSION_RESET, | 47 | NFS4CLNT_SESSION_RESET, |
| 48 | NFS4CLNT_SESSION_DRAINING, | ||
| 49 | NFS4CLNT_RECALL_SLOT, | 48 | NFS4CLNT_RECALL_SLOT, |
| 50 | }; | 49 | }; |
| 51 | 50 | ||
| 51 | enum nfs4_session_state { | ||
| 52 | NFS4_SESSION_INITING, | ||
| 53 | NFS4_SESSION_DRAINING, | ||
| 54 | }; | ||
| 55 | |||
| 56 | struct nfs4_minor_version_ops { | ||
| 57 | u32 minor_version; | ||
| 58 | |||
| 59 | int (*call_sync)(struct nfs_server *server, | ||
| 60 | struct rpc_message *msg, | ||
| 61 | struct nfs4_sequence_args *args, | ||
| 62 | struct nfs4_sequence_res *res, | ||
| 63 | int cache_reply); | ||
| 64 | int (*validate_stateid)(struct nfs_delegation *, | ||
| 65 | const nfs4_stateid *); | ||
| 66 | const struct nfs4_state_recovery_ops *reboot_recovery_ops; | ||
| 67 | const struct nfs4_state_recovery_ops *nograce_recovery_ops; | ||
| 68 | const struct nfs4_state_maintenance_ops *state_renewal_ops; | ||
| 69 | }; | ||
| 70 | |||
| 52 | /* | 71 | /* |
| 53 | * struct rpc_sequence ensures that RPC calls are sent in the exact | 72 | * struct rpc_sequence ensures that RPC calls are sent in the exact |
| 54 | * order that they appear on the list. | 73 | * order that they appear on the list. |
| @@ -89,7 +108,6 @@ struct nfs_unique_id { | |||
| 89 | */ | 108 | */ |
| 90 | struct nfs4_state_owner { | 109 | struct nfs4_state_owner { |
| 91 | struct nfs_unique_id so_owner_id; | 110 | struct nfs_unique_id so_owner_id; |
| 92 | struct nfs_client *so_client; | ||
| 93 | struct nfs_server *so_server; | 111 | struct nfs_server *so_server; |
| 94 | struct rb_node so_client_node; | 112 | struct rb_node so_client_node; |
| 95 | 113 | ||
| @@ -99,7 +117,6 @@ struct nfs4_state_owner { | |||
| 99 | atomic_t so_count; | 117 | atomic_t so_count; |
| 100 | unsigned long so_flags; | 118 | unsigned long so_flags; |
| 101 | struct list_head so_states; | 119 | struct list_head so_states; |
| 102 | struct list_head so_delegations; | ||
| 103 | struct nfs_seqid_counter so_seqid; | 120 | struct nfs_seqid_counter so_seqid; |
| 104 | struct rpc_sequence so_sequence; | 121 | struct rpc_sequence so_sequence; |
| 105 | }; | 122 | }; |
| @@ -125,10 +142,20 @@ enum { | |||
| 125 | * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN) | 142 | * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN) |
| 126 | */ | 143 | */ |
| 127 | 144 | ||
| 145 | struct nfs4_lock_owner { | ||
| 146 | unsigned int lo_type; | ||
| 147 | #define NFS4_ANY_LOCK_TYPE (0U) | ||
| 148 | #define NFS4_FLOCK_LOCK_TYPE (1U << 0) | ||
| 149 | #define NFS4_POSIX_LOCK_TYPE (1U << 1) | ||
| 150 | union { | ||
| 151 | fl_owner_t posix_owner; | ||
| 152 | pid_t flock_owner; | ||
| 153 | } lo_u; | ||
| 154 | }; | ||
| 155 | |||
| 128 | struct nfs4_lock_state { | 156 | struct nfs4_lock_state { |
| 129 | struct list_head ls_locks; /* Other lock stateids */ | 157 | struct list_head ls_locks; /* Other lock stateids */ |
| 130 | struct nfs4_state * ls_state; /* Pointer to open state */ | 158 | struct nfs4_state * ls_state; /* Pointer to open state */ |
| 131 | fl_owner_t ls_owner; /* POSIX lock owner */ | ||
| 132 | #define NFS_LOCK_INITIALIZED 1 | 159 | #define NFS_LOCK_INITIALIZED 1 |
| 133 | int ls_flags; | 160 | int ls_flags; |
| 134 | struct nfs_seqid_counter ls_seqid; | 161 | struct nfs_seqid_counter ls_seqid; |
| @@ -136,6 +163,7 @@ struct nfs4_lock_state { | |||
| 136 | struct nfs_unique_id ls_id; | 163 | struct nfs_unique_id ls_id; |
| 137 | nfs4_stateid ls_stateid; | 164 | nfs4_stateid ls_stateid; |
| 138 | atomic_t ls_count; | 165 | atomic_t ls_count; |
| 166 | struct nfs4_lock_owner ls_owner; | ||
| 139 | }; | 167 | }; |
| 140 | 168 | ||
| 141 | /* bits for nfs4_state->flags */ | 169 | /* bits for nfs4_state->flags */ |
| @@ -219,11 +247,15 @@ extern int nfs4_open_revalidate(struct inode *, struct dentry *, int, struct nam | |||
| 219 | extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); | 247 | extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); |
| 220 | extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, | 248 | extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, |
| 221 | struct nfs4_fs_locations *fs_locations, struct page *page); | 249 | struct nfs4_fs_locations *fs_locations, struct page *page); |
| 250 | extern void nfs4_release_lockowner(const struct nfs4_lock_state *); | ||
| 222 | 251 | ||
| 223 | extern struct nfs4_state_recovery_ops *nfs4_reboot_recovery_ops[]; | ||
| 224 | extern struct nfs4_state_recovery_ops *nfs4_nograce_recovery_ops[]; | ||
| 225 | #if defined(CONFIG_NFS_V4_1) | 252 | #if defined(CONFIG_NFS_V4_1) |
| 226 | extern int nfs4_setup_sequence(struct nfs_client *clp, | 253 | static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *server) |
| 254 | { | ||
| 255 | return server->nfs_client->cl_session; | ||
| 256 | } | ||
| 257 | |||
| 258 | extern int nfs4_setup_sequence(const struct nfs_server *server, | ||
| 227 | struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, | 259 | struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, |
| 228 | int cache_reply, struct rpc_task *task); | 260 | int cache_reply, struct rpc_task *task); |
| 229 | extern void nfs4_destroy_session(struct nfs4_session *session); | 261 | extern void nfs4_destroy_session(struct nfs4_session *session); |
| @@ -234,7 +266,12 @@ extern int nfs4_init_session(struct nfs_server *server); | |||
| 234 | extern int nfs4_proc_get_lease_time(struct nfs_client *clp, | 266 | extern int nfs4_proc_get_lease_time(struct nfs_client *clp, |
| 235 | struct nfs_fsinfo *fsinfo); | 267 | struct nfs_fsinfo *fsinfo); |
| 236 | #else /* CONFIG_NFS_v4_1 */ | 268 | #else /* CONFIG_NFS_v4_1 */ |
| 237 | static inline int nfs4_setup_sequence(struct nfs_client *clp, | 269 | static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *server) |
| 270 | { | ||
| 271 | return NULL; | ||
| 272 | } | ||
| 273 | |||
| 274 | static inline int nfs4_setup_sequence(const struct nfs_server *server, | ||
| 238 | struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, | 275 | struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, |
| 239 | int cache_reply, struct rpc_task *task) | 276 | int cache_reply, struct rpc_task *task) |
| 240 | { | 277 | { |
| @@ -247,7 +284,7 @@ static inline int nfs4_init_session(struct nfs_server *server) | |||
| 247 | } | 284 | } |
| 248 | #endif /* CONFIG_NFS_V4_1 */ | 285 | #endif /* CONFIG_NFS_V4_1 */ |
| 249 | 286 | ||
| 250 | extern struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[]; | 287 | extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; |
| 251 | 288 | ||
| 252 | extern const u32 nfs4_fattr_bitmap[2]; | 289 | extern const u32 nfs4_fattr_bitmap[2]; |
| 253 | extern const u32 nfs4_statfs_bitmap[2]; | 290 | extern const u32 nfs4_statfs_bitmap[2]; |
| @@ -284,7 +321,7 @@ extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags) | |||
| 284 | extern void nfs41_handle_recall_slot(struct nfs_client *clp); | 321 | extern void nfs41_handle_recall_slot(struct nfs_client *clp); |
| 285 | extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp); | 322 | extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp); |
| 286 | extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl); | 323 | extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl); |
| 287 | extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t); | 324 | extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t, pid_t); |
| 288 | 325 | ||
| 289 | extern struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter, gfp_t gfp_mask); | 326 | extern struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter, gfp_t gfp_mask); |
| 290 | extern int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task); | 327 | extern int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task); |
