From patchwork Wed May 9 13:54:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 10389633 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8FC660153 for ; Wed, 9 May 2018 13:57:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99AD128FBC for ; Wed, 9 May 2018 13:57:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E44D28FC3; Wed, 9 May 2018 13:57:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F0A028FBE for ; Wed, 9 May 2018 13:57:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756346AbeEIN5e (ORCPT ); Wed, 9 May 2018 09:57:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:34339 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756254AbeEIN5N (ORCPT ); Wed, 9 May 2018 09:57:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 92213AC9B; Wed, 9 May 2018 13:57:12 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 5A1FDDAD5E; Wed, 9 May 2018 15:54:35 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: misono.tomohiro@jp.fujitsu.com, David Sterba Subject: [PATCH v2 4/8] btrfs: rename btrfs_flags_to_ioctl to reflect which flags it touches Date: Wed, 9 May 2018 15:54:35 +0200 Message-Id: X-Mailer: git-send-email 2.16.2 In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Converts btrfs_inode::flags to the FS_*_FL flags. Signed-off-by: David Sterba --- 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 0b84f9e68f86..40eeb99310d5 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;