diff options
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9028737ee9b5..952172ca7e45 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -240,7 +240,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | |||
240 | if (ret) | 240 | if (ret) |
241 | return ret; | 241 | return ret; |
242 | 242 | ||
243 | mutex_lock(&inode->i_mutex); | 243 | inode_lock(inode); |
244 | 244 | ||
245 | ip_oldflags = ip->flags; | 245 | ip_oldflags = ip->flags; |
246 | i_oldflags = inode->i_flags; | 246 | i_oldflags = inode->i_flags; |
@@ -358,7 +358,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | |||
358 | } | 358 | } |
359 | 359 | ||
360 | out_unlock: | 360 | out_unlock: |
361 | mutex_unlock(&inode->i_mutex); | 361 | inode_unlock(inode); |
362 | mnt_drop_write_file(file); | 362 | mnt_drop_write_file(file); |
363 | return ret; | 363 | return ret; |
364 | } | 364 | } |
@@ -881,7 +881,7 @@ out_up_read: | |||
881 | out_dput: | 881 | out_dput: |
882 | dput(dentry); | 882 | dput(dentry); |
883 | out_unlock: | 883 | out_unlock: |
884 | mutex_unlock(&dir->i_mutex); | 884 | inode_unlock(dir); |
885 | return error; | 885 | return error; |
886 | } | 886 | } |
887 | 887 | ||
@@ -1393,18 +1393,18 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, | |||
1393 | ra_index += cluster; | 1393 | ra_index += cluster; |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | mutex_lock(&inode->i_mutex); | 1396 | inode_lock(inode); |
1397 | if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) | 1397 | if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) |
1398 | BTRFS_I(inode)->force_compress = compress_type; | 1398 | BTRFS_I(inode)->force_compress = compress_type; |
1399 | ret = cluster_pages_for_defrag(inode, pages, i, cluster); | 1399 | ret = cluster_pages_for_defrag(inode, pages, i, cluster); |
1400 | if (ret < 0) { | 1400 | if (ret < 0) { |
1401 | mutex_unlock(&inode->i_mutex); | 1401 | inode_unlock(inode); |
1402 | goto out_ra; | 1402 | goto out_ra; |
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | defrag_count += ret; | 1405 | defrag_count += ret; |
1406 | balance_dirty_pages_ratelimited(inode->i_mapping); | 1406 | balance_dirty_pages_ratelimited(inode->i_mapping); |
1407 | mutex_unlock(&inode->i_mutex); | 1407 | inode_unlock(inode); |
1408 | 1408 | ||
1409 | if (newer_than) { | 1409 | if (newer_than) { |
1410 | if (newer_off == (u64)-1) | 1410 | if (newer_off == (u64)-1) |
@@ -1465,9 +1465,9 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, | |||
1465 | 1465 | ||
1466 | out_ra: | 1466 | out_ra: |
1467 | if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) { | 1467 | if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) { |
1468 | mutex_lock(&inode->i_mutex); | 1468 | inode_lock(inode); |
1469 | BTRFS_I(inode)->force_compress = BTRFS_COMPRESS_NONE; | 1469 | BTRFS_I(inode)->force_compress = BTRFS_COMPRESS_NONE; |
1470 | mutex_unlock(&inode->i_mutex); | 1470 | inode_unlock(inode); |
1471 | } | 1471 | } |
1472 | if (!file) | 1472 | if (!file) |
1473 | kfree(ra); | 1473 | kfree(ra); |
@@ -2430,7 +2430,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file, | |||
2430 | goto out_dput; | 2430 | goto out_dput; |
2431 | } | 2431 | } |
2432 | 2432 | ||
2433 | mutex_lock(&inode->i_mutex); | 2433 | inode_lock(inode); |
2434 | 2434 | ||
2435 | /* | 2435 | /* |
2436 | * Don't allow to delete a subvolume with send in progress. This is | 2436 | * Don't allow to delete a subvolume with send in progress. This is |
@@ -2543,7 +2543,7 @@ out_up_write: | |||
2543 | spin_unlock(&dest->root_item_lock); | 2543 | spin_unlock(&dest->root_item_lock); |
2544 | } | 2544 | } |
2545 | out_unlock_inode: | 2545 | out_unlock_inode: |
2546 | mutex_unlock(&inode->i_mutex); | 2546 | inode_unlock(inode); |
2547 | if (!err) { | 2547 | if (!err) { |
2548 | d_invalidate(dentry); | 2548 | d_invalidate(dentry); |
2549 | btrfs_invalidate_inodes(dest); | 2549 | btrfs_invalidate_inodes(dest); |
@@ -2559,7 +2559,7 @@ out_unlock_inode: | |||
2559 | out_dput: | 2559 | out_dput: |
2560 | dput(dentry); | 2560 | dput(dentry); |
2561 | out_unlock_dir: | 2561 | out_unlock_dir: |
2562 | mutex_unlock(&dir->i_mutex); | 2562 | inode_unlock(dir); |
2563 | out_drop_write: | 2563 | out_drop_write: |
2564 | mnt_drop_write_file(file); | 2564 | mnt_drop_write_file(file); |
2565 | out: | 2565 | out: |
@@ -2857,8 +2857,8 @@ static inline void lock_extent_range(struct inode *inode, u64 off, u64 len) | |||
2857 | 2857 | ||
2858 | static void btrfs_double_inode_unlock(struct inode *inode1, struct inode *inode2) | 2858 | static void btrfs_double_inode_unlock(struct inode *inode1, struct inode *inode2) |
2859 | { | 2859 | { |
2860 | mutex_unlock(&inode1->i_mutex); | 2860 | inode_unlock(inode1); |
2861 | mutex_unlock(&inode2->i_mutex); | 2861 | inode_unlock(inode2); |
2862 | } | 2862 | } |
2863 | 2863 | ||
2864 | static void btrfs_double_inode_lock(struct inode *inode1, struct inode *inode2) | 2864 | static void btrfs_double_inode_lock(struct inode *inode1, struct inode *inode2) |
@@ -2866,8 +2866,8 @@ static void btrfs_double_inode_lock(struct inode *inode1, struct inode *inode2) | |||
2866 | if (inode1 < inode2) | 2866 | if (inode1 < inode2) |
2867 | swap(inode1, inode2); | 2867 | swap(inode1, inode2); |
2868 | 2868 | ||
2869 | mutex_lock_nested(&inode1->i_mutex, I_MUTEX_PARENT); | 2869 | inode_lock_nested(inode1, I_MUTEX_PARENT); |
2870 | mutex_lock_nested(&inode2->i_mutex, I_MUTEX_CHILD); | 2870 | inode_lock_nested(inode2, I_MUTEX_CHILD); |
2871 | } | 2871 | } |
2872 | 2872 | ||
2873 | static void btrfs_double_extent_unlock(struct inode *inode1, u64 loff1, | 2873 | static void btrfs_double_extent_unlock(struct inode *inode1, u64 loff1, |
@@ -3026,7 +3026,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, | |||
3026 | return 0; | 3026 | return 0; |
3027 | 3027 | ||
3028 | if (same_inode) { | 3028 | if (same_inode) { |
3029 | mutex_lock(&src->i_mutex); | 3029 | inode_lock(src); |
3030 | 3030 | ||
3031 | ret = extent_same_check_offsets(src, loff, &len, olen); | 3031 | ret = extent_same_check_offsets(src, loff, &len, olen); |
3032 | if (ret) | 3032 | if (ret) |
@@ -3101,7 +3101,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, | |||
3101 | btrfs_cmp_data_free(&cmp); | 3101 | btrfs_cmp_data_free(&cmp); |
3102 | out_unlock: | 3102 | out_unlock: |
3103 | if (same_inode) | 3103 | if (same_inode) |
3104 | mutex_unlock(&src->i_mutex); | 3104 | inode_unlock(src); |
3105 | else | 3105 | else |
3106 | btrfs_double_inode_unlock(src, dst); | 3106 | btrfs_double_inode_unlock(src, dst); |
3107 | 3107 | ||
@@ -3749,7 +3749,7 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src, | |||
3749 | if (!same_inode) { | 3749 | if (!same_inode) { |
3750 | btrfs_double_inode_lock(src, inode); | 3750 | btrfs_double_inode_lock(src, inode); |
3751 | } else { | 3751 | } else { |
3752 | mutex_lock(&src->i_mutex); | 3752 | inode_lock(src); |
3753 | } | 3753 | } |
3754 | 3754 | ||
3755 | /* determine range to clone */ | 3755 | /* determine range to clone */ |
@@ -3820,7 +3820,7 @@ out_unlock: | |||
3820 | if (!same_inode) | 3820 | if (!same_inode) |
3821 | btrfs_double_inode_unlock(src, inode); | 3821 | btrfs_double_inode_unlock(src, inode); |
3822 | else | 3822 | else |
3823 | mutex_unlock(&src->i_mutex); | 3823 | inode_unlock(src); |
3824 | return ret; | 3824 | return ret; |
3825 | } | 3825 | } |
3826 | 3826 | ||