aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4state.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-12-05 10:48:41 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-12-05 10:48:41 -0500
commit292d4ed32e35df4755052b5002e533348d1648fd (patch)
tree8522e6bab962696bd25a6c02fb068c674a09b7ee /fs/nfs/nfs4state.c
parent3c6af7fa787f21f8873a050568ed892312899eb5 (diff)
parente4f5c82a92c2a546a16af1614114eec19120e40a (diff)
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r--fs/nfs/nfs4state.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 0675f3215e0a..5ef4c57618fe 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -644,12 +644,15 @@ void nfs4_copy_stateid(nfs4_stateid *dst, struct nfs4_state *state, fl_owner_t f
644 644
645struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter) 645struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter)
646{ 646{
647 struct rpc_sequence *sequence = counter->sequence;
647 struct nfs_seqid *new; 648 struct nfs_seqid *new;
648 649
649 new = kmalloc(sizeof(*new), GFP_KERNEL); 650 new = kmalloc(sizeof(*new), GFP_KERNEL);
650 if (new != NULL) { 651 if (new != NULL) {
651 new->sequence = counter; 652 new->sequence = counter;
652 INIT_LIST_HEAD(&new->list); 653 spin_lock(&sequence->lock);
654 list_add_tail(&new->list, &sequence->list);
655 spin_unlock(&sequence->lock);
653 } 656 }
654 return new; 657 return new;
655} 658}
@@ -658,12 +661,10 @@ void nfs_free_seqid(struct nfs_seqid *seqid)
658{ 661{
659 struct rpc_sequence *sequence = seqid->sequence->sequence; 662 struct rpc_sequence *sequence = seqid->sequence->sequence;
660 663
661 if (!list_empty(&seqid->list)) { 664 spin_lock(&sequence->lock);
662 spin_lock(&sequence->lock); 665 list_del(&seqid->list);
663 list_del(&seqid->list); 666 spin_unlock(&sequence->lock);
664 spin_unlock(&sequence->lock); 667 rpc_wake_up(&sequence->wait);
665 }
666 rpc_wake_up_next(&sequence->wait);
667 kfree(seqid); 668 kfree(seqid);
668} 669}
669 670
@@ -722,11 +723,10 @@ int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task)
722 if (sequence->list.next == &seqid->list) 723 if (sequence->list.next == &seqid->list)
723 goto out; 724 goto out;
724 spin_lock(&sequence->lock); 725 spin_lock(&sequence->lock);
725 if (!list_empty(&sequence->list)) { 726 if (sequence->list.next != &seqid->list) {
726 rpc_sleep_on(&sequence->wait, task, NULL, NULL); 727 rpc_sleep_on(&sequence->wait, task, NULL, NULL);
727 status = -EAGAIN; 728 status = -EAGAIN;
728 } else 729 }
729 list_add(&seqid->list, &sequence->list);
730 spin_unlock(&sequence->lock); 730 spin_unlock(&sequence->lock);
731out: 731out:
732 return status; 732 return status;