git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
fs
/
nfs
/
nfs4state.c
diff --git
a/fs/nfs/nfs4state.c
b/fs/nfs/nfs4state.c
index
91e9bd7
..
67b0f48
100644
(file)
--- a/
fs/nfs/nfs4state.c
+++ b/
fs/nfs/nfs4state.c
@@
-51,7
+51,7
@@
#define OPENOWNER_POOL_SIZE 8
#define OPENOWNER_POOL_SIZE 8
-static
spinlock_t state_spinlock = SPIN_LOCK_UNLOCKED
;
+static
DEFINE_SPINLOCK(state_spinlock)
;
nfs4_stateid zero_stateid;
nfs4_stateid zero_stateid;
@@
-445,7
+445,7
@@
nfs4_get_open_state(struct inode *inode, struct nfs4_state_owner *owner)
state->owner = owner;
atomic_inc(&owner->so_count);
list_add(&state->inode_states, &nfsi->open_states);
state->owner = owner;
atomic_inc(&owner->so_count);
list_add(&state->inode_states, &nfsi->open_states);
- state->inode = i
node
;
+ state->inode = i
grab(inode)
;
spin_unlock(&inode->i_lock);
} else {
spin_unlock(&inode->i_lock);
spin_unlock(&inode->i_lock);
} else {
spin_unlock(&inode->i_lock);
@@
-471,6
+471,7
@@
void nfs4_put_open_state(struct nfs4_state *state)
list_del(&state->inode_states);
spin_unlock(&inode->i_lock);
list_del(&state->open_states);
list_del(&state->inode_states);
spin_unlock(&inode->i_lock);
list_del(&state->open_states);
+ iput(inode);
BUG_ON (state->state != 0);
nfs4_free_open_state(state);
nfs4_put_state_owner(owner);
BUG_ON (state->state != 0);
nfs4_free_open_state(state);
nfs4_put_state_owner(owner);
@@
-486,7
+487,6
@@
void nfs4_close_state(struct nfs4_state *state, mode_t mode)
struct nfs4_state_owner *owner = state->owner;
struct nfs4_client *clp = owner->so_client;
int newstate;
struct nfs4_state_owner *owner = state->owner;
struct nfs4_client *clp = owner->so_client;
int newstate;
- int status = 0;
atomic_inc(&owner->so_count);
down_read(&clp->cl_sem);
atomic_inc(&owner->so_count);
down_read(&clp->cl_sem);
@@
-508,10
+508,8
@@
void nfs4_close_state(struct nfs4_state *state, mode_t mode)
newstate |= FMODE_WRITE;
if (state->state == newstate)
goto out;
newstate |= FMODE_WRITE;
if (state->state == newstate)
goto out;
- if (newstate != 0)
- status = nfs4_do_downgrade(inode, state, newstate);
- else
- status = nfs4_do_close(inode, state);
+ if (nfs4_do_close(inode, state, newstate) == -EINPROGRESS)
+ return;
}
out:
nfs4_put_open_state(state);
}
out:
nfs4_put_open_state(state);