Commit 3c8d8b63 authored by Anand Jain's avatar Anand Jain Committed by David Sterba

btrfs: drop old_fsflags in btrfs_ioctl_setflags

btrfs_inode_flags_to_fsflags() is copied into @old_fsflags and used only
once. Instead used it directly.
Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent d2b8fcfe
...@@ -187,7 +187,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) ...@@ -187,7 +187,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
struct btrfs_inode *binode = BTRFS_I(inode); struct btrfs_inode *binode = BTRFS_I(inode);
struct btrfs_root *root = binode->root; struct btrfs_root *root = binode->root;
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
unsigned int fsflags, old_fsflags; unsigned int fsflags;
int ret; int ret;
umode_t mode; umode_t mode;
const char *comp = NULL; const char *comp = NULL;
...@@ -215,8 +215,8 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) ...@@ -215,8 +215,8 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
mode = inode->i_mode; mode = inode->i_mode;
fsflags = btrfs_mask_fsflags_for_type(inode, fsflags); fsflags = btrfs_mask_fsflags_for_type(inode, fsflags);
old_fsflags = btrfs_inode_flags_to_fsflags(binode->flags); if ((fsflags ^ btrfs_inode_flags_to_fsflags(binode->flags)) &
if ((fsflags ^ old_fsflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) { (FS_APPEND_FL | FS_IMMUTABLE_FL)) {
if (!capable(CAP_LINUX_IMMUTABLE)) { if (!capable(CAP_LINUX_IMMUTABLE)) {
ret = -EPERM; ret = -EPERM;
goto out_unlock; goto out_unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment