summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-03-26 20:12:25 +0300
committerDavid Sterba <dsterba@suse.com>2018-05-28 19:23:27 +0300
commita157d4fd81dc7b7d04b6b5fc1a8e063dba2ffe5a (patch)
tree7be1317b1dda207b7f5c1954892653e5ef3a5194
parent5ba76abfb233661f4d890b7069aacc65aa65e34c (diff)
downloadlinux-a157d4fd81dc7b7d04b6b5fc1a8e063dba2ffe5a.tar.xz
btrfs: rename btrfs_flags_to_ioctl to reflect which flags it touches
Converts btrfs_inode::flags to the FS_*_FL flags. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/ioctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index ba62dc3d59ec..47c1b96df099 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -105,9 +105,10 @@ static unsigned int btrfs_mask_fsflags_for_type(struct inode *inode,
}
/*
- * Export inode flags to the format expected by the FS_IOC_GETFLAGS ioctl.
+ * Export internal inode flags to the format expected by the FS_IOC_GETFLAGS
+ * ioctl.
*/
-static unsigned int btrfs_flags_to_ioctl(unsigned int flags)
+static unsigned int btrfs_inode_flags_to_fsflags(unsigned int flags)
{
unsigned int iflags = 0;
@@ -161,7 +162,7 @@ void btrfs_sync_inode_flags_to_i_flags(struct inode *inode)
static int btrfs_ioctl_getflags(struct file *file, void __user *arg)
{
struct btrfs_inode *ip = BTRFS_I(file_inode(file));
- unsigned int flags = btrfs_flags_to_ioctl(ip->flags);
+ unsigned int flags = btrfs_inode_flags_to_fsflags(ip->flags);
if (copy_to_user(arg, &flags, sizeof(flags)))
return -EFAULT;
@@ -221,7 +222,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
mode = inode->i_mode;
flags = btrfs_mask_fsflags_for_type(inode, flags);
- oldflags = btrfs_flags_to_ioctl(ip->flags);
+ oldflags = btrfs_inode_flags_to_fsflags(ip->flags);
if ((flags ^ oldflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) {
if (!capable(CAP_LINUX_IMMUTABLE)) {
ret = -EPERM;