Skip to content

Commit

Permalink
Btrfs: use mnt_want_write_file instead of mnt_want_write
Browse files Browse the repository at this point in the history
mnt_want_write_file is faster when file has been opened for write.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
  • Loading branch information
Liu Bo authored and Chris Mason committed Jul 23, 2012
1 parent 768e9df commit e54bfa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3265,7 +3265,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;

ret = mnt_want_write(file->f_path.mnt);
ret = mnt_want_write_file(file);
if (ret)
return ret;

Expand Down Expand Up @@ -3335,7 +3335,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg)
out:
mutex_unlock(&fs_info->balance_mutex);
mutex_unlock(&fs_info->volume_mutex);
mnt_drop_write(file->f_path.mnt);
mnt_drop_write_file(file);
return ret;
}

Expand Down

0 comments on commit e54bfa3

Please sign in to comment.