diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-06-24 01:04:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:06:35 -0400 |
commit | ea1da636e956ad1591a74904f23d98bbc26a644b (patch) | |
tree | 193d0667adad25b094e209856dfcc1300d1d85dc /fs | |
parent | 21ab45a480ec7705d177e959ebf452d62340c004 (diff) |
[PATCH] knfsd: nfsd4: rename state list fields
Trivial renaming patch:
I can never remember, while looking at various lists relating the nfsd4 state
structures, which are the "heads" and which are items on other lists, or which
structures are actually on the various lists. The following convention helps
me: given structures foo and bar, with foo containing the head of a list of
bars, use "bars" for the name of the head of the list contained in the struct
foo, and use "per_foo" for the entries in the struct bars.
Already done for struct nfs4_file; go ahead and do it for the other nfsd4
state structures.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4state.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 884115198116..22e76e3f06a5 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -154,8 +154,8 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f | |||
154 | dp = kmem_cache_alloc(deleg_slab, GFP_KERNEL); | 154 | dp = kmem_cache_alloc(deleg_slab, GFP_KERNEL); |
155 | if (dp == NULL) | 155 | if (dp == NULL) |
156 | return dp; | 156 | return dp; |
157 | INIT_LIST_HEAD(&dp->dl_del_perfile); | 157 | INIT_LIST_HEAD(&dp->dl_perfile); |
158 | INIT_LIST_HEAD(&dp->dl_del_perclnt); | 158 | INIT_LIST_HEAD(&dp->dl_perclnt); |
159 | INIT_LIST_HEAD(&dp->dl_recall_lru); | 159 | INIT_LIST_HEAD(&dp->dl_recall_lru); |
160 | dp->dl_client = clp; | 160 | dp->dl_client = clp; |
161 | get_nfs4_file(fp); | 161 | get_nfs4_file(fp); |
@@ -176,8 +176,8 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f | |||
176 | current_fh->fh_handle.fh_size); | 176 | current_fh->fh_handle.fh_size); |
177 | dp->dl_time = 0; | 177 | dp->dl_time = 0; |
178 | atomic_set(&dp->dl_count, 1); | 178 | atomic_set(&dp->dl_count, 1); |
179 | list_add(&dp->dl_del_perfile, &fp->fi_delegations); | 179 | list_add(&dp->dl_perfile, &fp->fi_delegations); |
180 | list_add(&dp->dl_del_perclnt, &clp->cl_del_perclnt); | 180 | list_add(&dp->dl_perclnt, &clp->cl_delegations); |
181 | return dp; | 181 | return dp; |
182 | } | 182 | } |
183 | 183 | ||
@@ -214,8 +214,8 @@ nfs4_close_delegation(struct nfs4_delegation *dp) | |||
214 | static void | 214 | static void |
215 | unhash_delegation(struct nfs4_delegation *dp) | 215 | unhash_delegation(struct nfs4_delegation *dp) |
216 | { | 216 | { |
217 | list_del_init(&dp->dl_del_perfile); | 217 | list_del_init(&dp->dl_perfile); |
218 | list_del_init(&dp->dl_del_perclnt); | 218 | list_del_init(&dp->dl_perclnt); |
219 | spin_lock(&recall_lock); | 219 | spin_lock(&recall_lock); |
220 | list_del_init(&dp->dl_recall_lru); | 220 | list_del_init(&dp->dl_recall_lru); |
221 | spin_unlock(&recall_lock); | 221 | spin_unlock(&recall_lock); |
@@ -345,11 +345,11 @@ expire_client(struct nfs4_client *clp) | |||
345 | 345 | ||
346 | INIT_LIST_HEAD(&reaplist); | 346 | INIT_LIST_HEAD(&reaplist); |
347 | spin_lock(&recall_lock); | 347 | spin_lock(&recall_lock); |
348 | while (!list_empty(&clp->cl_del_perclnt)) { | 348 | while (!list_empty(&clp->cl_delegations)) { |
349 | dp = list_entry(clp->cl_del_perclnt.next, struct nfs4_delegation, dl_del_perclnt); | 349 | dp = list_entry(clp->cl_delegations.next, struct nfs4_delegation, dl_perclnt); |
350 | dprintk("NFSD: expire client. dp %p, fp %p\n", dp, | 350 | dprintk("NFSD: expire client. dp %p, fp %p\n", dp, |
351 | dp->dl_flock); | 351 | dp->dl_flock); |
352 | list_del_init(&dp->dl_del_perclnt); | 352 | list_del_init(&dp->dl_perclnt); |
353 | list_move(&dp->dl_recall_lru, &reaplist); | 353 | list_move(&dp->dl_recall_lru, &reaplist); |
354 | } | 354 | } |
355 | spin_unlock(&recall_lock); | 355 | spin_unlock(&recall_lock); |
@@ -361,8 +361,8 @@ expire_client(struct nfs4_client *clp) | |||
361 | list_del(&clp->cl_idhash); | 361 | list_del(&clp->cl_idhash); |
362 | list_del(&clp->cl_strhash); | 362 | list_del(&clp->cl_strhash); |
363 | list_del(&clp->cl_lru); | 363 | list_del(&clp->cl_lru); |
364 | while (!list_empty(&clp->cl_perclient)) { | 364 | while (!list_empty(&clp->cl_openowners)) { |
365 | sop = list_entry(clp->cl_perclient.next, struct nfs4_stateowner, so_perclient); | 365 | sop = list_entry(clp->cl_openowners.next, struct nfs4_stateowner, so_perclient); |
366 | release_stateowner(sop); | 366 | release_stateowner(sop); |
367 | } | 367 | } |
368 | put_nfs4_client(clp); | 368 | put_nfs4_client(clp); |
@@ -380,8 +380,8 @@ create_client(struct xdr_netobj name, char *recdir) { | |||
380 | clp->cl_callback.cb_parsed = 0; | 380 | clp->cl_callback.cb_parsed = 0; |
381 | INIT_LIST_HEAD(&clp->cl_idhash); | 381 | INIT_LIST_HEAD(&clp->cl_idhash); |
382 | INIT_LIST_HEAD(&clp->cl_strhash); | 382 | INIT_LIST_HEAD(&clp->cl_strhash); |
383 | INIT_LIST_HEAD(&clp->cl_perclient); | 383 | INIT_LIST_HEAD(&clp->cl_openowners); |
384 | INIT_LIST_HEAD(&clp->cl_del_perclnt); | 384 | INIT_LIST_HEAD(&clp->cl_delegations); |
385 | INIT_LIST_HEAD(&clp->cl_lru); | 385 | INIT_LIST_HEAD(&clp->cl_lru); |
386 | out: | 386 | out: |
387 | return clp; | 387 | return clp; |
@@ -1074,13 +1074,13 @@ alloc_init_open_stateowner(unsigned int strhashval, struct nfs4_client *clp, str | |||
1074 | INIT_LIST_HEAD(&sop->so_idhash); | 1074 | INIT_LIST_HEAD(&sop->so_idhash); |
1075 | INIT_LIST_HEAD(&sop->so_strhash); | 1075 | INIT_LIST_HEAD(&sop->so_strhash); |
1076 | INIT_LIST_HEAD(&sop->so_perclient); | 1076 | INIT_LIST_HEAD(&sop->so_perclient); |
1077 | INIT_LIST_HEAD(&sop->so_perfilestate); | 1077 | INIT_LIST_HEAD(&sop->so_stateids); |
1078 | INIT_LIST_HEAD(&sop->so_perlockowner); /* not used */ | 1078 | INIT_LIST_HEAD(&sop->so_perstateid); /* not used */ |
1079 | INIT_LIST_HEAD(&sop->so_close_lru); | 1079 | INIT_LIST_HEAD(&sop->so_close_lru); |
1080 | sop->so_time = 0; | 1080 | sop->so_time = 0; |
1081 | list_add(&sop->so_idhash, &ownerid_hashtbl[idhashval]); | 1081 | list_add(&sop->so_idhash, &ownerid_hashtbl[idhashval]); |
1082 | list_add(&sop->so_strhash, &ownerstr_hashtbl[strhashval]); | 1082 | list_add(&sop->so_strhash, &ownerstr_hashtbl[strhashval]); |
1083 | list_add(&sop->so_perclient, &clp->cl_perclient); | 1083 | list_add(&sop->so_perclient, &clp->cl_openowners); |
1084 | sop->so_is_open_owner = 1; | 1084 | sop->so_is_open_owner = 1; |
1085 | sop->so_id = current_ownerid++; | 1085 | sop->so_id = current_ownerid++; |
1086 | sop->so_client = clp; | 1086 | sop->so_client = clp; |
@@ -1098,10 +1098,10 @@ release_stateid_lockowners(struct nfs4_stateid *open_stp) | |||
1098 | { | 1098 | { |
1099 | struct nfs4_stateowner *lock_sop; | 1099 | struct nfs4_stateowner *lock_sop; |
1100 | 1100 | ||
1101 | while (!list_empty(&open_stp->st_perlockowner)) { | 1101 | while (!list_empty(&open_stp->st_lockowners)) { |
1102 | lock_sop = list_entry(open_stp->st_perlockowner.next, | 1102 | lock_sop = list_entry(open_stp->st_lockowners.next, |
1103 | struct nfs4_stateowner, so_perlockowner); | 1103 | struct nfs4_stateowner, so_perstateid); |
1104 | /* list_del(&open_stp->st_perlockowner); */ | 1104 | /* list_del(&open_stp->st_lockowners); */ |
1105 | BUG_ON(lock_sop->so_is_open_owner); | 1105 | BUG_ON(lock_sop->so_is_open_owner); |
1106 | release_stateowner(lock_sop); | 1106 | release_stateowner(lock_sop); |
1107 | } | 1107 | } |
@@ -1116,10 +1116,10 @@ unhash_stateowner(struct nfs4_stateowner *sop) | |||
1116 | list_del(&sop->so_strhash); | 1116 | list_del(&sop->so_strhash); |
1117 | if (sop->so_is_open_owner) | 1117 | if (sop->so_is_open_owner) |
1118 | list_del(&sop->so_perclient); | 1118 | list_del(&sop->so_perclient); |
1119 | list_del(&sop->so_perlockowner); | 1119 | list_del(&sop->so_perstateid); |
1120 | while (!list_empty(&sop->so_perfilestate)) { | 1120 | while (!list_empty(&sop->so_stateids)) { |
1121 | stp = list_entry(sop->so_perfilestate.next, | 1121 | stp = list_entry(sop->so_stateids.next, |
1122 | struct nfs4_stateid, st_perfilestate); | 1122 | struct nfs4_stateid, st_perstateowner); |
1123 | if (sop->so_is_open_owner) | 1123 | if (sop->so_is_open_owner) |
1124 | release_stateid(stp, OPEN_STATE); | 1124 | release_stateid(stp, OPEN_STATE); |
1125 | else | 1125 | else |
@@ -1141,11 +1141,11 @@ init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open * | |||
1141 | unsigned int hashval = stateid_hashval(sop->so_id, fp->fi_id); | 1141 | unsigned int hashval = stateid_hashval(sop->so_id, fp->fi_id); |
1142 | 1142 | ||
1143 | INIT_LIST_HEAD(&stp->st_hash); | 1143 | INIT_LIST_HEAD(&stp->st_hash); |
1144 | INIT_LIST_HEAD(&stp->st_perfilestate); | 1144 | INIT_LIST_HEAD(&stp->st_perstateowner); |
1145 | INIT_LIST_HEAD(&stp->st_perlockowner); | 1145 | INIT_LIST_HEAD(&stp->st_lockowners); |
1146 | INIT_LIST_HEAD(&stp->st_perfile); | 1146 | INIT_LIST_HEAD(&stp->st_perfile); |
1147 | list_add(&stp->st_hash, &stateid_hashtbl[hashval]); | 1147 | list_add(&stp->st_hash, &stateid_hashtbl[hashval]); |
1148 | list_add(&stp->st_perfilestate, &sop->so_perfilestate); | 1148 | list_add(&stp->st_perstateowner, &sop->so_stateids); |
1149 | list_add(&stp->st_perfile, &fp->fi_stateids); | 1149 | list_add(&stp->st_perfile, &fp->fi_stateids); |
1150 | stp->st_stateowner = sop; | 1150 | stp->st_stateowner = sop; |
1151 | get_nfs4_file(fp); | 1151 | get_nfs4_file(fp); |
@@ -1167,7 +1167,7 @@ release_stateid(struct nfs4_stateid *stp, int flags) | |||
1167 | 1167 | ||
1168 | list_del(&stp->st_hash); | 1168 | list_del(&stp->st_hash); |
1169 | list_del(&stp->st_perfile); | 1169 | list_del(&stp->st_perfile); |
1170 | list_del(&stp->st_perfilestate); | 1170 | list_del(&stp->st_perstateowner); |
1171 | if (flags & OPEN_STATE) { | 1171 | if (flags & OPEN_STATE) { |
1172 | release_stateid_lockowners(stp); | 1172 | release_stateid_lockowners(stp); |
1173 | stp->st_vfs_file = NULL; | 1173 | stp->st_vfs_file = NULL; |
@@ -1201,7 +1201,7 @@ release_state_owner(struct nfs4_stateid *stp, int flag) | |||
1201 | * released by the laundromat service after the lease period | 1201 | * released by the laundromat service after the lease period |
1202 | * to enable us to handle CLOSE replay | 1202 | * to enable us to handle CLOSE replay |
1203 | */ | 1203 | */ |
1204 | if (sop->so_confirmed && list_empty(&sop->so_perfilestate)) | 1204 | if (sop->so_confirmed && list_empty(&sop->so_stateids)) |
1205 | move_to_close_lru(sop); | 1205 | move_to_close_lru(sop); |
1206 | } | 1206 | } |
1207 | 1207 | ||
@@ -1548,7 +1548,7 @@ find_delegation_file(struct nfs4_file *fp, stateid_t *stid) | |||
1548 | { | 1548 | { |
1549 | struct nfs4_delegation *dp; | 1549 | struct nfs4_delegation *dp; |
1550 | 1550 | ||
1551 | list_for_each_entry(dp, &fp->fi_delegations, dl_del_perfile) { | 1551 | list_for_each_entry(dp, &fp->fi_delegations, dl_perfile) { |
1552 | if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid) | 1552 | if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid) |
1553 | return dp; | 1553 | return dp; |
1554 | } | 1554 | } |
@@ -1892,7 +1892,7 @@ nfsd4_renew(clientid_t *clid) | |||
1892 | } | 1892 | } |
1893 | renew_client(clp); | 1893 | renew_client(clp); |
1894 | status = nfserr_cb_path_down; | 1894 | status = nfserr_cb_path_down; |
1895 | if (!list_empty(&clp->cl_del_perclnt) | 1895 | if (!list_empty(&clp->cl_delegations) |
1896 | && !atomic_read(&clp->cl_callback.cb_set)) | 1896 | && !atomic_read(&clp->cl_callback.cb_set)) |
1897 | goto out; | 1897 | goto out; |
1898 | status = nfs_ok; | 1898 | status = nfs_ok; |
@@ -2634,13 +2634,13 @@ alloc_init_lock_stateowner(unsigned int strhashval, struct nfs4_client *clp, str | |||
2634 | INIT_LIST_HEAD(&sop->so_idhash); | 2634 | INIT_LIST_HEAD(&sop->so_idhash); |
2635 | INIT_LIST_HEAD(&sop->so_strhash); | 2635 | INIT_LIST_HEAD(&sop->so_strhash); |
2636 | INIT_LIST_HEAD(&sop->so_perclient); | 2636 | INIT_LIST_HEAD(&sop->so_perclient); |
2637 | INIT_LIST_HEAD(&sop->so_perfilestate); | 2637 | INIT_LIST_HEAD(&sop->so_stateids); |
2638 | INIT_LIST_HEAD(&sop->so_perlockowner); | 2638 | INIT_LIST_HEAD(&sop->so_perstateid); |
2639 | INIT_LIST_HEAD(&sop->so_close_lru); /* not used */ | 2639 | INIT_LIST_HEAD(&sop->so_close_lru); /* not used */ |
2640 | sop->so_time = 0; | 2640 | sop->so_time = 0; |
2641 | list_add(&sop->so_idhash, &lock_ownerid_hashtbl[idhashval]); | 2641 | list_add(&sop->so_idhash, &lock_ownerid_hashtbl[idhashval]); |
2642 | list_add(&sop->so_strhash, &lock_ownerstr_hashtbl[strhashval]); | 2642 | list_add(&sop->so_strhash, &lock_ownerstr_hashtbl[strhashval]); |
2643 | list_add(&sop->so_perlockowner, &open_stp->st_perlockowner); | 2643 | list_add(&sop->so_perstateid, &open_stp->st_lockowners); |
2644 | sop->so_is_open_owner = 0; | 2644 | sop->so_is_open_owner = 0; |
2645 | sop->so_id = current_ownerid++; | 2645 | sop->so_id = current_ownerid++; |
2646 | sop->so_client = clp; | 2646 | sop->so_client = clp; |
@@ -2664,11 +2664,11 @@ alloc_init_lock_stateid(struct nfs4_stateowner *sop, struct nfs4_file *fp, struc | |||
2664 | goto out; | 2664 | goto out; |
2665 | INIT_LIST_HEAD(&stp->st_hash); | 2665 | INIT_LIST_HEAD(&stp->st_hash); |
2666 | INIT_LIST_HEAD(&stp->st_perfile); | 2666 | INIT_LIST_HEAD(&stp->st_perfile); |
2667 | INIT_LIST_HEAD(&stp->st_perfilestate); | 2667 | INIT_LIST_HEAD(&stp->st_perstateowner); |
2668 | INIT_LIST_HEAD(&stp->st_perlockowner); /* not used */ | 2668 | INIT_LIST_HEAD(&stp->st_lockowners); /* not used */ |
2669 | list_add(&stp->st_hash, &lockstateid_hashtbl[hashval]); | 2669 | list_add(&stp->st_hash, &lockstateid_hashtbl[hashval]); |
2670 | list_add(&stp->st_perfile, &fp->fi_stateids); | 2670 | list_add(&stp->st_perfile, &fp->fi_stateids); |
2671 | list_add(&stp->st_perfilestate, &sop->so_perfilestate); | 2671 | list_add(&stp->st_perstateowner, &sop->so_stateids); |
2672 | stp->st_stateowner = sop; | 2672 | stp->st_stateowner = sop; |
2673 | get_nfs4_file(fp); | 2673 | get_nfs4_file(fp); |
2674 | stp->st_file = fp; | 2674 | stp->st_file = fp; |
@@ -3081,8 +3081,8 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_release_lockowner * | |||
3081 | /* check for any locks held by any stateid | 3081 | /* check for any locks held by any stateid |
3082 | * associated with the (lock) stateowner */ | 3082 | * associated with the (lock) stateowner */ |
3083 | status = nfserr_locks_held; | 3083 | status = nfserr_locks_held; |
3084 | list_for_each_entry(stp, &local->so_perfilestate, | 3084 | list_for_each_entry(stp, &local->so_stateids, |
3085 | st_perfilestate) { | 3085 | st_perstateowner) { |
3086 | if (check_for_locks(stp->st_vfs_file, local)) | 3086 | if (check_for_locks(stp->st_vfs_file, local)) |
3087 | goto out; | 3087 | goto out; |
3088 | } | 3088 | } |