Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14697
b: refs/heads/master
c: 36f20c6
h: refs/heads/master
i:
  14695: 2c433c8
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Nov 25, 2005
1 parent 437b782 commit da4a0a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: af95598744a83506063b411d81c4f819bf774f62
refs/heads/master: 36f20c6df75d599393d79c7feb6283b20913e3d5
20 changes: 10 additions & 10 deletions trunk/fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,15 @@ void nfs4_copy_stateid(nfs4_stateid *dst, struct nfs4_state *state, fl_owner_t f

struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter)
{
struct rpc_sequence *sequence = counter->sequence;
struct nfs_seqid *new;

new = kmalloc(sizeof(*new), GFP_KERNEL);
if (new != NULL) {
new->sequence = counter;
INIT_LIST_HEAD(&new->list);
spin_lock(&sequence->lock);
list_add_tail(&new->list, &sequence->list);
spin_unlock(&sequence->lock);
}
return new;
}
Expand All @@ -658,12 +661,10 @@ void nfs_free_seqid(struct nfs_seqid *seqid)
{
struct rpc_sequence *sequence = seqid->sequence->sequence;

if (!list_empty(&seqid->list)) {
spin_lock(&sequence->lock);
list_del(&seqid->list);
spin_unlock(&sequence->lock);
}
rpc_wake_up_next(&sequence->wait);
spin_lock(&sequence->lock);
list_del(&seqid->list);
spin_unlock(&sequence->lock);
rpc_wake_up(&sequence->wait);
kfree(seqid);
}

Expand Down Expand Up @@ -722,11 +723,10 @@ int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task)
if (sequence->list.next == &seqid->list)
goto out;
spin_lock(&sequence->lock);
if (!list_empty(&sequence->list)) {
if (sequence->list.next != &seqid->list) {
rpc_sleep_on(&sequence->wait, task, NULL, NULL);
status = -EAGAIN;
} else
list_add(&seqid->list, &sequence->list);
}
spin_unlock(&sequence->lock);
out:
return status;
Expand Down

0 comments on commit da4a0a3

Please sign in to comment.