diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-17 20:54:40 +0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 19:04:04 +0400 |
commit | ee6e6504e147a59a9f4d582662c105e9d72ae638 (patch) | |
tree | be932cc04abb860ed76ab8d4c4c28353ed50bebb /fs/btrfs/btrfs_inode.h | |
parent | ba1da2f442ec91a1534afa893f9bef7e33056ace (diff) | |
download | linux-ee6e6504e147a59a9f4d582662c105e9d72ae638.tar.xz |
Add a per-inode lock around btrfs_drop_extents
btrfs_drop_extents is always called with a range lock held on the inode.
But, it may operate on extents outside that range as it drops and splits
them.
This patch adds a per-inode mutex that is held while calling
btrfs_drop_extents and while inserting new extents into the tree. It
prevents races from two procs working against adjacent ranges in the tree.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 81c0444f37b6..3bf40591742a 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -32,6 +32,7 @@ struct btrfs_inode { struct extent_io_tree io_tree; struct extent_io_tree io_failure_tree; struct mutex csum_mutex; + struct mutex extent_mutex; struct inode vfs_inode; struct btrfs_ordered_inode_tree ordered_tree; |