aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-01-13 12:09:22 -0500
committerChris Mason <chris.mason@oracle.com>2012-01-16 15:29:43 -0500
commitf248679e86fead40cc78e724c7181d6bec1a2046 (patch)
tree88abeee0b2a87c0f0377509525c92d3c9ec15a15 /fs/btrfs/ioctl.c
parent8c2a3ca20f6233677ac3222c6506174010eb414f (diff)
Btrfs: add a delalloc mutex to inodes for delalloc reservations
I was using i_mutex for this, but we're getting bogus lockdep warnings by doing that and theres no real way to get rid of those, so just stop using i_mutex to protect delalloc metadata reservations and use a delalloc mutex instead. This shouldn't be contended often at all, only if you are writing and mmap writing to the file at the same time. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7fdf22c2dc0d..6834be4c8709 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -868,10 +868,8 @@ static int cluster_pages_for_defrag(struct inode *inode,
868 return 0; 868 return 0;
869 file_end = (isize - 1) >> PAGE_CACHE_SHIFT; 869 file_end = (isize - 1) >> PAGE_CACHE_SHIFT;
870 870
871 mutex_lock(&inode->i_mutex);
872 ret = btrfs_delalloc_reserve_space(inode, 871 ret = btrfs_delalloc_reserve_space(inode,
873 num_pages << PAGE_CACHE_SHIFT); 872 num_pages << PAGE_CACHE_SHIFT);
874 mutex_unlock(&inode->i_mutex);
875 if (ret) 873 if (ret)
876 return ret; 874 return ret;
877again: 875again: