Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3150594rdh; Thu, 28 Sep 2023 04:23:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsGOvXOETWLJYIQCJfCOYsGBSHKSd7zestvg2qTVb8u1zqQaiYePKSlhH0hY1CW3g0YhD9 X-Received: by 2002:a05:6358:1ca:b0:143:9f18:d71a with SMTP id e10-20020a05635801ca00b001439f18d71amr759081rwa.14.1695900202144; Thu, 28 Sep 2023 04:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900202; cv=none; d=google.com; s=arc-20160816; b=fMQJsM74DpJjxotdE+y2MiErKy9RPFbCzeEJl5ukY2bJd+VBNNHTo6CbC3pBClqAxn wEpJz6oFrZovLvoGwGMVefmcEIt4tG868YCcX8XBR5icIP1/x+YhO/xTM5cgpjRT0L1E eD/28Oi1xE8/cDhre9kVAU8h2ECTFkJv4hIy/n+KsTNoJyI/A5F2cSke0F6RU7wpIz5Q 8JXDj7Oyim9+KBrBFPVovSI3wa1n4mLjcIBTYopZarltO92F2mV1uSpiap/crZbJ9PnR uYzplIaMIXNi5GVCc4FhmmpivibCwafVAHHtHMN02Nr74W03S1buuVuDeVXgv0HI/heu SBhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AdPVq+Gl0KsbrSlD4qkrIxGVCyOaXKBg1Kci98DRBBw=; fh=YcvKTfjdELTIgtVvxDx+GI7Jag3KQiPyLLfYV96J/gA=; b=eLTRZYJQG7UF6HOdH47tFciOHFsfTTE9woeyNPkybI4WX93EWTWAURpG034BUpHDEV 5aqUn3bMDxcVyqrIORZh0oSUp9nu5nog5hhSMjJEi/PIu50zZx4ri7WskjXkHARTOP4m /WKJ4/xqLqRe9/48Sm37UXsDwh2Uil/ST+u6D1FqmysNVf2dUbNQ1kkBMJcqaq6bKA+K o1OHOENocM/w9OAgKBZcs0Sot2/tDcEVk8FqHYP1dKST+A8sA14LVlXtRpC1gb6RV4cw Dtna7kZ+QCWraLXAeRSBn9/oOudZZHubaMhUcMcNmoIeuQ1HAFwsnByjvC7HZVEd5TbK N+iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=By3nvlPw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id p19-20020a639513000000b00573f786103dsi15697777pgd.754.2023.09.28.04.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:23:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=By3nvlPw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 045448047556; Thu, 28 Sep 2023 04:21:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232085AbjI1LUr (ORCPT + 99 others); Thu, 28 Sep 2023 07:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231954AbjI1LU1 (ORCPT ); Thu, 28 Sep 2023 07:20:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A71630D0; Thu, 28 Sep 2023 04:05:51 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:21:10 -0700 (PDT) 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); -- 2.41.0