From patchwork Wed Apr 15 06:45:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 11489917 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B1DD6CA for ; Wed, 15 Apr 2020 06:46:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20B4B20771 for ; Wed, 15 Apr 2020 06:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2634967AbgDOGpn (ORCPT ); Wed, 15 Apr 2020 02:45:43 -0400 Received: from mga01.intel.com ([192.55.52.88]:14284 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2634958AbgDOGpk (ORCPT ); Wed, 15 Apr 2020 02:45:40 -0400 IronPort-SDR: H1edArZcFw4bkn4s4K8dVf4vdEgpr+oZo/kbIzwVseAoAAjq4/9gtNqfzjhfQ5kjOv6tTqqAg/ 0jlG9YUXPZTw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 23:45:40 -0700 IronPort-SDR: Quwqhfxc0cdOGmPkkh1esd0bMlfn0dEGubd/2AQSW6Y4W719F4d43CCwXR3+OmzFqkda8m1CVw +uxnpBhiVjOQ== X-IronPort-AV: E=Sophos;i="5.72,386,1580803200"; d="scan'208";a="363592877" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 23:45:40 -0700 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org, "Darrick J. Wong" Cc: Ira Weiny , Jan Kara , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jeff Moyer , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH V8 08/11] fs: Define I_DONTCACNE in VFS layer Date: Tue, 14 Apr 2020 23:45:20 -0700 Message-Id: <20200415064523.2244712-9-ira.weiny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200415064523.2244712-1-ira.weiny@intel.com> References: <20200415064523.2244712-1-ira.weiny@intel.com> MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Ira Weiny DAX effective mode changes (setting of S_DAX) require inode eviction. Define a flag which can be set to inform the VFS layer that inodes should not be cached. This will expedite the eviction of those nodes requiring reload. Signed-off-by: Ira Weiny Reviewed-by: Jan Kara --- include/linux/fs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index a818ced22961..e2db71d150c3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2151,6 +2151,8 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src, * * I_CREATING New object's inode in the middle of setting up. * + * I_DONTCACHE Do not cache the inode + * * Q: What is the difference between I_WILL_FREE and I_FREEING? */ #define I_DIRTY_SYNC (1 << 0) @@ -2173,6 +2175,7 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src, #define I_WB_SWITCH (1 << 13) #define I_OVL_INUSE (1 << 14) #define I_CREATING (1 << 15) +#define I_DONTCACHE (1 << 16) #define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC) #define I_DIRTY (I_DIRTY_INODE | I_DIRTY_PAGES) @@ -3042,7 +3045,8 @@ extern int inode_needs_sync(struct inode *inode); extern int generic_delete_inode(struct inode *inode); static inline int generic_drop_inode(struct inode *inode) { - return !inode->i_nlink || inode_unhashed(inode); + return !inode->i_nlink || inode_unhashed(inode) || + (inode->i_state & I_DONTCACHE); } extern struct inode *ilookup5_nowait(struct super_block *sb,