diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2006-01-18 20:43:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-18 22:20:25 -0500 |
commit | 04ef59548470b81829e8593c1b39776ce0534d68 (patch) | |
tree | 846dbe3d17ac1a745c2f23642129b15c3c150d19 /fs | |
parent | 3a65588adc4401622b204caa897123e16a4a0318 (diff) |
[PATCH] nfsd4: remove release_state_owner()
It's confusing having both release_stateowner() and release_state_owner().
And as it turns out, release_state_owner() is short and only called from one
place; so just remove it.
Also note the confirmed check is superfluous there--preprocess_seqid_op
already check this.
And remove a redundant comment and a superfluous line assignment while we're
at it.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
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 | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 578ea521c827..3510e2ca40d2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1178,7 +1178,6 @@ release_stateid(struct nfs4_stateid *stp, int flags) | |||
1178 | locks_remove_posix(filp, (fl_owner_t) stp->st_stateowner); | 1178 | locks_remove_posix(filp, (fl_owner_t) stp->st_stateowner); |
1179 | put_nfs4_file(stp->st_file); | 1179 | put_nfs4_file(stp->st_file); |
1180 | kmem_cache_free(stateid_slab, stp); | 1180 | kmem_cache_free(stateid_slab, stp); |
1181 | stp = NULL; | ||
1182 | } | 1181 | } |
1183 | 1182 | ||
1184 | static void | 1183 | static void |
@@ -1191,22 +1190,6 @@ move_to_close_lru(struct nfs4_stateowner *sop) | |||
1191 | sop->so_time = get_seconds(); | 1190 | sop->so_time = get_seconds(); |
1192 | } | 1191 | } |
1193 | 1192 | ||
1194 | static void | ||
1195 | release_state_owner(struct nfs4_stateid *stp, int flag) | ||
1196 | { | ||
1197 | struct nfs4_stateowner *sop = stp->st_stateowner; | ||
1198 | |||
1199 | dprintk("NFSD: release_state_owner\n"); | ||
1200 | release_stateid(stp, flag); | ||
1201 | |||
1202 | /* place unused nfs4_stateowners on so_close_lru list to be | ||
1203 | * released by the laundromat service after the lease period | ||
1204 | * to enable us to handle CLOSE replay | ||
1205 | */ | ||
1206 | if (sop->so_confirmed && list_empty(&sop->so_stateids)) | ||
1207 | move_to_close_lru(sop); | ||
1208 | } | ||
1209 | |||
1210 | static int | 1193 | static int |
1211 | cmp_owner_str(struct nfs4_stateowner *sop, struct xdr_netobj *owner, clientid_t *clid) { | 1194 | cmp_owner_str(struct nfs4_stateowner *sop, struct xdr_netobj *owner, clientid_t *clid) { |
1212 | return ((sop->so_owner.len == owner->len) && | 1195 | return ((sop->so_owner.len == owner->len) && |
@@ -2423,15 +2406,19 @@ nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_clos | |||
2423 | CHECK_FH | OPEN_STATE | CLOSE_STATE, | 2406 | CHECK_FH | OPEN_STATE | CLOSE_STATE, |
2424 | &close->cl_stateowner, &stp, NULL))) | 2407 | &close->cl_stateowner, &stp, NULL))) |
2425 | goto out; | 2408 | goto out; |
2426 | /* | ||
2427 | * Return success, but first update the stateid. | ||
2428 | */ | ||
2429 | status = nfs_ok; | 2409 | status = nfs_ok; |
2430 | update_stateid(&stp->st_stateid); | 2410 | update_stateid(&stp->st_stateid); |
2431 | memcpy(&close->cl_stateid, &stp->st_stateid, sizeof(stateid_t)); | 2411 | memcpy(&close->cl_stateid, &stp->st_stateid, sizeof(stateid_t)); |
2432 | 2412 | ||
2433 | /* release_state_owner() calls nfsd_close() if needed */ | 2413 | /* release_stateid() calls nfsd_close() if needed */ |
2434 | release_state_owner(stp, OPEN_STATE); | 2414 | release_stateid(stp, OPEN_STATE); |
2415 | |||
2416 | /* place unused nfs4_stateowners on so_close_lru list to be | ||
2417 | * released by the laundromat service after the lease period | ||
2418 | * to enable us to handle CLOSE replay | ||
2419 | */ | ||
2420 | if (list_empty(&close->cl_stateowner->so_stateids)) | ||
2421 | move_to_close_lru(close->cl_stateowner); | ||
2435 | out: | 2422 | out: |
2436 | if (close->cl_stateowner) { | 2423 | if (close->cl_stateowner) { |
2437 | nfs4_get_stateowner(close->cl_stateowner); | 2424 | nfs4_get_stateowner(close->cl_stateowner); |