diff options
author | David Sterba <dsterba@suse.com> | 2018-03-26 18:52:15 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 18:23:24 +0200 |
commit | 1905a0f7c7de3cec4a61b9f0053da8cd07b512bf (patch) | |
tree | e86710af3f1231e76d60bbe79fabd8ad4810928b /fs/btrfs | |
parent | 7b6a221e5b21fdd4fd0f8a2ebf3f251338a10fea (diff) |
btrfs: rename btrfs_mask_flags to reflect which flags it touches
The FS_*_FL flags cannot be easily identified by a variable name prefix
but we still need to recognize them so the 'fsflags' should be closer to
the naming scheme but again the 'fs' part sounds like it's a filesystem
flag. I don't have a better idea for now.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ioctl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 47e7e2822c60..f5b83b4cc6bf 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -93,11 +93,12 @@ static int btrfs_clone(struct inode *src, struct inode *inode, int no_time_update); /* Mask out flags that are inappropriate for the given type of inode. */ -static unsigned int btrfs_mask_flags(umode_t mode, unsigned int flags) +static unsigned int btrfs_mask_fsflags_for_type(struct inode *inode, + unsigned int flags) { - if (S_ISDIR(mode)) + if (S_ISDIR(inode->i_mode)) return flags; - else if (S_ISREG(mode)) + else if (S_ISREG(inode->i_mode)) return flags & ~FS_DIRSYNC_FL; else return flags & (FS_NODUMP_FL | FS_NOATIME_FL); @@ -218,7 +219,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) i_oldflags = inode->i_flags; mode = inode->i_mode; - flags = btrfs_mask_flags(inode->i_mode, flags); + flags = btrfs_mask_fsflags_for_type(inode, flags); oldflags = btrfs_flags_to_ioctl(ip->flags); if ((flags ^ oldflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) { if (!capable(CAP_LINUX_IMMUTABLE)) { |