aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-06-25 16:01:31 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:04 -0400
commit1b1e2135dc1e4efbcf25ac9ac9979316d4e1193e (patch)
tree2af53ed5d4c368bbefd9de94f0adc2902a785468 /fs/btrfs/ordered-data.c
parent079899c2384023cd8efcd3806680b4f1d2abbd54 (diff)
Btrfs: Add a per-inode csum mutex to avoid races creating csum items
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 5e4c0d95ce43..254da8225664 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -152,12 +152,13 @@ int btrfs_add_ordered_inode(struct inode *inode)
152 inode->i_ino, &entry->rb_node); 152 inode->i_ino, &entry->rb_node);
153 153
154 BTRFS_I(inode)->ordered_trans = transid; 154 BTRFS_I(inode)->ordered_trans = transid;
155 if (!node)
156 igrab(inode);
155 157
156 write_unlock(&tree->lock); 158 write_unlock(&tree->lock);
159
157 if (node) 160 if (node)
158 kfree(entry); 161 kfree(entry);
159 else
160 igrab(inode);
161 return 0; 162 return 0;
162} 163}
163 164