Commit e0a99358 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: nfsd4: postpone release of stateowner on CLOSE

Postpone the release of a stateowner on CLOSE for lease time to enable the
CLOSE replay cache.  Place stateowner on the close_lru list to be reaped by
the laundromat service.
Signed-off-by: default avatarAndy Adamson <andros@umich.edu>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e489bcf6
...@@ -908,7 +908,7 @@ release_stateid_lockowner(struct nfs4_stateid *open_stp) ...@@ -908,7 +908,7 @@ release_stateid_lockowner(struct nfs4_stateid *open_stp)
} }
static void static void
release_stateowner(struct nfs4_stateowner *sop) unhash_stateowner(struct nfs4_stateowner *sop)
{ {
struct nfs4_stateid *stp; struct nfs4_stateid *stp;
...@@ -916,7 +916,6 @@ release_stateowner(struct nfs4_stateowner *sop) ...@@ -916,7 +916,6 @@ release_stateowner(struct nfs4_stateowner *sop)
list_del(&sop->so_strhash); list_del(&sop->so_strhash);
list_del(&sop->so_perclient); list_del(&sop->so_perclient);
list_del(&sop->so_perlockowner); list_del(&sop->so_perlockowner);
list_del(&sop->so_close_lru);
del_perclient++; del_perclient++;
while (!list_empty(&sop->so_perfilestate)) { while (!list_empty(&sop->so_perfilestate)) {
stp = list_entry(sop->so_perfilestate.next, stp = list_entry(sop->so_perfilestate.next,
...@@ -926,6 +925,13 @@ release_stateowner(struct nfs4_stateowner *sop) ...@@ -926,6 +925,13 @@ release_stateowner(struct nfs4_stateowner *sop)
else else
release_stateid(stp, LOCK_STATE); release_stateid(stp, LOCK_STATE);
} }
}
static void
release_stateowner(struct nfs4_stateowner *sop)
{
unhash_stateowner(sop);
list_del(&sop->so_close_lru);
free_stateowner(sop); free_stateowner(sop);
} }
...@@ -986,11 +992,8 @@ void ...@@ -986,11 +992,8 @@ void
move_to_close_lru(struct nfs4_stateowner *sop) move_to_close_lru(struct nfs4_stateowner *sop)
{ {
dprintk("NFSD: move_to_close_lru nfs4_stateowner %p\n", sop); dprintk("NFSD: move_to_close_lru nfs4_stateowner %p\n", sop);
/* remove stateowner from all other hash lists except perclient */
list_del_init(&sop->so_idhash);
list_del_init(&sop->so_strhash);
list_del_init(&sop->so_perlockowner);
unhash_stateowner(sop);
list_add_tail(&sop->so_close_lru, &close_lru); list_add_tail(&sop->so_close_lru, &close_lru);
sop->so_time = get_seconds(); sop->so_time = get_seconds();
} }
...@@ -1456,7 +1459,8 @@ nfs4_laundromat(void) ...@@ -1456,7 +1459,8 @@ nfs4_laundromat(void)
} }
dprintk("NFSD: purging unused open stateowner (so_id %d)\n", dprintk("NFSD: purging unused open stateowner (so_id %d)\n",
sop->so_id); sop->so_id);
release_stateowner(sop); list_del(&sop->so_close_lru);
free_stateowner(sop);
} }
if (clientid_val < NFSD_LAUNDROMAT_MINTIMEOUT) if (clientid_val < NFSD_LAUNDROMAT_MINTIMEOUT)
clientid_val = NFSD_LAUNDROMAT_MINTIMEOUT; clientid_val = NFSD_LAUNDROMAT_MINTIMEOUT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment