diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-06-25 16:01:31 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:04 -0400 |
commit | 1b1e2135dc1e4efbcf25ac9ac9979316d4e1193e (patch) | |
tree | 2af53ed5d4c368bbefd9de94f0adc2902a785468 /fs/btrfs/file.c | |
parent | 079899c2384023cd8efcd3806680b4f1d2abbd54 (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/file.c')
-rw-r--r-- | fs/btrfs/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index ece221cba90c..8037792f8789 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -267,13 +267,13 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans, | |||
267 | 267 | ||
268 | /* FIXME...EIEIO, ENOSPC and more */ | 268 | /* FIXME...EIEIO, ENOSPC and more */ |
269 | /* insert any holes we need to create */ | 269 | /* insert any holes we need to create */ |
270 | if (isize < end_pos) { | 270 | if (isize < start_pos) { |
271 | u64 last_pos_in_file; | 271 | u64 last_pos_in_file; |
272 | u64 hole_size; | 272 | u64 hole_size; |
273 | u64 mask = root->sectorsize - 1; | 273 | u64 mask = root->sectorsize - 1; |
274 | last_pos_in_file = (isize + mask) & ~mask; | 274 | last_pos_in_file = (isize + mask) & ~mask; |
275 | hole_size = (end_pos - last_pos_in_file + mask) & ~mask; | 275 | hole_size = (start_pos - last_pos_in_file + mask) & ~mask; |
276 | if (last_pos_in_file < end_pos) { | 276 | if (last_pos_in_file < start_pos) { |
277 | err = btrfs_drop_extents(trans, root, inode, | 277 | err = btrfs_drop_extents(trans, root, inode, |
278 | last_pos_in_file, | 278 | last_pos_in_file, |
279 | last_pos_in_file + hole_size, | 279 | last_pos_in_file + hole_size, |