diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-07-30 23:33:59 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-09-07 09:45:49 -0400 |
commit | fe0750e5c43189adb6e6fc59837af7d5a588f413 (patch) | |
tree | 88c5afe7a955f1e55e305639a4d6031237542b8d /fs/nfsd/state.h | |
parent | f4dee24cca98739a4190a00fa014cd1b7e2581a4 (diff) |
nfsd4: split stateowners into open and lockowners
The stateowner has some fields that only make sense for openowners, and
some that only make sense for lockowners, and I find it a lot clearer if
those are separated out.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r-- | fs/nfsd/state.h | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 0d88000d15d7..7994ed9be3cc 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -337,14 +337,11 @@ struct nfs4_replay { | |||
337 | * reaped (when so_perfilestate is empty) to hold the last close replay. | 337 | * reaped (when so_perfilestate is empty) to hold the last close replay. |
338 | * reaped by laundramat thread after lease period. | 338 | * reaped by laundramat thread after lease period. |
339 | */ | 339 | */ |
340 | |||
340 | struct nfs4_stateowner { | 341 | struct nfs4_stateowner { |
341 | struct list_head so_idhash; /* hash by so_id */ | 342 | struct list_head so_idhash; /* hash by so_id */ |
342 | struct list_head so_strhash; /* hash by op_name */ | 343 | struct list_head so_strhash; /* hash by op_name */ |
343 | struct list_head so_perclient; | ||
344 | struct list_head so_stateids; | 344 | struct list_head so_stateids; |
345 | struct list_head so_perstateid; /* for lockowners only */ | ||
346 | struct list_head so_close_lru; /* tail queue */ | ||
347 | time_t so_time; /* time of placement on so_close_lru */ | ||
348 | int so_is_open_owner; /* 1=openowner,0=lockowner */ | 345 | int so_is_open_owner; /* 1=openowner,0=lockowner */ |
349 | u32 so_id; | 346 | u32 so_id; |
350 | struct nfs4_client * so_client; | 347 | struct nfs4_client * so_client; |
@@ -352,10 +349,33 @@ struct nfs4_stateowner { | |||
352 | * sequence id expected from the client: */ | 349 | * sequence id expected from the client: */ |
353 | u32 so_seqid; | 350 | u32 so_seqid; |
354 | struct xdr_netobj so_owner; /* open owner name */ | 351 | struct xdr_netobj so_owner; /* open owner name */ |
355 | int so_confirmed; /* successful OPEN_CONFIRM? */ | ||
356 | struct nfs4_replay so_replay; | 352 | struct nfs4_replay so_replay; |
357 | }; | 353 | }; |
358 | 354 | ||
355 | struct nfs4_openowner { | ||
356 | struct nfs4_stateowner oo_owner; /* must be first field */ | ||
357 | struct list_head oo_perclient; | ||
358 | struct list_head oo_close_lru; /* tail queue */ | ||
359 | time_t oo_time; /* time of placement on so_close_lru */ | ||
360 | int oo_confirmed; /* successful OPEN_CONFIRM? */ | ||
361 | }; | ||
362 | |||
363 | struct nfs4_lockowner { | ||
364 | struct nfs4_stateowner lo_owner; /* must be first element */ | ||
365 | struct list_head lo_perstateid; /* for lockowners only */ | ||
366 | struct list_head lo_list; /* for temporary uses */ | ||
367 | }; | ||
368 | |||
369 | static inline struct nfs4_openowner * openowner(struct nfs4_stateowner *so) | ||
370 | { | ||
371 | return container_of(so, struct nfs4_openowner, oo_owner); | ||
372 | } | ||
373 | |||
374 | static inline struct nfs4_lockowner * lockowner(struct nfs4_stateowner *so) | ||
375 | { | ||
376 | return container_of(so, struct nfs4_lockowner, lo_owner); | ||
377 | } | ||
378 | |||
359 | /* | 379 | /* |
360 | * nfs4_file: a file opened by some number of (open) nfs4_stateowners. | 380 | * nfs4_file: a file opened by some number of (open) nfs4_stateowners. |
361 | * o fi_perfile list is used to search for conflicting | 381 | * o fi_perfile list is used to search for conflicting |
@@ -457,7 +477,8 @@ extern void nfs4_lock_state(void); | |||
457 | extern void nfs4_unlock_state(void); | 477 | extern void nfs4_unlock_state(void); |
458 | extern int nfs4_in_grace(void); | 478 | extern int nfs4_in_grace(void); |
459 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | 479 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); |
460 | extern void nfs4_free_stateowner(struct nfs4_stateowner *sop); | 480 | extern void nfs4_free_openowner(struct nfs4_openowner *); |
481 | extern void nfs4_free_lockowner(struct nfs4_lockowner *); | ||
461 | extern int set_callback_cred(void); | 482 | extern int set_callback_cred(void); |
462 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 483 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |
463 | extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); | 484 | extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); |