Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp495983ybm; Thu, 28 May 2020 08:02:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz1DN+ceqC6jAjXlleW88mfRdG+tyhG7GQp5l40DDzs4mR9zu+D9rj5P9obyBp7KddTio7 X-Received: by 2002:a17:907:1106:: with SMTP id qu6mr3254172ejb.321.1590678162916; Thu, 28 May 2020 08:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590678162; cv=none; d=google.com; s=arc-20160816; b=UntoESvdrLEPnHXpabcol22h8uAEOR7vlLDSozZ7s1bM9SHM4fNuHdgy8aOSDpzzk+ YT+IRbyGXDmLW4FRSjjB3yBI66yweZEzmxhwnj6lGWTRFM5HZHkiC/uVlPhStwV6lQvX XY6Vm0LLLGC4U3OYJk2qru4+Elzg4W3NS2NI2c0jvSRrhIavNEPV6TR7Xxnx8dLOJ/Xh aZpMkAwopEuqcZ2FCPsn8ETurQG5dxuKagEDxtyvdN6DTRTQUPuwNDthm8TNFADUvm3k mU9AW8wOA2UOyKS5rTO7QAG1F8uv7MC863aGh8MvmhZyGU008j36XIQo5E7/tCH86gTu du8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=YINDZ+ThdHTznBRxGDPU4uoAMxLa6sg3BYbC52WDXTg=; b=V1dT40+5ciGUS94FoR7n/6N3cOErqBNCaVWi5exoz0JrjAIjM3fsl/RI4RO3CU3Duz 78vORiGCBTiSpkFR0DQGen6NM88mLMDBPOdP/F9FfMOF4q92bAiKVF/j5hH98OYh38kR BabdntiJ9KwgDfGfNKNYoCgn9waugUqLEaOz+JKN2uG7heg+8FkaDx1TV3+4/sZUCHdB meUMIv3r+EXpNB7cFcKLx2zW9NHQbHf4dLDfqpdw6Pxvl3zGiKe+RJujYb7ad9OIXIl3 NQxH93Lr2SiIjw401DapRQLRpepWIFb+h5gPrdzvyH2Gx49H7tV/AvyuW9d9tvzzR5NS 8H1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y92si3415976edy.117.2020.05.28.08.02.14; Thu, 28 May 2020 08:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404118AbgE1PBK (ORCPT + 99 others); Thu, 28 May 2020 11:01:10 -0400 Received: from mga07.intel.com ([134.134.136.100]:2309 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404025AbgE1PAP (ORCPT ); Thu, 28 May 2020 11:00:15 -0400 IronPort-SDR: 8iRVyiTdsf/S3mtZ/4Lh8ISMVC5lYOoeAJfpDY5eq76opl0gz+kUfLSlby8qaZddYIxQX7G4KY UZv8YeACIxkQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 08:00:10 -0700 IronPort-SDR: A8j3Z7IoeQWpMt4y9Vhwt/NW1pH9moyOUNDJDzf5Lz4BniuKztolZ+9iQmQAuHFmnj6xEuoyB9 B8B1uOkBG9ew== X-IronPort-AV: E=Sophos;i="5.73,445,1583222400"; d="scan'208";a="302502474" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 08:00:09 -0700 From: ira.weiny@intel.com To: linux-ext4@vger.kernel.org, Andreas Dilger , "Theodore Y. Ts'o" , Jan Kara , Eric Biggers Cc: Ira Weiny , Al Viro , Dan Williams , Dave Chinner , Christoph Hellwig , Jeff Moyer , "Darrick J. Wong" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V5 7/9] fs/ext4: Remove jflag variable Date: Thu, 28 May 2020 08:00:01 -0700 Message-Id: <20200528150003.828793-8-ira.weiny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200528150003.828793-1-ira.weiny@intel.com> References: <20200528150003.828793-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Ira Weiny The jflag variable serves almost no purpose. Remove it. Signed-off-by: Ira Weiny --- Changes from V4: New for this series. --- fs/ext4/ioctl.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 7ccf20b1488b..e8a5cdade59f 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -300,7 +300,6 @@ static int ext4_ioctl_setflags(struct inode *inode, int err = -EPERM, migrate = 0; struct ext4_iloc iloc; unsigned int oldflags, mask, i; - unsigned int jflag; struct super_block *sb = inode->i_sb; /* Is it quota file? Do not allow user to mess with it */ @@ -309,9 +308,6 @@ static int ext4_ioctl_setflags(struct inode *inode, oldflags = ei->i_flags; - /* The JOURNAL_DATA flag is modifiable only by root */ - jflag = flags & EXT4_JOURNAL_DATA_FL; - err = vfs_ioc_setflags_prepare(inode, oldflags, flags); if (err) goto flags_out; @@ -320,7 +316,7 @@ static int ext4_ioctl_setflags(struct inode *inode, * The JOURNAL_DATA flag can only be changed by * the relevant capability. */ - if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) { + if ((flags ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) { if (!capable(CAP_SYS_RESOURCE)) goto flags_out; } @@ -391,7 +387,7 @@ static int ext4_ioctl_setflags(struct inode *inode, if (err) goto flags_out; - if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) { + if ((flags ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) { /* * Changes to the journaling mode can cause unsafe changes to * S_DAX if the inode is DAX @@ -401,7 +397,8 @@ static int ext4_ioctl_setflags(struct inode *inode, goto flags_out; } - err = ext4_change_inode_journal_flag(inode, jflag); + err = ext4_change_inode_journal_flag(inode, + flags & EXT4_JOURNAL_DATA_FL); if (err) goto flags_out; } -- 2.25.1