aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/state.h
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-09-07 16:06:42 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-09-13 18:29:58 -0400
commitdcef0413da9a17bfca917d8b49baf309ce76b737 (patch)
treeef07ceebbba23e7c2a6e454e6ed57b610354fde7 /fs/nfsd/state.h
parent91a8c04031d051db41ec2a8c15e24622da037382 (diff)
nfsd4: move some of nfs4_stateid into a separate structure
We want delegations to share more with open/lock stateid's, so first we'll pull out some of the common stuff we want to share. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r--fs/nfsd/state.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index ef949eb3a86e..d7fffabb8d56 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -328,10 +328,10 @@ struct nfs4_replay {
328* for lock_owner 328* for lock_owner
329* so_perclient: nfs4_client->cl_perclient entry - used when nfs4_client 329* so_perclient: nfs4_client->cl_perclient entry - used when nfs4_client
330* struct is reaped. 330* struct is reaped.
331* so_perfilestate: heads the list of nfs4_stateid (either open or lock) 331* so_perfilestate: heads the list of nfs4_ol_stateid (either open or lock)
332* and is used to ensure no dangling nfs4_stateid references when we 332* and is used to ensure no dangling nfs4_ol_stateid references when we
333* release a stateowner. 333* release a stateowner.
334* so_perlockowner: (open) nfs4_stateid->st_perlockowner entry - used when 334* so_perlockowner: (open) nfs4_ol_stateid->st_perlockowner entry - used when
335* close is called to reap associated byte-range locks 335* close is called to reap associated byte-range locks
336* so_close_lru: (open) stateowner is placed on this list instead of being 336* so_close_lru: (open) stateowner is placed on this list instead of being
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.
@@ -430,9 +430,9 @@ static inline struct file *find_any_file(struct nfs4_file *f)
430} 430}
431 431
432/* 432/*
433* nfs4_stateid can either be an open stateid or (eventually) a lock stateid 433* nfs4_ol_stateid can either be an open stateid or (eventually) a lock stateid
434* 434*
435* (open)nfs4_stateid: one per (open)nfs4_stateowner, nfs4_file 435* (open)nfs4_ol_stateid: one per (open)nfs4_stateowner, nfs4_file
436* 436*
437* st_hash: stateid_hashtbl[] entry or lockstateid_hashtbl entry 437* st_hash: stateid_hashtbl[] entry or lockstateid_hashtbl entry
438* st_perfile: file_hashtbl[] entry. 438* st_perfile: file_hashtbl[] entry.
@@ -446,22 +446,31 @@ static inline struct file *find_any_file(struct nfs4_file *f)
446* we should consider defining separate structs for the two cases. 446* we should consider defining separate structs for the two cases.
447*/ 447*/
448 448
449struct nfs4_stateid { 449struct nfs4_stid {
450#define NFS4_OPEN_STID 1 450#define NFS4_OPEN_STID 1
451#define NFS4_LOCK_STID 2 451#define NFS4_LOCK_STID 2
452 char st_type; 452 char sc_type;
453 struct list_head st_hash; 453 struct list_head sc_hash;
454 stateid_t sc_stateid;
455};
456
457struct nfs4_ol_stateid {
458 struct nfs4_stid st_stid;
454 struct list_head st_perfile; 459 struct list_head st_perfile;
455 struct list_head st_perstateowner; 460 struct list_head st_perstateowner;
456 struct list_head st_lockowners; 461 struct list_head st_lockowners;
457 struct nfs4_stateowner * st_stateowner; 462 struct nfs4_stateowner * st_stateowner;
458 struct nfs4_file * st_file; 463 struct nfs4_file * st_file;
459 stateid_t st_stateid;
460 unsigned long st_access_bmap; 464 unsigned long st_access_bmap;
461 unsigned long st_deny_bmap; 465 unsigned long st_deny_bmap;
462 struct nfs4_stateid * st_openstp; 466 struct nfs4_ol_stateid * st_openstp;
463}; 467};
464 468
469static inline struct nfs4_ol_stateid *openlockstateid(struct nfs4_stid *s)
470{
471 return container_of(s, struct nfs4_ol_stateid, st_stid);
472}
473
465/* flags for preprocess_seqid_op() */ 474/* flags for preprocess_seqid_op() */
466#define RD_STATE 0x00000010 475#define RD_STATE 0x00000010
467#define WR_STATE 0x00000020 476#define WR_STATE 0x00000020