Skip to content

Commit

Permalink
Btrfs: remove redundant r/o check for superblock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liu Bo authored and Chris Mason committed Jul 23, 2012
1 parent a874a63 commit 768e9df
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 768e9df

Please sign in to comment.