diff options
author | Liu Bo <liubo2009@cn.fujitsu.com> | 2012-06-29 11:58:47 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-07-23 22:27:56 +0200 |
commit | 768e9dfe820abdcfb6683e05c60b8634f1a4ffce (patch) | |
tree | 193f5ea645f4f96a85d3ac877abf8e9d6eb1b390 | |
parent | Btrfs: check write access to mount earlier while creating snapshots (diff) | |
download | linux-768e9dfe820abdcfb6683e05c60b8634f1a4ffce.tar.xz linux-768e9dfe820abdcfb6683e05c60b8634f1a4ffce.zip |
Btrfs: remove redundant r/o check for superblock
mnt_want_write() and mnt_want_write_file() will check sb->s_flags with
MS_RDONLY, and we don't need to do it ourselves.
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
-rw-r--r-- | fs/btrfs/ioctl.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index c1f4975648ef..b8034dc62e38 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1381,14 +1381,10 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file, u64 *transid, bool readonly) { - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; struct file *src_file; int namelen; int ret = 0; - if (root->fs_info->sb->s_flags & MS_RDONLY) - return -EROFS; - ret = mnt_want_write_file(file); if (ret) goto out; @@ -3269,9 +3265,6 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - if (fs_info->sb->s_flags & MS_RDONLY) - return -EROFS; - ret = mnt_want_write(file->f_path.mnt); if (ret) return ret; |