Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372184
b: refs/heads/master
c: 68a3396
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Apr 4, 2013
1 parent 2c44492 commit c5d9a3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8be2d2344cc192c20d7b2aa3211a5b74082e47d4
refs/heads/master: 68a3396178e6688ad7367202cdf0af8ed03c8727
13 changes: 7 additions & 6 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,21 +417,18 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_ol_stateid *stp, struct sv
return dp;
}

static void free_stid(struct nfs4_stid *s, struct kmem_cache *slab)
static void remove_stid(struct nfs4_stid *s)
{
struct idr *stateids = &s->sc_client->cl_stateids;

idr_remove(stateids, s->sc_stateid.si_opaque.so_id);
kmem_cache_free(slab, s);
}

void
nfs4_put_delegation(struct nfs4_delegation *dp)
{
if (atomic_dec_and_test(&dp->dl_count)) {
dprintk("NFSD: freeing dp %p\n",dp);
put_nfs4_file(dp->dl_file);
free_stid(&dp->dl_stid, deleg_slab);
kmem_cache_free(deleg_slab, dp);
num_delegations--;
}
}
Expand Down Expand Up @@ -462,6 +459,9 @@ unhash_delegation(struct nfs4_delegation *dp)
list_del_init(&dp->dl_recall_lru);
spin_unlock(&recall_lock);
nfs4_put_deleg_lease(dp->dl_file);
put_nfs4_file(dp->dl_file);
dp->dl_file = NULL;
remove_stid(&dp->dl_stid);
nfs4_put_delegation(dp);
}

Expand Down Expand Up @@ -605,7 +605,8 @@ static void close_generic_stateid(struct nfs4_ol_stateid *stp)

static void free_generic_stateid(struct nfs4_ol_stateid *stp)
{
free_stid(&stp->st_stid, stateid_slab);
remove_stid(&stp->st_stid);
kmem_cache_free(stateid_slab, stp);
}

static void release_lock_stateid(struct nfs4_ol_stateid *stp)
Expand Down

0 comments on commit c5d9a3f

Please sign in to comment.