All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 4/7] btrfs: rename btrfs_flags_to_ioctl to reflect which flags it touches
Date: Fri, 20 Apr 2018 19:02:38 +0200	[thread overview]
Message-ID: <2f7110c081dcf9c2523de8ca5357ad7efeeba40d.1524242295.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1524242295.git.dsterba@suse.com>

Converts btrfs_inode::flags to the FS_*_FL flags.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ioctl.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 953473f2a136..f0e6074233fa 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;
-- 
2.16.2


  parent reply	other threads:[~2018-04-20 17:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 17:02 [PATCH 0/7] Add ioctl to support extended inode flags David Sterba
2018-04-20 17:02 ` [PATCH 1/7] btrfs: rename btrfs_update_iflags to reflect which flags it touches David Sterba
2018-04-20 17:02 ` [PATCH 2/7] btrfs: rename btrfs_mask_flags " David Sterba
2018-04-20 17:02 ` [PATCH 3/7] btrfs: rename check_flags " David Sterba
2018-04-20 17:02 ` David Sterba [this message]
2018-04-23  2:37   ` [PATCH 4/7] btrfs: rename btrfs_flags_to_ioctl " Misono Tomohiro
2018-04-23 13:11     ` David Sterba
2018-04-20 17:02 ` [PATCH 5/7] btrfs: add helpers for FS_XFLAG_* conversion David Sterba
2018-04-20 17:02 ` [PATCH 6/7] btrfs: add FS_IOC_FSGETXATTR ioctl David Sterba
2018-04-20 17:02 ` [PATCH 7/7] btrfs: add FS_IOC_FSSETXATTR ioctl David Sterba
2018-04-23  2:42   ` Misono Tomohiro
2018-04-23 13:14     ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f7110c081dcf9c2523de8ca5357ad7efeeba40d.1524242295.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.