From patchwork Wed Oct 4 18:53:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13409302 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 DFA4AE7C4EE for ; Wed, 4 Oct 2023 18:55:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65E0D8D00A7; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E87D8D0002; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 488478D00A7; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3485B8D0002 for ; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 13F39802EE for ; Wed, 4 Oct 2023 18:55:28 +0000 (UTC) X-FDA: 81308682336.24.A301A57 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 6119018001A for ; Wed, 4 Oct 2023 18:55:26 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=F18Oj6eE; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1696445726; 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=qQTDCLUWbjKPjQu7SLJ59PyTx7087Qx4d7zqkuxG61A=; b=VoBf4nKm/vH4G/lPEjJvfpvbncGYtAtaTejfGCVKukTDQLHQtoaq0ENYtGCD3XzopSsa/f dqwBxkcDeJIHwYoEcZpLW+sLtbEGfJKYyqLEynZKMgdp8vq2Gi4KK8Cs24irngM4Z5E6TD 8VzdJCglBfONSDq37aWHuQbfw0VR+qI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=F18Oj6eE; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1696445726; a=rsa-sha256; cv=none; b=sYQyl6kH5ad/5W7MSEDlBLlR0sZkNrtQrBPbA+Zedu7GtS/N4ZmtrLgMDcQOBCbHCqhpNp 1YweZoHn5J2f2EomPmZVmlyFEwgyqTFedbXE24c995bf9Yc5QWY7ZOfVGT0zkjFghOfRGo oJ05k3pSRE/tF9j/L5Ffw7Tvhl6GuRc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4EB84616A6; Wed, 4 Oct 2023 18:55:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93445C433CA; Wed, 4 Oct 2023 18:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445725; bh=862ZbMc7Iwgtnwh3GqR4Jl+nGAZ2XLWIwUU6rRcMJ6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F18Oj6eEab2Bi2zSWygWYjomZTGEXh+alEUcKmrc6ouzTyG9T9RJoncvIMYXRKrDr utHJ7sNOMpE1DGMtUh0UhzIy2Etoret3APYucUxWjlvQB7zjoQNQFRxfUvDb0JmwJD XkPEjWwGp46ZIIEyxLNNj7Dg5+WGU/jRokhgISzy+pgDltJH7hnRdWdRjWfF7OdVpY MVkkDEX2Bi541//U87NX5bARZdafBUR7yD7JrSsTQxnH6GyNtCtY61i6TEZGSMM/9B 7FbiXS9cs59RkjuXHxDVZyTNCzqtHVV+V4B7sGuShqTmuwFrlXzzjv5svqIR2alyV3 s0teUdzfhXgGw== 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 v2 82/89] mm: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:07 -0400 Message-ID: <20231004185347.80880-80-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185347.80880-1-jlayton@kernel.org> References: <20231004185221.80802-1-jlayton@kernel.org> <20231004185347.80880-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6119018001A X-Stat-Signature: q3cd4stuqswpum4hm9rzxhn6myofqoud X-HE-Tag: 1696445726-720716 X-HE-Meta: U2FsdGVkX1+13xwnUrvhFTVbKwZTJ6Yyr55+PWazQqbSq7ATi8pUfdh/lHqkHQYa4z7qIeTjsQOtObpOTVv9xIBoiOf8QwrQCuq6YRCi+KUHqxDrx49Svg3EEPaAdjkYXyiU1/g47h382rIuOWFBxRyxi0z1skRh+tbmbPawtQ9zd3X5ENP8y2TwnPdklOAU9b0+wXf0aBuzNPh660B4XkK8PIbdcB0yAJ3Zj0zEog06gbvgDM9FCApXVnJJhImpRAQG2uO6UCd+wwlBVoi+bnW8Ur2nRB88kfWLr2xdWyzeavxKRbE9177eMrjtDovp7Kz1QMyA5SJeiXKunBlnoOSR/1ZLiWaWzD4dRx6WY9C1HuHszOpQ4i70xZpFZBS/sNPTpr+gPLVjWZwC71uxo+WRf/XADOhqMZ377zJYQGgRWuzR2HKDo/Du/08bgJyKFKDrGz+kZVLE0ERA9ledVmE0fVK/NVq0Gc0aELk2H0Z2u09oAvX++t81thpSpBUSiwTLyd5WQ7j+ERpnf+mfuD7B5rJk+Wv5NpgZAiUcHSjgArNHJmvJfuSDVGRSLBSYU4qVdasT3+L/mKYi+8SDADj9WONzXZLocsv0jEhPFFrcL3R5b01Olr1JHkFYhSXMF+cEub3kUa/n00L5J6QmI04bYBKg5XLUZq9/exrKKiFztsMG7rpWP499KP6H3/Idrr6P5RoXWu9WuO+1oW5L7lIpXpUC84UJ9FJHUCiBINilayQLMY7BP9uQtnOuaIk6AXPpcw3BKnontLRdSv//HZJIH3UOjb/PwIX31v7mlX1yBZbHl7AnvSfVHmWfYlDLOHvNe6Hl5v+skSHW9i/S9w6hSo5e/kEU1904YPDjR/qrK2iGAVLF7zXIkcAJ/9tBZNmfz0ny5AAfbEYci7UiipKDsZwzbc2IuuwHtSFEb/pwP6WX/MBRHvR8omYupMo7/KVsZDrA6SXSZQkzPIY +Xmxvdm9 /fcqxJ7FDsYdW3cS08AF8Sx+1CkwuF1A2kUw1soVqbRzeWKgBPgqPaZZMzMD9QIYQ7DL9Zn4H/Kj0M6dG/nTzWSuJMU2AYYRPXQOq0Zu6+y3LPyQxtpPGYBTR3E17Q+NqbZr8DgVXlQAQzTI+wjEpgqKZNFWBs3ukWqUAZceTPUzylEX16CQSOBucSr0hcH/60WN+GUvAdbxVyTtnREO7SCRN4vriavM/+cYcYufD8VmZGWiIZnva8HVkuA== 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: Convert to using the new inode timestamp accessor functions. 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 a3ec5d2dda9a..93c09d1837fb 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1111,7 +1111,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); @@ -1222,7 +1222,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; @@ -2475,7 +2475,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); @@ -2483,7 +2483,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) @@ -3248,7 +3248,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 */ @@ -3335,8 +3335,8 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, } 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 */ @@ -3356,8 +3356,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" - does all the work */ @@ -3504,7 +3504,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);