Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142138
b: refs/heads/master
c: f1d110c
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Mar 18, 2009
1 parent ecc4532 commit 495f6bf
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 44 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: 2283963f27fdd56b185e49a964c290130c7c95ab
refs/heads/master: f1d110caf7d759eae2c02c84343f63d83db9b9be
85 changes: 42 additions & 43 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ static stateid_t onestateid; /* bits all 1 */
/* forward declarations */
static struct nfs4_stateid * find_stateid(stateid_t *stid, int flags);
static struct nfs4_delegation * find_delegation_stateid(struct inode *ino, stateid_t *stid);
static void release_stateid_lockowners(struct nfs4_stateid *open_stp);
static char user_recovery_dirname[PATH_MAX] = "/var/lib/nfs/v4recovery";
static void nfs4_set_recdir(char *recdir);

Expand Down Expand Up @@ -330,6 +329,20 @@ static void release_lock_stateid(struct nfs4_stateid *stp)
free_generic_stateid(stp);
}

static void
release_stateid_lockowners(struct nfs4_stateid *open_stp)
{
struct nfs4_stateowner *lock_sop;

while (!list_empty(&open_stp->st_lockowners)) {
lock_sop = list_entry(open_stp->st_lockowners.next,
struct nfs4_stateowner, so_perstateid);
/* list_del(&open_stp->st_lockowners); */
BUG_ON(lock_sop->so_is_open_owner);
release_stateowner(lock_sop);
}
}

static void release_open_stateid(struct nfs4_stateid *stp)
{
unhash_generic_stateid(stp);
Expand All @@ -338,6 +351,34 @@ static void release_open_stateid(struct nfs4_stateid *stp)
free_generic_stateid(stp);
}

static void
unhash_stateowner(struct nfs4_stateowner *sop)
{
struct nfs4_stateid *stp;

list_del(&sop->so_idhash);
list_del(&sop->so_strhash);
if (sop->so_is_open_owner)
list_del(&sop->so_perclient);
list_del(&sop->so_perstateid);
while (!list_empty(&sop->so_stateids)) {
stp = list_entry(sop->so_stateids.next,
struct nfs4_stateid, st_perstateowner);
if (sop->so_is_open_owner)
release_open_stateid(stp);
else
release_lock_stateid(stp);
}
}

static void
release_stateowner(struct nfs4_stateowner *sop)
{
unhash_stateowner(sop);
list_del(&sop->so_close_lru);
nfs4_put_stateowner(sop);
}

static inline void
renew_client(struct nfs4_client *clp)
{
Expand Down Expand Up @@ -1064,48 +1105,6 @@ alloc_init_open_stateowner(unsigned int strhashval, struct nfs4_client *clp, str
return sop;
}

static void
release_stateid_lockowners(struct nfs4_stateid *open_stp)
{
struct nfs4_stateowner *lock_sop;

while (!list_empty(&open_stp->st_lockowners)) {
lock_sop = list_entry(open_stp->st_lockowners.next,
struct nfs4_stateowner, so_perstateid);
/* list_del(&open_stp->st_lockowners); */
BUG_ON(lock_sop->so_is_open_owner);
release_stateowner(lock_sop);
}
}

static void
unhash_stateowner(struct nfs4_stateowner *sop)
{
struct nfs4_stateid *stp;

list_del(&sop->so_idhash);
list_del(&sop->so_strhash);
if (sop->so_is_open_owner)
list_del(&sop->so_perclient);
list_del(&sop->so_perstateid);
while (!list_empty(&sop->so_stateids)) {
stp = list_entry(sop->so_stateids.next,
struct nfs4_stateid, st_perstateowner);
if (sop->so_is_open_owner)
release_open_stateid(stp);
else
release_lock_stateid(stp);
}
}

static void
release_stateowner(struct nfs4_stateowner *sop)
{
unhash_stateowner(sop);
list_del(&sop->so_close_lru);
nfs4_put_stateowner(sop);
}

static inline void
init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) {
struct nfs4_stateowner *sop = open->op_stateowner;
Expand Down

0 comments on commit 495f6bf

Please sign in to comment.