Skip to content

Commit

Permalink
nfsd4: split out some free_generic_stateid code
Browse files Browse the repository at this point in the history
We'll use this elsewhere.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Sep 7, 2011
1 parent fe0750e commit 4665e2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ static void unhash_generic_stateid(struct nfs4_stateid *stp)
list_del(&stp->st_perstateowner);
}

static void free_generic_stateid(struct nfs4_stateid *stp)
static void close_generic_stateid(struct nfs4_stateid *stp)
{
int i;

Expand All @@ -420,9 +420,16 @@ static void free_generic_stateid(struct nfs4_stateid *stp)
if (test_bit(i, &stp->st_access_bmap))
nfs4_file_put_access(stp->st_file,
nfs4_access_to_omode(i));
__clear_bit(i, &stp->st_access_bmap);
}
}
put_nfs4_file(stp->st_file);
stp->st_file = NULL;
}

static void free_generic_stateid(struct nfs4_stateid *stp)
{
close_generic_stateid(stp);
kmem_cache_free(stateid_slab, stp);
}

Expand Down

0 comments on commit 4665e2b

Please sign in to comment.