From patchwork Thu Sep 28 11:03:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13402654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45C6BE732C0 for ; Thu, 28 Sep 2023 11:05:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D8E58D00A9; Thu, 28 Sep 2023 07:05:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8882B8D0038; Thu, 28 Sep 2023 07:05:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 777AC8D00A9; Thu, 28 Sep 2023 07:05:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 693928D0038 for ; Thu, 28 Sep 2023 07:05:52 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3F5D3160EEC for ; Thu, 28 Sep 2023 11:05:52 +0000 (UTC) X-FDA: 81285726144.02.8F1C0FA Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id 8F55740005 for ; Thu, 28 Sep 2023 11:05:50 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=By3nvlPw; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695899150; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AdPVq+Gl0KsbrSlD4qkrIxGVCyOaXKBg1Kci98DRBBw=; b=ZPWenpVmGx2n1igaOfu0XsGTAUNFrO0QbaLRrZMdI7XhKMrGIRCSNUSJr3PStcdKH7K6M/ TekdnlWHc6Tn/4wr9OTd6CO6Yyxlfrpt4c/luWWeqtkhFdR1Iqo3vShBth9YCLiqqLFwNH ILIghWakaMa2TUpHzVyTgqEWZIkvsuE= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=By3nvlPw; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695899150; a=rsa-sha256; cv=none; b=EOV7tauf31XkWW+XuWWfzU+Bd2CNM+aXZ8zpfRbp/b/cb6PtVo+7KA6rZSdKH9DGrwYnjS zisbKRRqDL/T3RzzSgCTMdyy1oUTdPm0vtQ9yXJabtXsEa52VWEKrVtu7XHaaGj+i9LLHO tJns0gaz/vrGB4e4gbTwV1TupYiC7ao= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BF3BA61353; Thu, 28 Sep 2023 11:05:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA775C116A4; Thu, 28 Sep 2023 11:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899149; bh=uFrEzvYVQCsriiMGkk8AKLTd0LQsQsSJjSLze8FhJ9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=By3nvlPwwALdU/McvKHBoddMEDKfobu2wT0jBMPExLOGfgXT7dqsgh7GI1xdf7haq wDtMEr6nybvX6l/M/85HTUlMX7yEVTLkzoFkHYiJ/3wP9SVesXSe1RTNOgJhfJ1rdo 3Y13+MJ0VUOStyZz/0Oq/gy3FNncWzGLN29tLpmVFCDOTUuDS2oCpQBF+53VkbPuea wNUZrINU+eN/Rw+31QzziJWDr3kybOsf88fvuRociCfPJ0EOGi8zZjvVrBNP0JHknr jWNtQBkKy0PIMofs4A2OaNWPYgsTY5zB0TzMvYSY0JUMxCdOIl2Wq1XyDxxjA1+F06 vsMHBm6doTiXQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Subject: [PATCH 80/87] mm: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:29 -0400 Message-ID: <20230928110413.33032-79-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8F55740005 X-Stat-Signature: n51tska65a6fh6gtgw59o48arkj13zs1 X-HE-Tag: 1695899150-505465 X-HE-Meta: U2FsdGVkX1/X+x8I9srfp5BPRaDmo++Zz+65B/NU75u4q5ii7/tUww38h/C2+VRwdrDdIYvg08AycVABMhejEe0NOwXGoD9CvV5keicg5GybM96WQuuMmAdB/NKz15is2ih4ZPHSfpCHer4dRmTu/VoQ5rX0vtrPUA10MJhaDop7QVxJF8IzqClEoGpP0lpaCmEr/3PZYtGsVC7w0ItoEc4Ol8FIloFucbhv1cZbgFQbphF/fR3ChKiqWNObjtXg3xnkNP18f1CfQmeXE8Oz9vgNg4OeDKIjJt7HtkKKP48JT8sw22iC8a7wnh5AZTDZUymxFp9QW+k0255X5p3frWpdA//bLFlAil9TNHqbU58AvpQZMmyCbYiOM1yVtG0BiJYb9XZ9uLXfYRMIApMDeWm8slwCuqrpD3tkvVgduGpWNyvqEddCajEhKqNVoiFo4t1r1tKM52JWhMOfopLU4IBq7nGewwZ0PqbRyv9Sw/zgNNj/elmWb6RQUZYu/0GBOueohFF4fKyJ9itvkkIg2YfoJTVldhKNyQO+LGArW88zrdpS5bgcS/TfxgTE2dQN1sVBlADQH/GWayFBgIgwUag2xeNFhgGux9Dc8g7d5/HGwRHamX34bHnGULtJWAaJp/JHOOG88ReHB7xc4JBPBQVvw0cFoI2ZuYKpPsVfRQhA880jrbBrZKJvQNuF8eggEKO/S+VZFavxnRR4Uf9ERDBeco5yhNiPkkfvpVLhl3kPvh6yXa41JA1DQf1hktnpzGZ1o08be0BBKn9AWKVgX663BLBYGMXofCHiLefYBmKreRJuKeH8ZSM2bckvFKGOKC7fnBPohC3YnDEvi1MPgmT1y+hHda35tOVqqRaCKbG6nrWN7i4Lk7VlAHNnG6HRpyWyDPY2yDwz2OYgSojDTmEM+0J+nOkqSouKun11macuxH+7ckKZI+l/d1gzhH04nZ9HAgPpjz0fA7ukP/X XNOSoYJ0 OT2LDZynDqE1yOgo2J13GxVEh0CaezU2csFoKRXJjX5NuvjfboTgZ1Y2mjv30Cs5OeHINlnCbzXWaDpFGDT+/0pfEZA2Agw+79WibRNoHERFz/wWNWw6/OY+BKscTASoTfkW26QrlQSaZJ9WuSQMCACa+Aqfig2c3HFldVfVxO+8tdloCoBWpkkKLWDsks1mvrE67NctGESIe2P+vp6Us87FzIjmxqVj1ilUe32MHti4pUESoVvEEuN09Kg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Jeff Layton --- mm/shmem.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 69595d341882..c48239bfa646 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1112,7 +1112,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) { shmem_undo_range(inode, lstart, lend, false); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); inode_inc_iversion(inode); } EXPORT_SYMBOL_GPL(shmem_truncate_range); @@ -1224,7 +1224,7 @@ static int shmem_setattr(struct mnt_idmap *idmap, if (!error && update_ctime) { inode_set_ctime_current(inode); if (update_mtime) - inode->i_mtime = inode_get_ctime(inode); + inode_set_mtime_to_ts(inode, inode_get_ctime(inode)); inode_inc_iversion(inode); } return error; @@ -2455,7 +2455,7 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, inode->i_ino = ino; inode_init_owner(idmap, inode, dir, mode); inode->i_blocks = 0; - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_generation = get_random_u32(); info = SHMEM_I(inode); memset(info, 0, (char *)inode - (char *)info); @@ -2463,7 +2463,7 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, atomic_set(&info->stop_eviction, 0); info->seals = F_SEAL_SEAL; info->flags = flags & VM_NORESERVE; - info->i_crtime = inode->i_mtime; + info->i_crtime = inode_get_mtime(inode); info->fsflags = (dir == NULL) ? 0 : SHMEM_I(dir)->fsflags & SHMEM_FL_INHERITED; if (info->fsflags) @@ -3229,7 +3229,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, goto out_iput; dir->i_size += BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ @@ -3318,8 +3318,8 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr } dir->i_size += BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_to_ts(dir, - inode_set_ctime_current(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode))); inode_inc_iversion(dir); inc_nlink(inode); ihold(inode); /* New dentry reference */ @@ -3339,8 +3339,8 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry) simple_offset_remove(shmem_get_offset_ctx(dir), dentry); dir->i_size -= BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_to_ts(dir, - inode_set_ctime_current(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode))); inode_inc_iversion(dir); drop_nlink(inode); dput(dentry); /* Undo the count from "create" - this does all the work */ @@ -3488,7 +3488,7 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, folio_put(folio); } dir->i_size += BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry);