From patchwork Wed Jul 5 19:00:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116329 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2092565vqx; Wed, 5 Jul 2023 12:33:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEz2rbm7C1jPTBTT18MG3TfzlgP+OPuXhlTay+Irxbe8Jav+xQsLs1HUEcEV1hfyQ9vuYgK X-Received: by 2002:a17:902:ce8a:b0:1b8:ae12:5628 with SMTP id f10-20020a170902ce8a00b001b8ae125628mr4530781plg.2.1688585638169; Wed, 05 Jul 2023 12:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585638; cv=none; d=google.com; s=arc-20160816; b=B1iKpP8BY1QF5ZqEs3CWwUdkUxX8H2Qw78eBmTe8nZFGPlKZho70/El12JBPJHFUL7 aT7B26z2Q5+rjU1xUzjNmr98XlPLeBng8QMc7S+iJc5kkXV7EEVZQYcEWpVXDSfb8nDC u0VUVhlSqRiZpxZEJetPizEWGZLbbcL4+iwCt13nIBOY2nyE3dL7Y0fG5/4HWEC5Uhsa wJzoGvPIBTAXqACjKhYJ5Jy5YchQCePkY3x0N7pBD13zPGlDIF4pK/YSMvZhvR6SWUpw Sn7f5OCEYuCWHu1Eux426SiaiOi415oAEzohmKHGuJ4R3NyhFGWZHkjjihgr19zfxGTf B4Lw== 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=36OC4eSxpyScnl+D6neFgNFCa0z1GQEHU/Tcnahnix0=; fh=2vu4MBfnUADOXALHWEoDesQWhUPj0yymx7XOkhLDJos=; b=mWSOXMdzKgvKbMRGqjiqqgooFDbbEf5dfs72cNVpyQXz6PmV4aeLmORTZsxE3xeiA4 zp+hhouryZaGLgQRl2aGNlU03Yw6pMTNMTmPiMSCtfuKHx80TMycyLxirB6c07Ljc7HQ tXqGg+PUWxy9BIfHGDvaVRixEdTIbpv9R9T0zH6l6vHiouPyuDFU+k8YNh6iVIZfBLkY MGvNFxyuF2hhKW49UXL+JBTHlvyC54PLPK7VQXhgp7Pu7+MMKoe1gA1EP3SyiK8rffQ+ kJptw1GR0DQmj/m9VeX5FsN1gU4HY1BIS3bAYWjcxSkv/fbvQec9P+cU4mZ0zAmptLvm /hiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTpannEK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a170902dac100b001a664075202si25417628plx.542.2023.07.05.12.33.45; Wed, 05 Jul 2023 12:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FTpannEK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233401AbjGETDT (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233317AbjGETDR (ORCPT ); Wed, 5 Jul 2023 15:03:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52F7C198D; Wed, 5 Jul 2023 12:03:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DE7CD616CB; Wed, 5 Jul 2023 19:03:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 745EFC433C7; Wed, 5 Jul 2023 19:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583791; bh=wRIPLE3X7SYZpESEXOLs3yn+7zQ1CKcV/+ZcwAoq978=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FTpannEKxF9FGAXqisIULH/0wrvQYdzHRZ7wioY4D/6BRm1At1RMDBI9nCtFVC1tG ob+ED//wty7dcQ3OMD1HQhRJipfA+/FvAA6M28L0kfISCXzGvVF/l9x6xA7vzhadRB V0htXWbgmNLzWkAKRGLBiRvjF6B1Kflj2KBTIjpD9zfWJzD8em5bFYPPdpqBSp5jEK +fE6bGti3cPOeIwU1oYVj4T6e92p8EVTt2IOAFx2tNbVpTBWT5rBLFRWNIAe9mS2j+ 3S85FBxdlFtI26S8B1l8DLl2CXJKg67qcaNAU6LIlaeKIb/Gs+5LvecQTxBW0sITap zVcAWLDXGBlmw== From: Jeff Layton To: Christian Brauner , Brad Warrum , Ritu Agarwal , Arnd Bergmann , Greg Kroah-Hartman Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/92] ibmvmc: update ctime in conjunction with mtime on write Date: Wed, 5 Jul 2023 15:00:28 -0400 Message-ID: <20230705190309.579783-1-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705185755.579053-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610374008479850?= X-GMAIL-MSGID: =?utf-8?q?1770610374008479850?= POSIX says: "Upon successful completion, where nbyte is greater than 0, write() shall mark for update the last data modification and last file status change timestamps of the file..." Signed-off-by: Jeff Layton --- drivers/misc/ibmvmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c index cbaf6d35e854..d7c7f0305257 100644 --- a/drivers/misc/ibmvmc.c +++ b/drivers/misc/ibmvmc.c @@ -1124,7 +1124,7 @@ static ssize_t ibmvmc_write(struct file *file, const char *buffer, goto out; inode = file_inode(file); - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); mark_inode_dirty(inode); dev_dbg(adapter->dev, "write: file = 0x%lx, count = 0x%lx\n", From patchwork Wed Jul 5 19:00: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: 116371 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097064vqx; Wed, 5 Jul 2023 12:43:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlE54aPetzZ8H0NdakprLjJonU4UQk2SRpir8akNLogQ3ZR8kREjts0MX6YTU6T7266kgqLM X-Received: by 2002:a05:6a21:6da6:b0:12e:7c29:a6dd with SMTP id wl38-20020a056a216da600b0012e7c29a6ddmr8480540pzb.43.1688586239236; Wed, 05 Jul 2023 12:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586239; cv=none; d=google.com; s=arc-20160816; b=dfmzPvrJzbGt7SB3UrD/7a9Tgmany9EdXzUrX+3I1nATmh4eYA1qvkkSbSd0KyS/59 uyv2wOWWvGhEQH57iCiX6gttRy4I88k51WzWO2SKvf8FTIs1b3tqqLprwWBHvPloz4Jr alJ5QhLHDDXs+zY8cci/ZAIRhELB3xAIsHYdtQt4pjDAnVV8f7WvSDIHvZdhWZN4BsK3 rrw5+3p+GstwUEWi5JzoSkMfNVdPIYmn/jMs60GopD8zuebA5kZxTvGojlMnxMQI1tbF lCm0+zNjj2qJMgGgoZmhTV9dqg0NKPFhq4OogJqr12bca2zDgFgA7v/fTn+JoJJTnkOG pIbg== 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=OIxLC7hSnbfyV1KtKOhCN8czWoPZE32wN8VCxL6W1yk=; fh=AzeZTaQ1KKvSmmikrtHSu0y2fSYyJQkmMYXLo/U8qIs=; b=OxyNSTA0W+FxFo/Z+fRQIftR/6lj1Q3+xHpjGGhhnnwawhzlZhD2JtsihsgB3GCzST wr3bJOqefqvNARtdc0NQSI7g49yTSfZ3QqKEvRRX2h8Ir5v5O6y95Wzj6MSx6lEjOQGp hgJPCzJ7uSl5+bvFadxZcUFd+kz6TMdz7pHbPgLQ6ELlDYcjRxynL+QcDJIecC+N60Ff LCb/Wu3Xa135h8ewyyvr+KGjO78hYlkcyb1/QD4HYAEFXQIbSoNOv2DQGzKdIdReH53h rBjBv0A41Ci8E9ZKlbQYeoPVaI3MQr4j/Kuk8jrQ6ohUBvW0HGJniSGK/eYAMEH85CLo 08kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lUNvfNyP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020aa79584000000b006825e062715si12252255pfj.228.2023.07.05.12.43.43; Wed, 05 Jul 2023 12:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lUNvfNyP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233410AbjGETDW (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233327AbjGETDS (ORCPT ); Wed, 5 Jul 2023 15:03:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12DFE6E; Wed, 5 Jul 2023 12:03:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3D73C616E4; Wed, 5 Jul 2023 19:03:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08E8AC433C8; Wed, 5 Jul 2023 19:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583792; bh=HfiQXchZVgUdW2X7NFM83sYUqCp8My1ze+VPJQDRphQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lUNvfNyPT7W1MfeOCkDDT+DJnubUSlCH5fU4mFL4FRFG5h6LgjKonwHhqo7TNh5hN B+MiEAv22iPTlc2u5YfqIJNc2XtG6I038fBfVm6lJB/eP4QSwogDytyD88KahvHbrI VI8+NGIFDp/304cSkuaqDfeLob81nMQNJgSAS4h9FhrzuasAe4S1BbjrpRfg9duB+W 5k1GhWLMaCUZQXbMhBE29rg5uEXnl/5BQdp8qOtlnNRjV6bTJxrYrYgUxzmDKhZpsZ W32RS/IiQM+54sesxu5H7pOsVXojcLfgGF2ZTJf9t/XeIF2s3BxIJSPPJUsesmUk73 hSpMEDvO02xmA== From: Jeff Layton To: Christian Brauner , "Tigran A. Aivazian" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 02/92] bfs: update ctime in addition to mtime when adding entries Date: Wed, 5 Jul 2023 15:00:29 -0400 Message-ID: <20230705190309.579783-2-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611004601588182?= X-GMAIL-MSGID: =?utf-8?q?1770611004601588182?= When adding entries to a directory, POSIX generally requires that the ctime be updated alongside the mtime. Signed-off-by: Jeff Layton --- fs/bfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 040d5140e426..d2e8a2a56b05 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c @@ -294,7 +294,7 @@ static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) dir->i_size += BFS_DIRENT_SIZE; dir->i_ctime = current_time(dir); } - dir->i_mtime = current_time(dir); + dir->i_mtime = dir->i_ctime = current_time(dir); mark_inode_dirty(dir); de->ino = cpu_to_le16((u16)ino); for (i = 0; i < BFS_NAMELEN; i++) From patchwork Wed Jul 5 19:00:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116384 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097650vqx; Wed, 5 Jul 2023 12:45:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+IQn3PngS8wkV0MnfIbftPtxWeHb2HBAHKLMynC/9DFgOEzeJfDJwOYe68moKUP6q5Rnc X-Received: by 2002:a05:6a00:1391:b0:67b:d2e4:6bd2 with SMTP id t17-20020a056a00139100b0067bd2e46bd2mr14340921pfg.17.1688586316611; Wed, 05 Jul 2023 12:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586316; cv=none; d=google.com; s=arc-20160816; b=Alsg9UJDJrKO1l1komF5RLgbwBJ6hcWcy+iUO4FMwV3SiaVktjRaZ/ALKYFM6Sl9dW ZaDbMPUQZw9TV+FjtTdGJksbbDP9DphfyimuZpXyW2GkXqulhX3EF17n/JTNoCx2Bikj 5MGixDN4Ny/r7MDyjSYuuXNulCe3ZgyzAcb+sUfhkEE4E1pmT6tUTwB+Ne90E9ZWqglf hVeHsohIcIUy/pIVwMVCOgLCAb2t25vIC+EghDTixI4n9M4WhlGwKAh8wA4TuwdKaEgh IoAD/gEnQNa3P904P4Hf8JywKWO8xOD1diFP1Kf1g+qu4t48XbbITigSKBZOfP6IZ9Rq sLUw== 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=Ua85BCS4tRH3nbWjDh5uiknXobOPYgbdB/sS053sCBo=; fh=HAO2JJZuc9osmNUcdmJ13OJ8gAwSEUYLoO0odXf8GRQ=; b=DIyLTv3q6Gnt3xAAcUQP98ddMlweI5gShnyUYfWYVk6QcPBhMTOOOAIHRmVlt5ypK9 t5qMyiAOlmxYI4guVhtu0BOmx74CPz9f+UNQ9GCJgDkOT2C5z/Wfd1X7o4j3k49KGl4j oyItnk0wSMs9kbg7FLGm81tXgxGElbtCnnaYU8SrT7yaYNwMqBQ2CdntL79Afsvz8MjN HdCwMYj7kmCLM4B0VI0GXeuQLKNDXLTf8zLS9tv+kmHUneGwspCjmc0KKYWcPdMiPbC2 fK4ouoDtBF/2Bwa+V1yJ/wPGbuMeScaRsaa1yd0dP25zdd1/iauzRm6zE50cJ7LH88Bd 7nIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=phaRUhyc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y37-20020a056a001ca500b00675262821cdsi20603458pfw.113.2023.07.05.12.45.01; Wed, 05 Jul 2023 12:45:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=phaRUhyc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233452AbjGETDY (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233333AbjGETDS (ORCPT ); Wed, 5 Jul 2023 15:03:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F6341730; Wed, 5 Jul 2023 12:03:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B5149616C4; Wed, 5 Jul 2023 19:03:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 623D6C433C7; Wed, 5 Jul 2023 19:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583794; bh=kM0aleIbcnRzUxbHQknvyJkwiNG9CJKpnUbOghkokco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phaRUhycINZtI8zYHg2fG+4V1LUiUO/5B9eREQVACAzMMyozSUi/ITEr6/5RK7bsR iz7VqtRyVBoSBmASgtj/FnMd27l66LZTn80QtUDRsBzil07NF6x7PGdMR8LyBlxUPZ opM56Z0PcwVH5XjNxm2R/QgwYZEuIUE1VBns+KCJ7wKFUz9phIWV2LI4vrEKu1OJ5n Eww0q6XNhtkREiEuJHMjdtbc7WAyXu8ftTasC7vEfj1Gz/0oK+tCMYh98ztMflFc6m lS0QrRTSmiv3w4N+JNZXRaXgcQOX/lWJlc3E0uJzhvYwyQwFaiW7eK0iXEQJNbpj9z 35fi6aJ+Q580w== From: Jeff Layton To: Christian Brauner , Jeremy Kerr , Ard Biesheuvel Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH v2 03/92] efivarfs: update ctime when mtime changes on a write Date: Wed, 5 Jul 2023 15:00:30 -0400 Message-ID: <20230705190309.579783-3-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611085413747736?= X-GMAIL-MSGID: =?utf-8?q?1770611085413747736?= POSIX says: "Upon successful completion, where nbyte is greater than 0, write() shall mark for update the last data modification and last file status change timestamps of the file..." Add the missing ctime update. Signed-off-by: Jeff Layton --- fs/efivarfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index d57ee15874f9..375576111dc3 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c @@ -51,7 +51,7 @@ static ssize_t efivarfs_file_write(struct file *file, } else { inode_lock(inode); i_size_write(inode, datasize + sizeof(attributes)); - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); inode_unlock(inode); } From patchwork Wed Jul 5 19:00:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097311vqx; Wed, 5 Jul 2023 12:44:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlGnLjxhj+veLi6wnTd8/SmJLShkxAXFxZMwe+9Sp/T9DfVG1WKagKUG3dyfi8d8SDlvuJJO X-Received: by 2002:a05:6a00:2383:b0:682:3120:1450 with SMTP id f3-20020a056a00238300b0068231201450mr22285993pfc.30.1688586269324; Wed, 05 Jul 2023 12:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586269; cv=none; d=google.com; s=arc-20160816; b=imgmAV0CKuxCJXqFOGn8CZ9Jd5+eq6+yMJ1pFi9I3NQpzrx3sbfmqXKMGCY+bKU+JT I6yDD66DEpBKD5DrCvdxhaGNZm683Huenao4POYATkeTmEyUbUz3dKIZLy1Sz7BP/xNK koxV0TBX2gJCkrAUKySopFg5lp1HTZ0HhbFXUAY7emv8PyYwMGbC0qCWLjkFSNTluoWg 0bcM8E8mfhDhV4QsgMqSDx5+h9iVOzax4DOmE+w3KaJfox/WzolwVVitJklBu6mZjmjx 6VdSSTiAJHtlQbIpc8mfFKxuoOjzxBbmyZ3um7GI8KegvDSMtRsetmGNUBU1cAMa+pus sXMQ== 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=dijRCGJ7wEiaVvOKI/kUzn8r5ldTe/owd4sFfXYL27s=; fh=Nk/0tMRLb8D+wJo4Zmm3v7/GPXN2K9PAwHUJV3gzhLs=; b=gjmUKutmZUqGLvDtk6t9VFLqyMEPleR1Kvz9vYWOo+B+ODFZ3PvS4tQu4USAOEqAzs JvoAVtLeJ4DkORoHCLJqcdczc50XasLA9R+3xeZD96ZBIpSBMtVQ3KymOk5Y49mNdBA5 F+On+59+Pcva0sqN+SoP/aFwDQWwvWjootk0gkGcF9O+GfZ0VyyEoqLmN6DS3p5M77BR aWjFgVuDmkKsCFlLJbP2Kxny9LE9A3Q+4OSzgHqK9EyQ4BIdLUoi1kzgqF9zrV1TtZl7 sBDDsm8WKYDuD+CxKqub/eRWV5jn+z1h/dIYuvIu2iW+DWjFr/ee9pK2DmCWg2H/XhWH svxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BwjgVC7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ct8-20020a056a000f8800b006796dca10d3si19706741pfb.100.2023.07.05.12.44.14; Wed, 05 Jul 2023 12:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BwjgVC7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233463AbjGETD0 (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbjGETDS (ORCPT ); Wed, 5 Jul 2023 15:03:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90EFC1985; Wed, 5 Jul 2023 12:03:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2E845616EF; Wed, 5 Jul 2023 19:03:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DED71C433C8; Wed, 5 Jul 2023 19:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583795; bh=C29zaLc0+YewpaXSEH0HW42gKnjE7YUcBZ4P7Z6b8Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BwjgVC7Cbh9HQG2vDydlZGjLCZkcX1Ds3CLZ61K/xriTZaI/1UBNBiDzxP+g/dIZB Z1b9xp3sy523k6IzA0saIP3vpzd2L1B4S325qj1QrjG92VPEgqhl6mxOiyELZ2DqM8 OREJCtRhqTLktGuNCrpzYO/VV2b9RmtMCTbA6+UzGIMzOwW9Iel67mauV7xvmtiGiM McJ3467i8G17Xwv2uQ1SP2RdJGHk3OTuiK55GkB144F4uQV8kGRbZme9vY+WHZ6hww 9lU1DH4+FoNn400oj2U5B9F2VN6u9FxOY28tE9cjuCXHgVDa4fPKe/PQZDbGfgcPfh GlYx1XFDP2Qog== From: Jeff Layton To: Christian Brauner , Namjae Jeon , Sungjong Seo Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/92] exfat: ensure that ctime is updated whenever the mtime is Date: Wed, 5 Jul 2023 15:00:31 -0400 Message-ID: <20230705190309.579783-4-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611035954777957?= X-GMAIL-MSGID: =?utf-8?q?1770611035954777957?= When removing entries from a directory, the ctime must also be updated alongside the mtime. Signed-off-by: Jeff Layton --- fs/exfat/namei.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index e0ff9d156f6f..d9b46fa36bff 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -817,7 +817,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = current_time(dir); + dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -825,7 +825,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) mark_inode_dirty(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = current_time(inode); + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); @@ -979,7 +979,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = current_time(dir); + dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -988,7 +988,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) drop_nlink(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = current_time(inode); + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); From patchwork Wed Jul 5 19:00:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116324 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2091605vqx; Wed, 5 Jul 2023 12:32:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5csgWtQL3RPt49oHDJnoZLlRGvVbvKmieLVyXMIoXK4DE97mh95Knop3z41Q/lrjGMGrs8 X-Received: by 2002:a05:6a20:8f0f:b0:122:b613:8b2 with SMTP id b15-20020a056a208f0f00b00122b61308b2mr22181446pzk.0.1688585528695; Wed, 05 Jul 2023 12:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585528; cv=none; d=google.com; s=arc-20160816; b=SWuusS2vP3mV3V8cWbuxOwn6tyTRGn3yCPVgfTNOtTahz3vAYLMxvsKkZ38MGuzQbe kFdV+MU2K2IIgFUJXf83EwS85IQijRZyvr9KHuCp7PcIYiN5w23GP8oLgXdWMJHtLiXV 3BZ5ekc9Qd9UJZN37T7eyyXvExhK/Nyv3aU30RneEZPTZQX/Pv7RG7GFVu6cCd65mMg4 IwCO7m5tOBR82Cx81IpWIO0ScYpcJQI1N4567VNvZ2gdbiZ9kleyA63ITKpuPQfufF7F ZRpNGa/tdb8v0KWyJoKfJLsRrebEkmHhCFIyq/PH6AvFSWVUWR/CvaikSN35xlawxep1 yeGQ== 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=0465mhOC1dB+gajZL+EfTSFPL5DgDV6l/MiABeA6r0A=; fh=Kc/Yi9ULky76Bvw8G88y52WdFbmBuUWyAHoq+9u/0QQ=; b=aiC9QxjIVpMTyTYgN75nFJVx+NBz76zFrZkqTyf+r2riv9zCLeqsDrXvrH/TMjWygW CnnOFsdByWTxVYGKyzqzbcTYZBgWMRllLQ3udUfvVt61i+nSiQ0OxQbQt304OGwqnOne L2mysNGJA72xkCjeiUzsCfBpjS5e57c/N25795s0kHsGo3cREtNo3fGNdZO3WHMUvowJ oDQ5s/oxfpes/pwMHpn9uEfs1m9+qbaW0H2tD7F/smTVT8gT+/bzcLcRBmBlqLQe/XAp WucLOCQQ8vPDipZwPmAJbKw9jALeYYj48WRaMj3oJI1Y6BHHuGnqR7IXoEpfmXqMGcY4 aBew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nHRmfAFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j62-20020a638041000000b0055337ca9cefsi24680167pgd.857.2023.07.05.12.31.53; Wed, 05 Jul 2023 12:32:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nHRmfAFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233488AbjGETDa (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233429AbjGETDU (ORCPT ); Wed, 5 Jul 2023 15:03:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805581989; Wed, 5 Jul 2023 12:03:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0EBAF616EC; Wed, 5 Jul 2023 19:03:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A5B1C433C8; Wed, 5 Jul 2023 19:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583797; bh=+uSvE3e5ye7FfXdRduYnM950dEjKVs4JL0lbLQl6+aA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nHRmfAFCK2CDsQX39XN80sxMtmLR2cyM9QdVxuZU+mNJtHJNTpkluf86dZUHb3oZm VREay/ivmBMjXnBEdj8RlyVihmjXYqcSE0DACGVRSkme/DOPZ4DVpsRHhFX+65f7/R MCx/3+lO10b8UrW30Wh++8L6I7bMXq3ON8vL+YcHkgSn2M9qEOGbH+t7YIc1H89A7n 41VwFuVjYESB3h80f7qBU6V9upZw+mr7gpbmI/Ofon98PaNR899XsdTdvwtmCu9e9u yAuCc2hZXFo5eG/TQgJ6eIetyxWH0SB8/Rw3nPincepwzoHaHJXc1Se4CiBma6fsuB T/CaTPyej1ctg== From: Jeff Layton To: Christian Brauner , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH v2 05/92] apparmor: update ctime whenever the mtime changes on an inode Date: Wed, 5 Jul 2023 15:00:32 -0400 Message-ID: <20230705190309.579783-5-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610259318131219?= X-GMAIL-MSGID: =?utf-8?q?1770610259318131219?= In general, when updating the mtime on an inode, one must also update the ctime. Add the missing ctime updates. Acked-by: John Johansen Signed-off-by: Jeff Layton --- security/apparmor/apparmorfs.c | 7 +++++-- security/apparmor/policy_unpack.c | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 8e634fde35a5..3d0d370d6ffd 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -1554,8 +1554,11 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, for (i = 0; i < AAFS_PROF_SIZEOF; i++) { new->dents[i] = old->dents[i]; - if (new->dents[i]) - new->dents[i]->d_inode->i_mtime = current_time(new->dents[i]->d_inode); + if (new->dents[i]) { + struct inode *inode = d_inode(new->dents[i]); + + inode->i_mtime = inode->i_ctime = current_time(inode); + } old->dents[i] = NULL; } } diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 694fb7a09962..ed180722a833 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -86,10 +86,13 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) data->revision = revision; if ((data->dents[AAFS_LOADDATA_REVISION])) { - d_inode(data->dents[AAFS_LOADDATA_DIR])->i_mtime = - current_time(d_inode(data->dents[AAFS_LOADDATA_DIR])); - d_inode(data->dents[AAFS_LOADDATA_REVISION])->i_mtime = - current_time(d_inode(data->dents[AAFS_LOADDATA_REVISION])); + struct inode *inode; + + inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); + inode->i_mtime = inode->i_ctime = current_time(inode); + + inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); + inode->i_mtime = inode->i_ctime = current_time(inode); } } From patchwork Wed Jul 5 19:00:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116307 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2083004vqx; Wed, 5 Jul 2023 12:15:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlH2TSWY+AtlcgVcwR5vifO/ydKWIk6ZSytnURwQhYbQbGPmhmgQTMEUQPull0hy9zguQ3DC X-Received: by 2002:a05:6e02:14c5:b0:345:bf10:4010 with SMTP id o5-20020a056e0214c500b00345bf104010mr64043ilk.12.1688584519403; Wed, 05 Jul 2023 12:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688584519; cv=none; d=google.com; s=arc-20160816; b=taxcxb3waaXCfZayIVXTrQpLJOzTnW7A5r89RMHC97lM/N0ajqCYdCKi9TUVA4vMDK 6QPorbtiy0lCE4Y3ktxZYS9n22WTSJ4Piu5okLrrtkZVMpodIn1PEnTndAqrz3EKMvqE 3UGPh2VmZb+M4aTQ+yrjyMzvkc2QFU0EwmKETEFjxaI9O29ZTPF9AD7/UHmgtxTMjqw8 KqvgKtFwah48xUpS7yisMZ0iFTdDssBlJZcI2EsWCYDQzmG4vcZ1eaGRn752KXZ0AAeJ kRWO2fPoIkL1mdzCNdEuRGARLLQhqc83RTalehvaRcVtDArPeACYb2jM77vAwHVi6D5c AtXA== 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=8T8+NSX7bDEhf8RGg0k1fsoDqEa1IlRejydP1SKXk60=; fh=oZBkGLGxLa12UvCOqW6OqTg+fFLuGFOGuObjtaECCwA=; b=qVeBQshurQfNqSyVdwV2LcSV86oh5etKoIaCywPd8yBXgZCftFvqAynsIReDT88Cu7 qQowTTbUez4FIFvDEZ8FowzBHsQvLZRxWJEv0unAPjReUH64OGqYFIV6pAPvDz7tIzeY RAJj7JwbRrmbeIJtPYBXLL0Uwfr9wIez8SfmlPJMbbyZIAEuS4L6fDAYOSOIxFipdkGF WUAw0ZQ91m/4ihitKnhoNrsXnW5Bela6TBROyvPcYD4t6Yp5uwD2i7z0IfF9joLOE1Kz JJVEIfNb3eSbdPq15Yh+ZMgcSxMFpP+5uwKKto0im7bsyFF+amPkEFnWcrqRzxv4JsPC fwUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pM+4NH2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 16-20020a631150000000b005573bd5addbsi23987628pgr.446.2023.07.05.12.15.03; Wed, 05 Jul 2023 12:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pM+4NH2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233473AbjGETDd (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbjGETD2 (ORCPT ); Wed, 5 Jul 2023 15:03:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69D081985; Wed, 5 Jul 2023 12:03:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D2762616C4; Wed, 5 Jul 2023 19:03:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35903C433C8; Wed, 5 Jul 2023 19:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583799; bh=Y/meLmwCWNAsn5J38ZDDhtkdnkG182kUzNf/PHgf2VI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pM+4NH2Mids4CxpLS5rSap4VcC4ygdGDr8BXUIqOTu8qDZ0KNP0PhUxrSYwjdG2tm TNg4o34B2caVF+Ipkq7ZskuLUN6XwbobArABtlRZCnHavfYBUY123MGBOgOYAqMicm ixxlWo8iaZ0xg49JGuSmrCF+oLZjIFCcD6BahO8Dm1kEIng0qGhfSs1OcTyf3FIBP+ K58HB33IflEhe5BayuDCKNhAkauNUNi4cZHi+QBXYbcMFQtLMEHJcLrXwMULmPWdRS oShNaFMagHkUpIx06ahi+hey20WIelFocVARFoSJuFKOfrj3dq9czS3726+0xGw5jl 4acVjPoiSzdxw== From: Jeff Layton To: Christian Brauner , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH v2 06/92] cifs: update the ctime on a partial page write Date: Wed, 5 Jul 2023 15:00:33 -0400 Message-ID: <20230705190309.579783-6-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609201003615070?= X-GMAIL-MSGID: =?utf-8?q?1770609201003615070?= POSIX says: "Upon successful completion, where nbyte is greater than 0, write() shall mark for update the last data modification and last file status change timestamps of the file..." Add the missing ctime update. Signed-off-by: Jeff Layton Reviewed-by: Steve French --- fs/smb/client/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 879bc8e6555c..0a5fe8d5314b 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -2596,7 +2596,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) write_data, to - from, &offset); cifsFileInfo_put(open_file); /* Does mm or vfs already set times? */ - inode->i_atime = inode->i_mtime = current_time(inode); + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); if ((bytes_written > 0) && (offset)) rc = 0; else if (bytes_written < 0) From patchwork Wed Jul 5 19:00:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2093153vqx; Wed, 5 Jul 2023 12:35:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlEA7odqu5pJWbg0rxrC9gwiLDW2cEDtnQg0yHsi4qe+REIVFftr1T6C5H9jSb31IdM0BGWG X-Received: by 2002:a17:90a:ea81:b0:25c:1397:3c0b with SMTP id h1-20020a17090aea8100b0025c13973c0bmr10712922pjz.37.1688585717927; Wed, 05 Jul 2023 12:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585717; cv=none; d=google.com; s=arc-20160816; b=fQz3da5xQsTIDpZwoyQdLl/7PmT1URAqM6i+V95YXeuTvCKWXNSUT/Lp2dEinOidAf p6uwZEtBB+EaUFRayNfbKFnT0/A2Rg30Uk6Ka0WL7GMFXJchVbc252wwz2b4GnfFW8Ne ihi8dYBM8LZNXBJdF3UHYFCBIiC25osj4fa/uzzbF5Kral0rNLb6t7TOb3PWmBPAw06Y BUaZn3JhQGVvE/IHXGBO2f4EwW5rYkRwaVEn1fNz2rpNksiQAsIZW6q+TigmLW4gpZ3j 38bSGAWhffo8Baq6ZB6PRjLbEuqppg2S56A1qMsclFtCBNczLHKW3Yl09Aest6DToAZ6 jZGA== 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=Hd980AZETFfDMDy2biVhqya6Rm/PfsJ/mzpTqFPJGdU=; fh=+m02MSv56yOKV/hJBHUvILXEeWhcMnvNeC2jSpXhgRA=; b=U+nxaVG4dLPPU9rUDDAgPwpyTGMdjXemgxpOfeE5amFojiBPl1FmALZ9JDx7NHJWiP GVmBtJA48pHeLU/fPo67mdR3GOyrQsVwZCdG/dzgt5gzD00bUQ3Oyg8VFI1hzr+WMMsK HnJGFAvEzORgRdhTdyamYtTjIG41DGwNALWu2ZqRUcxpr5z0eI4aSLzbDLBjZYuAp4iO YeVHDRFW0H582yoHyrNLbGMbScZogg6gYe6YvFVjZyamir8Tn7JABXJJp6IA7GIG4oN1 Qvgn1DX3B0ChNboJXzZePRGY1k/SslCvohhctvMtnRKw62ZVcLJ3pcaHUIOPNtw5aSa8 smog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lkxHgeA4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb7-20020a17090b4a4700b00263f6368c25si2113996pjb.146.2023.07.05.12.35.05; Wed, 05 Jul 2023 12:35:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lkxHgeA4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233528AbjGETDm (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233476AbjGETD3 (ORCPT ); Wed, 5 Jul 2023 15:03:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2B6D1998; Wed, 5 Jul 2023 12:03:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6FAD0616F6; Wed, 5 Jul 2023 19:03:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06436C433C7; Wed, 5 Jul 2023 19:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583800; bh=JfqF6OJj+HPavYNtUdzWAI51yxDXyrTo8JOXu9AcCz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkxHgeA4voFsFMFla2p6qkW8yPOEMKMKR0zZJ8jlO9Cyavlyb1ouSHm1QL8K8dTyj 768qxlKoDk6ABTkxd3qI9e2MNWV4T56aGehv1rZY1odO9iIp9q/AsXKpqR5sLntxpD vl5P7suP5A/jX/WbdlAL+v7zDeN1JeuSYps8D7D6Beqf3VyYJrGCXNOHOUYLXtKJPN lGj5BnQpVh9DuE/c4zBuDNLub2DKH3IccPj8CzQMfSOSEe/NEVSNp+4h/sTPphs8JX /iUVvfIK14HHe4A/U8GxZzzHjBnpg1cuxyYGytJMYpkggFKudXin9FaEKZTFdMnELZ InQFpJ7+YeVgQ== From: Jeff Layton To: Christian Brauner , Chris Mason , Josef Bacik , David Sterba Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: [PATCH v2 09/92] btrfs: convert to simple_rename_timestamp Date: Wed, 5 Jul 2023 15:00:34 -0400 Message-ID: <20230705190309.579783-7-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610457705208657?= X-GMAIL-MSGID: =?utf-8?q?1770610457705208657?= A rename potentially involves updating 4 different inode timestamps. Convert to the new simple_rename_timestamp helper function. Signed-off-by: Jeff Layton --- fs/btrfs/inode.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 601fdc956484..521c08b8ad04 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8778,7 +8778,6 @@ static int btrfs_rename_exchange(struct inode *old_dir, struct btrfs_root *dest = BTRFS_I(new_dir)->root; struct inode *new_inode = new_dentry->d_inode; struct inode *old_inode = old_dentry->d_inode; - struct timespec64 ctime = current_time(old_inode); struct btrfs_rename_ctx old_rename_ctx; struct btrfs_rename_ctx new_rename_ctx; u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); @@ -8909,12 +8908,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, inode_inc_iversion(new_dir); inode_inc_iversion(old_inode); inode_inc_iversion(new_inode); - old_dir->i_mtime = ctime; - old_dir->i_ctime = ctime; - new_dir->i_mtime = ctime; - new_dir->i_ctime = ctime; - old_inode->i_ctime = ctime; - new_inode->i_ctime = ctime; + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); if (old_dentry->d_parent != new_dentry->d_parent) { btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), @@ -9178,11 +9172,7 @@ static int btrfs_rename(struct mnt_idmap *idmap, inode_inc_iversion(old_dir); inode_inc_iversion(new_dir); inode_inc_iversion(old_inode); - old_dir->i_mtime = current_time(old_dir); - old_dir->i_ctime = old_dir->i_mtime; - new_dir->i_mtime = old_dir->i_mtime; - new_dir->i_ctime = old_dir->i_mtime; - old_inode->i_ctime = old_dir->i_mtime; + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); if (old_dentry->d_parent != new_dentry->d_parent) btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), @@ -9204,7 +9194,6 @@ static int btrfs_rename(struct mnt_idmap *idmap, if (new_inode) { inode_inc_iversion(new_inode); - new_inode->i_ctime = current_time(new_inode); if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { ret = btrfs_unlink_subvol(trans, BTRFS_I(new_dir), new_dentry); From patchwork Wed Jul 5 19:00:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095911vqx; Wed, 5 Jul 2023 12:41:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlFBhMle/iugvSAmB3BGAimWKAKZl3uYDNqheX73pyXUQ5b8Sx39sBUImOZHFrjpP3V+VbVt X-Received: by 2002:a05:6870:e30a:b0:1b3:7e8e:2b1b with SMTP id z10-20020a056870e30a00b001b37e8e2b1bmr14273438oad.34.1688586084260; Wed, 05 Jul 2023 12:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586084; cv=none; d=google.com; s=arc-20160816; b=M+civEVA3ZisD1zqoqJy08nBLw9DIcNOiVJqXUZBFWwKuwzJNU402Jhfh8cBZtitoa Qc+qJe78XwT5UVpfTjTBiiilR7zP1pXhIFbxEQq+d7i5R5T/EIGs6Jq0UoZIrZtFJGPn zxxNltifKq4aPzBsUFQ1oazkcXiXIowS1prXAGYQ5lsDwt9PjJFYO8U7OyQT3KEcsMaf hzQWcgtMwn0USD7kVHg2DK0OfAySnda5sLlcdJGkOfNZmCMU789Rishi/SAntjnnOMaa TWgOzqMHB+WioOpMHlCcJP3HDlLwB6pJB41bc/9I863GeL5oRK1oYVpqq5FQt0U5Ecse CXRg== 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=8Ssa5BFBaotn67tU9LP9BNcL9E4TvvWBLxGHxw/lMtM=; fh=MYHhJWcCrEI17NrYhhhi6DAK8KszBjyyGgT2rjwDsi8=; b=Lj5B3UbKbjIZ5wDRgI+M5AfTy3gny/kmhTvptbiUlRLN0uExnY8LSH9wl4MrqYZ4vQ P6rI+nPXlSLiNkZPN+IsKFdsN1/kmDIGFxseWLYbBK9HzcqMcK4NnbjcgO5xd7PnJo88 kKtpbioq6E7A+rKiZWH4ZA0xhNAK3chBvgkIG6/Im2NJagjP4fKc+0I+gTyB+KzXwxG0 PlRYYPB5aGbbN17fx2z3Gf38qtL0L4RKJanRF03SjQ1cfu6ezoOJUbqu8ycd2nZnOw36 xWryMQs7NyQMk65zZcZ6YFTbp09Tcw+x/G8JlrwwwaXW/eu+gTLuL9yrkdkedEaePpxq J2sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YeMu90xY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bh21-20020a17090b049500b002637d779bf3si2251534pjb.17.2023.07.05.12.41.11; Wed, 05 Jul 2023 12:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YeMu90xY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233498AbjGETDt (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233484AbjGETD3 (ORCPT ); Wed, 5 Jul 2023 15:03:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 000C419A9; Wed, 5 Jul 2023 12:03:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D3F20616F9; Wed, 5 Jul 2023 19:03:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94634C433C8; Wed, 5 Jul 2023 19:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583802; bh=xf8Hi6LLQ8Uft364NbD0ve0c8ZqVR4Xzt1FbU/Spvec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YeMu90xYX+J/DSpr4IEpPdjE0VhxjToh+dxnB6lIUKKzFPcDwLtfLqKprheME36Au GwtAsEj1J48EJ+u7bhE8nllzBjY6eaN33Z7CFu7g9eBJBejJ9bJayxiBj/WF4aqxR1 ev8b72N50v378o9db6zZTHiX/IHmwUKC2RbwSvs+YbfDWVAWa+2HfqyyLEdQE8H6hH sLvE6sIM7+NfFVYFnqbPdsVR3GGg6Nd+De74SfHuZRvzgUXYOA3NicY4g1GrO+AubB x9RH15V52pkaLIQ5VhK+BEDjWAP0FZpk8dpHisGouC+BG+MA2V60Iplhx1Vt2GRlgB 4+1tVVOQCzaRA== From: Jeff Layton To: Christian Brauner , Richard Weinberger Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH v2 10/92] ubifs: convert to simple_rename_timestamp Date: Wed, 5 Jul 2023 15:00:35 -0400 Message-ID: <20230705190309.579783-8-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610841773023405?= X-GMAIL-MSGID: =?utf-8?q?1770610841773023405?= A rename potentially involves updating 4 different inode timestamps. Convert to the new simple_rename_timestamp helper function. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara Reviewed-by: Zhihao Cheng --- fs/ubifs/dir.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index ef0499edc248..7ec25310bd8a 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -1414,8 +1414,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the @i_ctime for inodes on a * rename. */ - time = current_time(old_dir); - old_inode->i_ctime = time; + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); /* We must adjust parent link count when renaming directories */ if (is_dir) { @@ -1444,13 +1443,11 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, old_dir->i_size -= old_sz; ubifs_inode(old_dir)->ui_size = old_dir->i_size; - old_dir->i_mtime = old_dir->i_ctime = time; - new_dir->i_mtime = new_dir->i_ctime = time; /* * And finally, if we unlinked a direntry which happened to have the * same name as the moved direntry, we have to decrement @i_nlink of - * the unlinked inode and change its ctime. + * the unlinked inode. */ if (unlink) { /* @@ -1462,7 +1459,6 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, clear_nlink(new_inode); else drop_nlink(new_inode); - new_inode->i_ctime = time; } else { new_dir->i_size += new_sz; ubifs_inode(new_dir)->ui_size = new_dir->i_size; @@ -1557,7 +1553,6 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, int sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir); struct inode *fst_inode = d_inode(old_dentry); struct inode *snd_inode = d_inode(new_dentry); - struct timespec64 time; int err; struct fscrypt_name fst_nm, snd_nm; @@ -1588,11 +1583,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, lock_4_inodes(old_dir, new_dir, NULL, NULL); - time = current_time(old_dir); - fst_inode->i_ctime = time; - snd_inode->i_ctime = time; - old_dir->i_mtime = old_dir->i_ctime = time; - new_dir->i_mtime = new_dir->i_ctime = time; + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); if (old_dir != new_dir) { if (S_ISDIR(fst_inode->i_mode) && !S_ISDIR(snd_inode->i_mode)) { From patchwork Wed Jul 5 19:00:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116311 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2087560vqx; Wed, 5 Jul 2023 12:23:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEZJzCAF0PgqDFSPDrL+OpcqspowTctpwPdEHNygaRiVslvFDQV0lH7M3Iio4frQ7Hlhd5o X-Received: by 2002:a17:902:aa47:b0:1b3:b84b:9008 with SMTP id c7-20020a170902aa4700b001b3b84b9008mr59449plr.5.1688585038242; Wed, 05 Jul 2023 12:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585038; cv=none; d=google.com; s=arc-20160816; b=F7apRNaL8V9JcmEKFzWjvSNi13tHZlG8lTLiEgm6NdEF8Z7LwD7txhuchncJXuQ/sJ 7V6mi06tCnRnUhXn5WK9cMm6LHGl3HmDNMRLbXQy+NvrQbST+2eXzEo6GvDtASdR9PtR dAA4JggGiE3iMl3k0R1PlxXXQ/LOyPxGbm/7dePKw0Qi8x0snnr7OSyW4gybPVokRhhT 7/DXqKe0iafBw2ZDsxEE+2XbNbcaw508om3AV9ntBddXJgmyN4l3AybZbYHpnXUOywOy xfPQK1KcM2m26IzfAV0R+yDgzH+KyeG957EJBr6Ueps35TkhCSnPVV74/lNiDx7hIoUr Up/w== 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=xKAUX1gAiGeMAe4hDD9pQTq1NUzFHWrVLxy+KkYN7Hk=; fh=F0TBjGtdr07rIyL2N50xNH5K7Dnohp0JfmFjEcpmwnA=; b=HUb2YJvNPB555OW2uqwFEsBCsCpQMhKDB+O69j8dMxt4SgXeVUVsAmLZv4PrEzX6Bx 5bqmugzIEngbyDaA828sdhXuDoGJnswld1DBvFjaO4HIckHMIAElc9IEtU7/3U+/9quf ajQbw+w37RyCBZ/QNzGRRGNvHZ8JhQ697oPZRMbIlOjzQ5ogg9oG6jrNV4sbdMdNYEut FBKlc/CewQxsrdL+o+R0BGm8vgTaPc9NpuWx/NEhNkj0G5RUyqCgWbBunEJoeYjzKmcF HtktahdGTN2cZB2gcn1LrGsBMLs2vsAPR0a3UJKgFBDvX+q6/pa9udZuQUBC4b/JDvBy qugg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NJB7XRGZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a170902ce8400b001b8819c1baasi10608555plg.592.2023.07.05.12.23.42; Wed, 05 Jul 2023 12:23:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NJB7XRGZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233588AbjGETDy (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233496AbjGETDb (ORCPT ); Wed, 5 Jul 2023 15:03:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815A119BF; Wed, 5 Jul 2023 12:03:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5F6F8616FB; Wed, 5 Jul 2023 19:03:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03D32C433C8; Wed, 5 Jul 2023 19:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583803; bh=L6EzW1gN0+SRZxIErz0sW6Tb73or6lNTvn+UvQ+UhLc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NJB7XRGZ9/2aNYHQfjzBlRCDmmvV+Ti6HLP+oIQ9g5KZrdjQjm0y+Jhl8rdVoiCqG yNAQ8W/mgqYsGvz9nBNxe8BJ21A3QMuv0zJQYxL9guo6asboijEkgDeRQSrBfSig/p y3um6RHGyvKy2DmOpaWHlvqNe+TYIVNtPu4I/5h85aojGvgO6+zM0Ewv62AZ5sItYJ BGFhUukmOesc8UyqgAF96u85MDN4IqtfnbWGFTIJ63/U+8my5inkcImSFEKNDrDBdG voaAhfGJLsCJB7IlrDCNOmZcmkHZs+5FZ8A/Dag+FPXM+vt3V1xLIcdts0ws7Ae+oa roSY/5/VnBDgw== From: Jeff Layton To: Christian Brauner , Hugh Dickins , Andrew Morton Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 11/92] shmem: convert to simple_rename_timestamp Date: Wed, 5 Jul 2023 15:00:36 -0400 Message-ID: <20230705190309.579783-9-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609744889435544?= X-GMAIL-MSGID: =?utf-8?q?1770609744889435544?= A rename potentially involves updating 4 different inode timestamps. Convert to the new simple_rename_timestamp helper function. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- mm/shmem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 0f45e72a5ca7..1693134959c5 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3306,9 +3306,7 @@ static int shmem_rename2(struct mnt_idmap *idmap, old_dir->i_size -= BOGO_DIRENT_SIZE; new_dir->i_size += BOGO_DIRENT_SIZE; - old_dir->i_ctime = old_dir->i_mtime = - new_dir->i_ctime = new_dir->i_mtime = - inode->i_ctime = current_time(old_dir); + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); inode_inc_iversion(old_dir); inode_inc_iversion(new_dir); return 0; From patchwork Wed Jul 5 19:00:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096393vqx; Wed, 5 Jul 2023 12:42:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqmxbQ4aytocLT8GJVLbr4rjCLgbndn1LjRAJAmotoySqXsPPAPnTGtEx3Y3rdJLX0BkTF X-Received: by 2002:a05:6a00:a10:b0:682:b6c8:2eb with SMTP id p16-20020a056a000a1000b00682b6c802ebmr2547663pfh.1.1688586144674; Wed, 05 Jul 2023 12:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586144; cv=none; d=google.com; s=arc-20160816; b=WMcYWQo3Ohxb50XoakH9YE9nQ5DwlBDWEfCtevREQ6WweobjRsWGU2U3I9x7l8l2ds 58UCZyYduQxxqOWImTUBpLuS1W8JWufcfCbIPRiKzB40nkRoILL5IgQN4WE6R8DMspT4 G6PAI/N/xKGlZ+RNwit/E6OkdERVqSywoExSIK2ve4gkRNBgmzNBnR287mjXMHYByN34 1HdNnEIWBwzvvX1z+0Z+ZTaAtG8lydrfO/N3Pl/sRph6GAO5+izzUJCO7f/yl02adt+1 vVgYBoZVkdLPk4kgD4rSDsJwCNCCwd/MzLpt7/5eJsEgdx22WgNfpRwqzINHY7eMYMIP XX+A== 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=kTcn6PeUAQVRDy6dYWBUimmoT6wzp+NDLDHnkeFcdKY=; fh=Nk/0tMRLb8D+wJo4Zmm3v7/GPXN2K9PAwHUJV3gzhLs=; b=AgQa1Y2kCD5kZ0wtClR+hIxbl2n2VOZvib4MNdvPjVg1BsqD+psZakP0Z35hjByU3V MRSkoX+DeMiwYvspnBD82zol8cSlGZJniH+2GSH6+LmME1wDsvMPlMt4rjknnc+kmkss ewt3lJEaGUSKObMDthjBB3n8iGlmkqTAsOAhL9W7+20dW5KUT09kydQAxsRcVRePYWn/ 2ckSYXpxYNldIfumYWlSk3NBjZtRRw63wEZXDhqrbCv1AkFvyPYP3r2e29AF71tiMIf1 SE4etk/GuqjdrvRcs+71FSiJVjmdW8OaunChRjeguOm51oOQkv3UaBURnAJV1KFdv58N L6mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=StuSvgMi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cp22-20020a056a00349600b00643c4345942si22565759pfb.134.2023.07.05.12.42.10; Wed, 05 Jul 2023 12:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=StuSvgMi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233593AbjGETD5 (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233499AbjGETDb (ORCPT ); Wed, 5 Jul 2023 15:03:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 262EA1BC8; Wed, 5 Jul 2023 12:03:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B9C3C616EE; Wed, 5 Jul 2023 19:03:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E5FBC433C8; Wed, 5 Jul 2023 19:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583805; bh=J50IkY8hwE4QTdi0JMbfyXssVuP1VqMJJNGL0hjOLIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StuSvgMioLeO2MnU4FKLpR57Lq9joplYJ/hH+vDNtOQre9Z2gxqUVPf4nO7z3zuqP Sejb0izI8q7txVYTFwFQ2gcblCAas/UBidU3vMW/44Ahvb68XOP7WQts7Y29V5MFcU 7CBQfeUGYUibnKvuI3WmZaI5AVxSbqLrXI4hmaJYfHNVCXbxXiH0LFbCQKdtSNgChI 7XMQo2YOLiS1XfVbPoBjKz1S4ll5bj0+U4m+arMmGWMkbX2WZsxKY0Pw5wmmaDuhs8 0ilLHK5yFYLOGERBrQWqD9v9VEHhqGW5fq1XyK83ge5awm0gY5s9nfh9DbP3jIWlfi Oqfz8Jt7zb4lQ== From: Jeff Layton To: Christian Brauner , Namjae Jeon , Sungjong Seo Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 12/92] exfat: convert to simple_rename_timestamp Date: Wed, 5 Jul 2023 15:00:37 -0400 Message-ID: <20230705190309.579783-10-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610904931507106?= X-GMAIL-MSGID: =?utf-8?q?1770610904931507106?= A rename potentially involves updating 4 different inode timestamps. Convert to the new simple_rename_timestamp helper function. Signed-off-by: Jeff Layton --- fs/exfat/namei.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index d9b46fa36bff..e91022ff80ef 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -1312,8 +1312,8 @@ static int exfat_rename(struct mnt_idmap *idmap, goto unlock; inode_inc_iversion(new_dir); - new_dir->i_ctime = new_dir->i_mtime = new_dir->i_atime = - EXFAT_I(new_dir)->i_crtime = current_time(new_dir); + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); + EXFAT_I(new_dir)->i_crtime = current_time(new_dir); exfat_truncate_atime(&new_dir->i_atime); if (IS_DIRSYNC(new_dir)) exfat_sync_inode(new_dir); @@ -1336,7 +1336,6 @@ static int exfat_rename(struct mnt_idmap *idmap, } inode_inc_iversion(old_dir); - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); if (IS_DIRSYNC(old_dir)) exfat_sync_inode(old_dir); else From patchwork Wed Jul 5 19:00:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096717vqx; Wed, 5 Jul 2023 12:43:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFE7iZ/BxHV190iT2CWI0WKtbov1L8voAwQnZWLcV1kRW57LCNYrSBsl7Bz7NjPRURw2xxq X-Received: by 2002:a17:90b:2d85:b0:263:41d2:4e2 with SMTP id sj5-20020a17090b2d8500b0026341d204e2mr19186665pjb.32.1688586191715; Wed, 05 Jul 2023 12:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586191; cv=none; d=google.com; s=arc-20160816; b=gfaZ3oCPFcWt7vkDQaeltOK9dnuroYMMLq3YEObJiVigppgl/ahuGk8yoirw6PmbRX nLHL59ufwHGK9tMhuAaHn4IW1Aoy6Q4hQciXxGUDvV6KwQPRqiLGSuFI7HLg1oYDvgL3 I/NykwwbOxQAGWgNZr9DXu2LJTjsrngfQrLy/ryt2KwW4aU9A/h8tK5H7BeXUTWCjkMA +nCgnBqdod7JCqgGVnpysogHpoDLhcRdRCH6zIU5WWayCOhVD3D8jMLCsI6ovTa3yuxS dtbpDK5dcqvVgN6BqVrAsZ/NDa4uA307PEkoniMrDGx86o5FATPFb18cRN7AWijD+95M JmyQ== 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=M5FW/F66bvyKFLpjw1TbrFQIWywvTTH+LBmWNl+PqeQ=; fh=a2nSgsxONiLj1B9nNktVMJ5k6St0L0Gvr77jdE9s2SY=; b=BmBn6k3g5qSwW8AGEH8eVhesou0xHyXfXDhLNShDfPTflFrjn/+o5/8FNaqV2Zdc03 Kqg95o7pgHGzJrWWXG+6eTLiyq4Wg3zj/X9UFHPirhQthVUfYpFs5/57DL8Nf7XzsHhH ZodLEfp0ZrZ2O9VLZIIhoqS/2ZJeIllsfnLXUkaGBwKL6Zy+xYE4BOw0okxoFaWAeXF+ hFzA8eWusA7fiA6TrIpp0iy3r8kfkjaFF7zMazCjYp1h9w6bNT56IzejXqP/ugXD6C6r vVhN0JH8jY22EK2maU4CnOtlYrFOgIcsR4dag4herPiWF3oLUG5/l2azEf7celsf64NT CTfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q5YkT3oK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx19-20020a17090af49300b00263cee680ecsi2290430pjb.89.2023.07.05.12.42.57; Wed, 05 Jul 2023 12:43:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q5YkT3oK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233630AbjGETEA (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233439AbjGETDb (ORCPT ); Wed, 5 Jul 2023 15:03:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B3C1BCD; Wed, 5 Jul 2023 12:03:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2FE6E616EC; Wed, 5 Jul 2023 19:03:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E482BC433C7; Wed, 5 Jul 2023 19:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583806; bh=TY45/qxVQy5GwD4MUK0nAW9hU9YuqFqdo4bjfCKVLWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q5YkT3oKssEYp1IZYAITd8OOV6yhElw19ZJxTOnXqApHyge3ImKYjoVO8TWQXVC7K c7wz+wwOGez5xi0rfzV5yW9ruvCLO1a86FBTYITX2YVrOGLZnpoH0TkpQ7YurobODP bMTyuKQVK1s0qZw7kBgqW4Msb5FnjM3IQp+IISwpBukKE2R6WN4zMwumL77K6gCc72 UvPHm3P6xYVpn7jS6rRwjHfbkX0oXETbH8Gliu+IZOO0lfvgkjFwDnJ9CoijLClhlW ecPkniQJCMr8yRDa5h8zbn2zqJzqzmHC+AezI9URr1qmySlFInP+u9RjTSrQE5jBun I4KkezId9Jn6A== From: Jeff Layton To: Christian Brauner , Konstantin Komarov Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev Subject: [PATCH v2 13/92] ntfs3: convert to simple_rename_timestamp Date: Wed, 5 Jul 2023 15:00:38 -0400 Message-ID: <20230705190309.579783-11-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610954318736745?= X-GMAIL-MSGID: =?utf-8?q?1770610954318736745?= A rename potentially involves updating 4 different inode timestamps. Convert to the new simple_rename_timestamp helper function. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ntfs3/namei.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 70f8c859e0ad..bfd986699f9e 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -324,14 +324,11 @@ static int ntfs_rename(struct mnt_idmap *idmap, struct inode *dir, /* Restore after failed rename failed too. */ _ntfs_bad_inode(inode); } else if (!err) { - inode->i_ctime = dir->i_ctime = dir->i_mtime = - current_time(dir); + simple_rename_timestamp(dir, dentry, new_dir, new_dentry); mark_inode_dirty(inode); mark_inode_dirty(dir); - if (dir != new_dir) { - new_dir->i_mtime = new_dir->i_ctime = dir->i_ctime; + if (dir != new_dir) mark_inode_dirty(new_dir); - } if (IS_DIRSYNC(dir)) ntfs_sync_inode(dir); From patchwork Wed Jul 5 19:00:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096345vqx; Wed, 5 Jul 2023 12:42:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/dfqVMNSHZxY6mVsTU/XfaMhScuEmMXq/VKJB238GTw61KWf3Kz7CPnIU1HkxzWRuqbjD X-Received: by 2002:a17:903:482:b0:1b8:a2af:fe23 with SMTP id jj2-20020a170903048200b001b8a2affe23mr4016plb.2.1688586138845; Wed, 05 Jul 2023 12:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586138; cv=none; d=google.com; s=arc-20160816; b=MzZEzaaAN27ZbiQ9UqfZEQEDWQhV09BCCeecBKgFWrdJbNPo9IB+g7kSUHBtbkYYN1 CdWP+p0qsNJ1vist9dk+1XvA2QFrgek4SDX5wAvM3G2Pa2dDSahf1GITeANK/OKAoXKv dbH1ViwQaXhtD72X8dRhZ1b2EGOi0IX7Jktjah5pTiUNvz3rXwELBt1TIQgGmruEAVgH npInKEo8ePnMc/LvWiRwhqw+gwXeK/58O3j+2q1Fh8m682BIIEsHn2R5yTNfVdeRGNIv qfyzIMZ7sxs99QD89Fx5kkh+Jgno/ZnyZX0twmuzVIDmtGQN4n2VVY+QVpdHKp93Yp5Y V2SQ== 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=TcKx+FY+jz8tesuIm8uOzWPTtB+TGIfDHDDr0QllQm8=; fh=k9Md7kD5M4QOXFHSJANXllokGqExl9fTo56gUgQi7Ok=; b=lbgCf6X5ZbB5nUfYZV+PTZYPlMnxGYm310aH3MwBsNUzwmjB5JZNOfdapq9UNrW7Kn 7WvaTnD7UoQSEYzlp3pN+bttzyUgoD3+0j4NlLobyuAc8a2GAyuZoUd5+KGoDGtJPSX1 nEc+AnAleGLeKDuHR3gv2pcnZufsilpYJDBipcKGuUCiZO26aWQdDlJ4tdagtRL3LLpA MJXnpHfZ6ZNz6cbF+gopk5DsVTtcwVZQmCrD3ElZdcquii0RtMtEfK6fJivsa6xWB70h 9Oo6pIUKViaK+DlYqUh5Cl0y5a6cA68+uT5RrwdQicKTkoxIHT0Qdq/tvWr5BbUuOyso TMyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WclbXEIC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902c40f00b001aff514a8f0si26020673plk.534.2023.07.05.12.42.03; Wed, 05 Jul 2023 12:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WclbXEIC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233638AbjGETED (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233517AbjGETDi (ORCPT ); Wed, 5 Jul 2023 15:03:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED6A31989; Wed, 5 Jul 2023 12:03:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7E553616EC; Wed, 5 Jul 2023 19:03:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5696FC433CA; Wed, 5 Jul 2023 19:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583807; bh=KWaqWqc/38Kzci3VQKWkRcd53CVOEuWovP0o19vIoz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WclbXEIC0F2OWeE3/SIvdzxd4Nct3v3+p/ewdhScqQHUiwA8kX38+2hiHQfoI8Kot JYAt41YVG5MshRIFOO1EnB67og4b0wfiWgj2rllg0DAdw9AFN+7Heqf+Q6Clg5O7gJ jT+9Z4YvmD9VM12ARs/oQWuKCZf9NicyhSkkHqMW5OakqQEJXdErLml+629OSIlBOb OlxNTnkYvBfaBB7BQAHf/CoSjf5xPk4deAmP4JYnykwrRAbnf0VSz208Zury3GcS5c oezB2tGru9AuPutoCjn0dLEGkg/3Ub54Ypx2O2zFdMc7IjSyWgz0P+zx0oZio7cKdD XU17wdH9xrQUQ== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, reiserfs-devel@vger.kernel.org Subject: [PATCH v2 14/92] reiserfs: convert to simple_rename_timestamp Date: Wed, 5 Jul 2023 15:00:39 -0400 Message-ID: <20230705190309.579783-12-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610898993391120?= X-GMAIL-MSGID: =?utf-8?q?1770610898993391120?= Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/reiserfs/namei.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 52240cc891cf..405ac59eb2dd 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -1325,7 +1325,6 @@ static int reiserfs_rename(struct mnt_idmap *idmap, int jbegin_count; umode_t old_inode_mode; unsigned long savelink = 1; - struct timespec64 ctime; if (flags & ~RENAME_NOREPLACE) return -EINVAL; @@ -1576,14 +1575,11 @@ static int reiserfs_rename(struct mnt_idmap *idmap, mark_de_hidden(old_de.de_deh + old_de.de_entry_num); journal_mark_dirty(&th, old_de.de_bh); - ctime = current_time(old_dir); - old_dir->i_ctime = old_dir->i_mtime = ctime; - new_dir->i_ctime = new_dir->i_mtime = ctime; /* * thanks to Alex Adriaanse for patch * which adds ctime update of renamed object */ - old_inode->i_ctime = ctime; + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); if (new_dentry_inode) { /* adjust link number of the victim */ @@ -1592,7 +1588,6 @@ static int reiserfs_rename(struct mnt_idmap *idmap, } else { drop_nlink(new_dentry_inode); } - new_dentry_inode->i_ctime = ctime; savelink = new_dentry_inode->i_nlink; } From patchwork Wed Jul 5 19:00:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116321 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090291vqx; Wed, 5 Jul 2023 12:29:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFNAY9L0kN5Dc84zvkC6A0rLViPnenLtHofkkk7zXrvQuwT6OmyoNoY9qaalLDuI2IfIgpp X-Received: by 2002:a05:6a20:7f92:b0:12f:8bf8:69e1 with SMTP id d18-20020a056a207f9200b0012f8bf869e1mr3003977pzj.41.1688585380335; Wed, 05 Jul 2023 12:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585380; cv=none; d=google.com; s=arc-20160816; b=vP6X5b7niQ/VyiPe/epwai7SrhyN98fUzNzQJO8qgs77byOyJL0D/GYic2oXATwWqs woOEBgOMrSyoCcumG+BEKpmwY6Bu7szLelmyz4Ec4ceVNrWdsdKx5ZjlMzrzb0uiVSO8 o0nAMWNhdrsCFDw+1zG42HdqDYFz1R0KyF9ZgRqfZZ3Yzrst8b6qQIKGQ7h6XL5LLqVB vfk0oETXaS+KUYM9g4j2/g4iPSyKTA7z1qYxeBOfMqvaQkBEkuKPwwvS9zR3uebRE4er xa2+vLNJoM2xrRmXI/T0E525qQrgSJogNn6LDB/c6W+zhyshkV5uM2uV6ylw8i8xnSdV m2JQ== 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=xXARUtHQ6T5/9YiFH4qHr2dD7KGZnJZRy/eMXlM+V98=; fh=JzH280tF8Ak50g/6ToTf8sERHkLANb3/2aUnEkuQptg=; b=KvMCbvIbKSeUSmcNCSpsmQWBhEN7KchTI/iDxpGwgofltdFQjxwxO/5J70aKAlJN/U ltTkNEM3x2mQGkVFP2LebpWIMDy1P4dMCk2Q7BXfRwuE72xgwIKOL6cFoEbLTXz6SBNa graGYErYnEmjYsPOCLxM+NAPS+XUwD4mq1WP53yTcOZZJiwvn+Lq/NFsIJxqnj+Uawze 4lAOXnHI3+Huu0orargelaSxn9wE3GlE4W1+23P3OzJyl/okC/7dNbUpiK8/dshXlhLT RsSxLgMUDD9UCpltHICpN9ozq2uP0RyxtVHXytxZynLi+jvCTZn8xDIOwOXepcLFzg2d n6FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p6kAsrLT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l65-20020a639144000000b0055be45c42d4si1320349pge.810.2023.07.05.12.29.25; Wed, 05 Jul 2023 12:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p6kAsrLT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233643AbjGETEG (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233518AbjGETDl (ORCPT ); Wed, 5 Jul 2023 15:03:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFAAA1737; Wed, 5 Jul 2023 12:03:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C626616E4; Wed, 5 Jul 2023 19:03:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7F7BC433C8; Wed, 5 Jul 2023 19:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583809; bh=hW90uH7dSdyF/Nri3HQx0Av6AkeVn1n99HlMWuhoknQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6kAsrLTw8OX38qd6i4pQd0M+hsaDTabPFxVINuCdQ4xhS2k+c1hdfnWLgFt6GgHW +yjJdVfQBF5K9TMxRNt7ga07vAxzJRlLknE2ux8YsmXHOQqCuI6waffLLuJXyk1/gJ 90myZ2C2Vgdq2KWqHkKsuK5wOeZCkFrnECC4J6+Nh7ve6XvsKCi2B1VG3m2mlX7eMF JvBnyss/OChDfLvw8Dxx521uTVcW8n1qbA6COWTfL/KgbQo0TXcTiRYHziAulEdyXa +o+qRoM2sgx3Jq6u2NcEck+Jow/G77bqQH3cykxTYaz3KAuVHOogrQ/4uCKSw8xLUV /eQALPLxJZX+w== From: Jeff Layton To: Christian Brauner , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 15/92] spufs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:40 -0400 Message-ID: <20230705190309.579783-13-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610103493646741?= X-GMAIL-MSGID: =?utf-8?q?1770610103493646741?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Jeremy Kerr Reviewed-by: Jan Kara Signed-off-by: Jeff Layton Acked-by: Arnd Bergmann --- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index ea807aa0c31a..38c5be34c895 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -86,7 +86,7 @@ spufs_new_inode(struct super_block *sb, umode_t mode) inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); out: return inode; } From patchwork Wed Jul 5 19:00:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116318 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090058vqx; Wed, 5 Jul 2023 12:29:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4eQaBlxicEltiZGL8UkZN/7KPxHagLmiw7eG4WcuGM0N52oYFPm/W8OvbyD28oUitnl0D X-Received: by 2002:a17:902:e84d:b0:1b8:5bf5:543a with SMTP id t13-20020a170902e84d00b001b85bf5543amr11632604plg.49.1688585351063; Wed, 05 Jul 2023 12:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585351; cv=none; d=google.com; s=arc-20160816; b=AORJATfVGIZSvi+uR1X8MAK7pN4x8giwfxBB0itX/VLQvEgR8iF/eBWb0b0/ZePxrB 7DSoTnPBnJoZpVo8DZtxTf7/5tJZKnlf+9vSMj/tbyWk16jNjSZI2rPOfGMaES4n/xxD TZAtPJ8eXEvS4dlJoESzYvMkdaQ/wVhQdRghSSlQNcXv7x2fVzJqH6A2WS51TKSKkB9x ofrMQqQmiM4FX2qqb0JvYP1aNpOGBixOkjIwNgoijl5PHCVoXbui1cbU2R+61YtSVIQa HiHzNTSGsFZXxENY/IOYMGeJYRgLI/HftIyI7JyXl0QcUMhSXnHRmg2jiwP9ZKsw5iTi JmAw== 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=cyL0/jnFa0SSor0do8LxfwCRRpMJCjTNUWxAvo1OcyQ=; fh=yqGPVqonb+j7gQBZAG/cMFgCj2DrqBvmRzJiuLrbN2U=; b=TEPvWXd26QboXFAIyYpfitqKZrARLH2bLujvnyr098lS8urzqETpgLT+CA1IkK96cj 7btd71zeV0YfP/xZ4vEoFsAPfQvaq6lCewMzWAe7NGDimEvpPn8Scjrsg9ywwTxpEJ14 PVZk2DID/NswLxWDEasGqKHjrqZw86OMl0dKivL1jg19IX10f1sV69dxlKgNxifovRnz IUIh+SBBzUgrxgHzwlzncYCv8knhc05Z8q4+YftXLzPVsCCIa5yAt8Iue+n+03WEcS8k fS6xzPr9aAKa8DYK5qHVK99+Q2WcB2szC/cBbFhFvXDIYmffZy4PNW/75MfCVo4oNj3o oo/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lCOSIObn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a170902dac800b001b892b6cec9si8313062plx.150.2023.07.05.12.28.56; Wed, 05 Jul 2023 12:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lCOSIObn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233647AbjGETEI (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233533AbjGETDq (ORCPT ); Wed, 5 Jul 2023 15:03:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69E2F1995; Wed, 5 Jul 2023 12:03:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EDBE5616F4; Wed, 5 Jul 2023 19:03:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65856C433C8; Wed, 5 Jul 2023 19:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583811; bh=6qs+fO8FwY5G4Sdovk+ksc1ld8uOMNkYoud5x4oGORo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lCOSIObnSGtdswfuOxHrkytYtuC0v2GkDH9Ujb3uib/K9cjz8tFm+277vkOtxzOIz jsuFePQP+SZqO/UOISgrCVH6B+Gv/wu9b57wM/GfuixNw8PUWznOKNOWC9wcROQXMH +x1bbcxyhfD3BsGjnzpsEcfu/Do5PhcElGm8g9Lbh4XBvqx+BnyedtZ/13Y2S0BWVk f3HXa1Ri1JNLFqSzAYwRdw1DtPghDodViAmmJS56sDB2uQFadywWUW4pPKSZxwLzMn +6JhBvTjBSuhDdHPZe6divNia2Jh4Hm4wjp804lhTEA6OOGVjdmQiHOvMnFoXlyiDD 4z7L1Qj1QTG+Q== From: Jeff Layton To: Christian Brauner , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH v2 16/92] s390: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:41 -0400 Message-ID: <20230705190309.579783-14-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610072949288970?= X-GMAIL-MSGID: =?utf-8?q?1770610072949288970?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Signed-off-by: Jeff Layton Acked-by: Alexander Gordeev --- arch/s390/hypfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index ee919bfc8186..5feef8da406b 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -53,7 +53,7 @@ static void hypfs_update_update(struct super_block *sb) struct inode *inode = d_inode(sb_info->update_file); sb_info->last_update = ktime_get_seconds(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } /* directory tree removal functions */ @@ -101,7 +101,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode) ret->i_mode = mode; ret->i_uid = hypfs_info->uid; ret->i_gid = hypfs_info->gid; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_set_ctime_current(ret); if (S_ISDIR(mode)) set_nlink(ret, 2); } From patchwork Wed Jul 5 19:00:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116339 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2093624vqx; Wed, 5 Jul 2023 12:36:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlGtGcw4SNJy2YV8f3+MvFpxIL9Im4jnKaqZzeaGuIyQRwpTzrjeT2vOmckSDn1jroxh4yfe X-Received: by 2002:a05:6a20:728c:b0:12f:c61e:7cc4 with SMTP id o12-20020a056a20728c00b0012fc61e7cc4mr2068711pzk.33.1688585783091; Wed, 05 Jul 2023 12:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585783; cv=none; d=google.com; s=arc-20160816; b=L6nBHOg5q4wX1hcgI1rU+xJrEwb0ZdDr5Wly5WswV1ZbWQUf8nJ0bGKS2WpRxF45a2 JkMtjv2MaskYpMNEEEKqLqDQEPTTUpkBegKuOzqNXocT6+eID3lMahDeWLhhRvM1BWHy maVkCRk5HWC2Z0OGUFWjaRW6JmTivLCipQyliVvqxxbrasvAxb2sXu0jNFuW0klvPqIB JhmI5XEDXASMHefkg3G5XlnMonnZ626P7v5SrJiwx+0zuICyWHlzxYEUqKiJrySxCGQV AdmJV4SPnw8MdM591ByUspqRYkQOcVTnIjBfDckJI2li2lFxo5aBTM9wm4KgPL+BXT44 acMw== 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=AjexFhab80pBZFviOM2oqIlZxtR4koZgFBjkSDfsRWo=; fh=+f59YbssGgx5oEx8rX/UyhkB9F+S3jDM1jyfjy6nTHg=; b=hL4VxgdkM0WFxtXkcy5qPofrqG3xLgMwvra2wMk/S+NWaSB7wtuAbE9Kf9nRZWvWTU qiL7zemXel3v3sdAFIkcWwU0zDH7600CkVu20BYIsJZY8nY8T9XAglOCnS9xNqW9YxGQ 6XL9ZAOlQR3O5sod1gzExpVK6GcMCeaD+CosSPh2HyaqjaiTOPpqjepl2t1Sp4rJCDZw CJdTd5mY7DwJTfo6Di9yeuPHWG+/W2wcha+yLQ9EW3G6JgoGOnFqD+jgf+SFLw7u6jia XYjfYPvdROGxiXO5oyKeiGxIqHzX/OadcIdHb0dpOYFoI4DTCCgIAtj8jmYfbslt6SII eDsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FQFU9umi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a634617000000b005576fecf094si23475647pga.2.2023.07.05.12.36.10; Wed, 05 Jul 2023 12:36:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FQFU9umi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233562AbjGETE3 (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233553AbjGETDs (ORCPT ); Wed, 5 Jul 2023 15:03:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09A1C1BDF; Wed, 5 Jul 2023 12:03:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C8ACD616FE; Wed, 5 Jul 2023 19:03:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28D97C433C7; Wed, 5 Jul 2023 19:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583813; bh=iubgnQN1kMbfBpqCB1PL0fyQ97oUl4IwPzXS1yBOIxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FQFU9umi3nbN6MUMUVCcV+vXKLeoDGFZO6/1+5pyWSD9eKk/+Onv7wQIfL8pnJWVw G8dM5ymyv0wyLuCISkwUYDVFnuE6F2lCY3gBOx2s5JU0x2+ICJo+HP5iTH6nxhGweL q92xirYuK3Q3dyo1ecVZrU6g6q62R7QvWHUQONJ5McfeSNtwvxvCvBcWmK746kLgAn e2802DpdrYiGtsdkSKhlFL4rKc2gDdB6/XMwXeOv3zv9UI95vpfbhBmbAF/gJ8O/7p Y/hBXXrb6yznVrGlB2jC36bM6ItuVvOCcqZBcW7HNSFPkHearOjr3+fWh7pj+4rlam nkZUV36QwcfuA== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman , =?utf-8?q?Arve_Hj=C3=B8nne?= =?utf-8?q?v=C3=A5g?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 17/92] binderfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:42 -0400 Message-ID: <20230705190309.579783-15-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610526138249733?= X-GMAIL-MSGID: =?utf-8?q?1770610526138249733?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Acked-by: Greg Kroah-Hartman Signed-off-by: Jeff Layton --- drivers/android/binderfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 76e7d6676657..faebe9f5412a 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -153,7 +153,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode, goto err; inode->i_ino = minor + INODE_OFFSET; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); init_special_inode(inode, S_IFCHR | 0600, MKDEV(MAJOR(binderfs_dev), minor)); inode->i_fop = &binder_fops; @@ -432,7 +432,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) } inode->i_ino = SECOND_INODE; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); init_special_inode(inode, S_IFCHR | 0600, MKDEV(MAJOR(binderfs_dev), minor)); inode->i_fop = &binder_ctl_fops; @@ -474,7 +474,7 @@ static struct inode *binderfs_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_ino = iunique(sb, BINDERFS_MAX_MINOR + INODE_OFFSET); ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_set_ctime_current(ret); } return ret; } @@ -703,7 +703,7 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc) inode->i_ino = FIRST_INODE; inode->i_fop = &simple_dir_operations; inode->i_mode = S_IFDIR | 0755; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_op = &binderfs_dir_inode_operations; set_nlink(inode, 2); From patchwork Wed Jul 5 19:00:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097913vqx; Wed, 5 Jul 2023 12:45:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5LZFdfVdyLx0EcTRrjgqxqDd8zhzO1utFzVeSSKaLL6A1a1k/dc6XGD0lZBYfT/M9T0j09 X-Received: by 2002:a05:6a20:1b24:b0:104:35ec:c25c with SMTP id ch36-20020a056a201b2400b0010435ecc25cmr12614862pzb.41.1688586347728; Wed, 05 Jul 2023 12:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586347; cv=none; d=google.com; s=arc-20160816; b=leZwr5DPRTrbyq2Yr98ryoID6O4+rpfeLI3GEDJfwBAgB+8P/eui7r5wLdg28+4wqU XPAE1U0msfk0Roo1A1pSKLMVN5MWmdHP4EjxzNHzENa91nn39mwkEnYKg9lMZCnhKpOj fb6APbOycT0f3AtFxLhPfjW5g4FoleKza4W+FaN5T+RXEclo7Qh3/prdHUIIjHNbUdlO oZsszk07r3TvcXYqhO9pgURGnF1pN9w50OG48F9PUzBzbuUhiSfiJX5AUD5As4d1hcxV rt9U6gw+rjNhZKpmivrfZTSEZ3akSJmDq8xy+KmC39Qs2PqftpMgmgtgx531gCxkKP4y ufiQ== 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=m1EEMWGyOkW3j6xe+8UnUfKYxlJK6WG+CYJRxUeIsQs=; fh=9odmT5xVWaZfJb+g0nDSE9jHohQqt2aA3Br7D+6/b3M=; b=qw7N8WTTelsBYLNoJDRwudRJqJM/XhJCIcvYmoh0LTJ9xu0jl4QHoehUsYCgIffXaw 1jU1AKH3hPs+qD30u/N8jRrNfYjKKwPmInAknQPyFzoJSkU/NScFB0yTVa/m9Sqwe/LR Xn3X4dC+BFXJUBRGsa+5QMcMdQj3h4jLqkLjNQpTb80ljlFYgy4mFL86hqsAPSWuJjno 5tksNaamcEucJn601+VnLE24Dy6TCuS64X8tcvQgbpo3b+OGWtNL8nNSrkq/83z6M5FP qOoureKY5HT2d2T+5PgGTAqeoUhI/sdsiOImxH18J3DFeKCvY83nRs3f7M0iPsS/qx9Y LbCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BCSd+5QK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a62e414000000b006688c47e5b4si9767527pfh.399.2023.07.05.12.45.32; Wed, 05 Jul 2023 12:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BCSd+5QK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233679AbjGETEc (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233491AbjGETDs (ORCPT ); Wed, 5 Jul 2023 15:03:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCFA61BF7; Wed, 5 Jul 2023 12:03:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5D4C3616FD; Wed, 5 Jul 2023 19:03:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC70CC433C8; Wed, 5 Jul 2023 19:03:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583814; bh=6A3lu3ahskz2UGdWWxwneKyvoSkhQFQQk7TBbCz+qvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BCSd+5QKML8sW8rjLkq9XeTy5nXs45Ctu9NoTqobRQRD1OMeaV6Ow2+c2Ak6U/QK7 ffXfwds4368Anu88DDQOkEZgKotsaAxkiGsOHhTxKbOvdAGPDBccaRExq1OW8F0lFp W/E8V2ouLnR0R4qW/3y+3L1Bf/BdMV+0fobr+BmwdlG/3ZCkvGy4UOaQt4ALsWYY2K d52XxXkWGkzp54T9qZu3N/BJ3AZvDlF6B+zXs4D0RguvBzBaBII3+G6QNBVxmbESlW D6RGN1qSDcrMjI+xe9gniJZFuVT0ZVoddq5GP+Qtc4p9901XpHWbmOEk6Sa0Fqyz9b eDwxtj1HjVUHA== From: Jeff Layton To: Christian Brauner , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: [PATCH v2 18/92] infiniband: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:43 -0400 Message-ID: <20230705190309.579783-16-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611118038738012?= X-GMAIL-MSGID: =?utf-8?q?1770611118038738012?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Acked-by: Dennis Dalessandro Signed-off-by: Jeff Layton --- drivers/infiniband/hw/qib/qib_fs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c index a973905afd13..ed7d4b02f45a 100644 --- a/drivers/infiniband/hw/qib/qib_fs.c +++ b/drivers/infiniband/hw/qib/qib_fs.c @@ -64,9 +64,8 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry, inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; inode->i_blocks = 0; - inode->i_atime = current_time(inode); + inode->i_atime = inode_set_ctime_current(inode); inode->i_mtime = inode->i_atime; - inode->i_ctime = inode->i_atime; inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = &simple_dir_inode_operations; From patchwork Wed Jul 5 19:00:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2092016vqx; Wed, 5 Jul 2023 12:32:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlHRPVKCcb47tWLuXb/ej1SOQbZvjOX3yXFrJhLKi/CU8UKQrCh8v3RowPaASWaA1lIFqebr X-Received: by 2002:a05:6a20:a128:b0:12e:aa2c:8847 with SMTP id q40-20020a056a20a12800b0012eaa2c8847mr4518855pzk.25.1688585572473; Wed, 05 Jul 2023 12:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585572; cv=none; d=google.com; s=arc-20160816; b=HYQjQ6iBhsXz1zozEuk7skOshRGZAdpshVpze0EptXifYbcgNpswwHu6nPvwL/wagO V8XKaiY5MOdolaHnsn2gN11UqbLhyZvIG5Ca0V8R+vjPR5IVX7hPQyoyhPCakSH/+7gP IxfnK/cES3JPaCAnLjCBSsNezSCMzJiWeQpNCzqjNxJyDahamTVJmROSVugeO1IkDtFX 8KJaFaz4Uf3vLI/DhWXooqnuWVJSaxmZu9XzvVBw9lL/5c1+Lz/whr7hH8+atHitobtq RdtgCAOHJuUfH90xHWmFbOYnxKel0JMGxw+kQ8+3aX5havlKn8wdzjpLkxrmeOmbqutQ CCbw== 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=CrhgwpjTqpjbbfMEOJbpULOJVUf+KROwlgY/4f4Wtek=; fh=luKc62O63JufafPxqwecUBD+5mCWoGsg+g35Vv5Olpk=; b=glHhNhGB/izfBZuflHyNajJK9TktPCOMncROUIKBaW56tPzYdZNes2Qs3k6WRckUVc Gl9RbBctAPJ5QkG9q8q91pTXVMNcHLL8CQv+3JDlPhY7/eipRm7hfiyHgYGjXZq7qy+4 8MhPibNP5xRu8MCwEdZaU2xrLkGYhmCc8SwXCRj4Z0Mxb4cUGp4xkifjIDXuE95C1DWy 4fIibuEY0QV2L8apzR9RDGcQzwo29au3uekGHBrCf+/Gq1SeGZJpsymmJbST1rbSwbkF 2IyLXG4DjbV8Z9s/4GT6Eep7ZCLKRcKSfpHtnT6BoVYe5Fv3K9dVcz5CYBb60/+rTWDR Gbxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NrQEAsjn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n127-20020a632785000000b00557622a044esi25194496pgn.805.2023.07.05.12.32.40; Wed, 05 Jul 2023 12:32:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NrQEAsjn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233595AbjGETEn (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233583AbjGETDw (ORCPT ); Wed, 5 Jul 2023 15:03:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4811FC8; Wed, 5 Jul 2023 12:03:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F03C616EC; Wed, 5 Jul 2023 19:03:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA0B1C433CA; Wed, 5 Jul 2023 19:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583816; bh=WjJ73M/v99Nap+N3R5V2fA+OWUumYJWRrkRq37VlgiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NrQEAsjnnUBKxYdCIlgLRKZoDoUovdo1xj0fUfa8IpK75tYuOjN/lU/OcHRfIEJOb ++7Q8xU3jNOMXViBUwsZ6GwojOf8MoGrGAHeKugS5rCTk27COn5WNUM2ILbX+lFmpA jM8q8Bjny1G1jEwSO1iFLx5gtrvNgb9Ay9qF//iZLnmRRHFxE8tdiVE9qZlbqFKfBB A37vQ3inBlQwdzVEq102+hkzk8fPOEzxAghG27IYnED6r9askVjn/u9Em481bJfhEi VoWjMFh/qigb1aMliEewnL8D7K8Lxv+0ebPocfAxlIGThWObZBtXQ88UMKq8uwh4bd zdk6syPNk4aDg== From: Jeff Layton To: Christian Brauner , Arnd Bergmann , Greg Kroah-Hartman , Brad Warrum , Ritu Agarwal Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 19/92] ibm: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:44 -0400 Message-ID: <20230705190309.579783-17-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610305205165424?= X-GMAIL-MSGID: =?utf-8?q?1770610305205165424?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Greg Kroah-Hartman Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- drivers/misc/ibmasm/ibmasmfs.c | 2 +- drivers/misc/ibmvmc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 35fec1bf1b3d..5867af9f592c 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c @@ -139,7 +139,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_ino = get_next_ino(); ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_set_ctime_current(ret); } return ret; } diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c index d7c7f0305257..2101eb12bcba 100644 --- a/drivers/misc/ibmvmc.c +++ b/drivers/misc/ibmvmc.c @@ -1124,7 +1124,7 @@ static ssize_t ibmvmc_write(struct file *file, const char *buffer, goto out; inode = file_inode(file); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); dev_dbg(adapter->dev, "write: file = 0x%lx, count = 0x%lx\n", From patchwork Wed Jul 5 19:00:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116334 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2092897vqx; Wed, 5 Jul 2023 12:34:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+uxggkRDsS0Ywr+46Cw+x2g/egb0hPusPZiNLO73mM6rSBpZoAY0wwT9qhafyKN/E294T X-Received: by 2002:a05:6808:d4e:b0:3a1:d504:f245 with SMTP id w14-20020a0568080d4e00b003a1d504f245mr16245792oik.37.1688585684162; Wed, 05 Jul 2023 12:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585684; cv=none; d=google.com; s=arc-20160816; b=hJHmwC+5fmLw5Nr0eD/l9XGDQdNqO7nKa8gH972+BZMDPgxqJ6CGj2eJb0GS9oki7d VZgWpREmQt4V8tv8MAzs7mFIbqMtryCgTvBaDXyy1ovkOHb2YzKEknk06KbxOhyNgJss hLcBjrchCC/jLobOW0aTIj5rZRZePBEBZ8sETDakHDuWNoS7lODGXVfU9HTIu2WJalYG QMSbfPJvY4Nq4lMoMZ2wQZjpqS/hxcMt/VmnAdC5aUgavT9EiQd0MMLlEYprq1pYwjoA +o2mG7+dY+hFY1zPBKu6AsVeDYtqi/RdKBkTcQdltkQnMRRRJsx7MVClU3wCx9BeKAdR jfSg== 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=xhWA1gEdUHTETB5BoiEGLYHznSAhVEg2aCpbjoE7MSA=; fh=8vN/fdBoiSVIR3QQ8rTNbzHHFW1HuZ2SMylqof2F0bk=; b=rK+ns6FANncjAqee1JzPH/+WiBQeuAPfYDQp5jjIwIx9mEeGTsSY0U4IuzkBZGwiwg Dnha3TpYfOOAX5NGS+502FwHHNtaQJYNO1KOOa1tPiJRHyJhstlaABUlZfynaurL5DZE KTMfFi1jVwIdXsPSROErq6hmNVGhGvCbiQXjo1i0X3oPO0BbwCt3se3G7bJTBhzjje9v oIuCCyLTWiyZxA0Gdzn9I7R77E+xaEIPuwPG5GX28D4Hwwek1T1dKfPlMblY2ysDWsxa aBVwaFtK29e1UI7VDQjUyRt+UZi/NVQISp4c2Fwdg4yEM3xGVFuySA7zslg0fDiMXO/F jhiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kyPlfPUq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w70-20020a638249000000b0055acc7f8086si20959813pgd.821.2023.07.05.12.34.31; Wed, 05 Jul 2023 12:34:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kyPlfPUq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230126AbjGETEr (ORCPT + 99 others); Wed, 5 Jul 2023 15:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233508AbjGETD6 (ORCPT ); Wed, 5 Jul 2023 15:03:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EA211FDC; Wed, 5 Jul 2023 12:03:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DACE7616F9; Wed, 5 Jul 2023 19:03:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BE0CC433CA; Wed, 5 Jul 2023 19:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583818; bh=IFjY2ZG1/G67P/89fD6mRVOfDYWsWXSwb+QK0dFqNJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kyPlfPUq+2nOnWMrdZof8wN2AB7vG7VWbFXzPh3rce7JWRwzaQLXNUwnECAgz3Gu2 LM3FOB/jGtRhMqyLhHiCieTjP9F16SQTqdWmJReFJGWpn4CgQFKbJbhJm1MB9T+il6 XMs3Qmdg93yJiavrPH9nySnCk9SB4gh4SS3o1sJOcwWJJldu+0MLoegHErmfNjtH7n wOf2f3Lm1wFJ+hfjji3JxmGPmOR5Fty+NLh2V1Zae6s8u3dbCBzJ2e5q4ADXwAsiWA kZqgcLlgB3MeVC+MPpJw6pvEEiAD3hPyBMbEsHlFfsbHVL9a/ETvT3ehQLhEnWTmiA SzodEM1TJAHCg== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH v2 20/92] usb: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:45 -0400 Message-ID: <20230705190309.579783-18-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610422501075675?= X-GMAIL-MSGID: =?utf-8?q?1770610422501075675?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- drivers/usb/core/devio.c | 16 ++++++++-------- drivers/usb/gadget/function/f_fs.c | 3 +-- drivers/usb/gadget/legacy/inode.c | 3 +-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 1a16a8bdea60..4f68f6ef3cc1 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -2642,21 +2642,21 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL\n", __func__); ret = proc_control(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; case USBDEVFS_BULK: snoop(&dev->dev, "%s: BULK\n", __func__); ret = proc_bulk(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; case USBDEVFS_RESETEP: snoop(&dev->dev, "%s: RESETEP\n", __func__); ret = proc_resetep(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; case USBDEVFS_RESET: @@ -2668,7 +2668,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__); ret = proc_clearhalt(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; case USBDEVFS_GETDRIVER: @@ -2695,7 +2695,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB\n", __func__); ret = proc_submiturb(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; #ifdef CONFIG_COMPAT @@ -2703,14 +2703,14 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL32\n", __func__); ret = proc_control_compat(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; case USBDEVFS_BULK32: snoop(&dev->dev, "%s: BULK32\n", __func__); ret = proc_bulk_compat(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; case USBDEVFS_DISCSIGNAL32: @@ -2722,7 +2722,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB32\n", __func__); ret = proc_submiturb_compat(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); break; case USBDEVFS_IOCTL32: diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index f41a385a5c42..6e9ef35a43a7 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1377,7 +1377,7 @@ ffs_sb_make_inode(struct super_block *sb, void *data, inode = new_inode(sb); if (inode) { - struct timespec64 ts = current_time(inode); + struct timespec64 ts = inode_set_ctime_current(inode); inode->i_ino = get_next_ino(); inode->i_mode = perms->mode; @@ -1385,7 +1385,6 @@ ffs_sb_make_inode(struct super_block *sb, void *data, inode->i_gid = perms->gid; inode->i_atime = ts; inode->i_mtime = ts; - inode->i_ctime = ts; inode->i_private = data; if (fops) inode->i_fop = fops; diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 28249d0bf062..ce9e31f3d26b 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -1969,8 +1969,7 @@ gadgetfs_make_inode (struct super_block *sb, inode->i_mode = mode; inode->i_uid = make_kuid(&init_user_ns, default_uid); inode->i_gid = make_kgid(&init_user_ns, default_gid); - inode->i_atime = inode->i_mtime = inode->i_ctime - = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_private = data; inode->i_fop = fops; } From patchwork Wed Jul 5 19:00:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116316 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2089272vqx; Wed, 5 Jul 2023 12:27:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlHMkQ2Am8ZRVRt8Mp8LPMKiBp+pbVqKumisJOUgsoZ1BWbw/LDq39p46Lozh0/UJhnxdzxw X-Received: by 2002:a17:902:f54a:b0:1b8:73fb:669a with SMTP id h10-20020a170902f54a00b001b873fb669amr20491760plf.31.1688585257818; Wed, 05 Jul 2023 12:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585257; cv=none; d=google.com; s=arc-20160816; b=vRy6pwEpruaCgeYaQymAIequoJvbELBO3a1t2pIRjPxrZtK85lMwqugqgOFcPjWOcc T1/D3MXYAoca0b/d4V4BFMY+EuyrHjKrJpystHySgIgSZY2XHddZThaLsCm5o6tUG1oi LC8UUjfUD8PgslerlrkMbSGum3jYwgu0amcISCFACxTUfafkrSSi3bgD+HU85TQzJJ5k 3p4fbIB9ol6WWDjy2+UaVzH/itWRSBUcH5uDr/baxfS+QzDEWFwLUop1mGjXuCHlgnt7 1wdSFrArxhv70IbKys75SRyS1ZQoHZJVlSRx+QIm2KaSjKxDkLqY2OokQ21+cwGVZNvH xQdg== 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=sAyyFL5UmLRX+IRiqpLBn2y7Uwknr+MbfEwa6/ML5dY=; fh=g8yWsXSMWOkIWFj3V7q8Oxjp9qnFwC/Ua0kz3W3/LmQ=; b=byZfIRo8ufiIuYHq00d9Moz5Q7VpAdYNc3XqOxVPjfP7lKGOe1Y1DQTHw+teGdj0cx 8PRKiqysX2Kvz7nFW29NtfJEua4YSyFnYf8f4hjYVAkWG2rKwlc3xZz9+I8Osc6BxbkJ ZO/o5cZkFO5GukK3Vu1QmkXf4N3VjGP4ONXC9J+KVYxdxPaOa8nMSOw3er6xN7QSWcuM koEGAalnBVUufI8/xiwVT3ux5pp6UizqsC0jUOX+77ItidZ2R2juhxZMU6B5cyQzrk/a vQ32YsShsECDw3BD2Ha0kTdK0dBM3zto4Ow/ujRhAm3kJf2q3M/pos4p1/nIaPCCUDxV HVzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VMDbQQ5p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a170902650b00b001b8aef277a3si2181928plk.45.2023.07.05.12.27.22; Wed, 05 Jul 2023 12:27:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VMDbQQ5p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233699AbjGETFL (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233555AbjGETE0 (ORCPT ); Wed, 5 Jul 2023 15:04:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5729E1FF5; Wed, 5 Jul 2023 12:03:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AB45F616C4; Wed, 5 Jul 2023 19:03:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3559FC433C8; Wed, 5 Jul 2023 19:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583820; bh=1ESAF7Gh63wnUhvuz8PjyVJK4ESwbnRSUgq8ZwhC9qQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VMDbQQ5p4EHCOkOXtHInEdH7AcWARlUqG1pXKHuQF3mAzWDLAkO7F2B/jizDJ64+D v9rtAWEz8M3o8oO1hoHzLkDJHhzCzhstVofAwyn1lAk9PMjnfp4wFcUlUdZRY4AWLG kxPPGkKypVYeaxacOQHZU78hdkF3lIFQJH9pRtHsGK/Q7u31Vfi3b5M55AaqQ1QuUj pxOEj9LIFl+VWpQlK4D0SUWXaR1Uvt04WxG3z1exDR2x8OsE1HhljKdMt292oi6ab9 GT1iV64cmjr2NLDpiAg+V+zLVgK9S5HFJjh2l6Zw7v6dNKi4pJB/Gu7FqupFwYa00u UGO+n6nHB9Oew== From: Jeff Layton To: Christian Brauner , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, v9fs@lists.linux.dev Subject: [PATCH v2 21/92] 9p: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:46 -0400 Message-ID: <20230705190309.579783-19-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609975170561040?= X-GMAIL-MSGID: =?utf-8?q?1770609975170561040?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/9p/vfs_inode.c | 4 ++-- fs/9p/vfs_inode_dotl.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 36b466e35887..16d85e6033a3 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -261,7 +261,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); inode->i_blocks = 0; inode->i_rdev = rdev; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_mapping->a_ops = &v9fs_addr_operations; inode->i_private = NULL; @@ -1158,7 +1158,7 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, inode->i_atime.tv_sec = stat->atime; inode->i_mtime.tv_sec = stat->mtime; - inode->i_ctime.tv_sec = stat->mtime; + inode_set_ctime(inode, stat->mtime, 0); inode->i_uid = v9ses->dfltuid; inode->i_gid = v9ses->dfltgid; diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 5361cd2d7996..464ea73d1bf8 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -646,8 +646,8 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, inode->i_atime.tv_nsec = stat->st_atime_nsec; inode->i_mtime.tv_sec = stat->st_mtime_sec; inode->i_mtime.tv_nsec = stat->st_mtime_nsec; - inode->i_ctime.tv_sec = stat->st_ctime_sec; - inode->i_ctime.tv_nsec = stat->st_ctime_nsec; + inode_set_ctime(inode, stat->st_ctime_sec, + stat->st_ctime_nsec); inode->i_uid = stat->st_uid; inode->i_gid = stat->st_gid; set_nlink(inode, stat->st_nlink); @@ -669,8 +669,8 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, inode->i_mtime.tv_nsec = stat->st_mtime_nsec; } if (stat->st_result_mask & P9_STATS_CTIME) { - inode->i_ctime.tv_sec = stat->st_ctime_sec; - inode->i_ctime.tv_nsec = stat->st_ctime_nsec; + inode_set_ctime(inode, stat->st_ctime_sec, + stat->st_ctime_nsec); } if (stat->st_result_mask & P9_STATS_UID) inode->i_uid = stat->st_uid; From patchwork Wed Jul 5 19:00:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116325 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2091954vqx; Wed, 5 Jul 2023 12:32:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlFgH1yCmzucOvF9QnQMMFa5ZxOIuHhV1b+TrVEFyRfZNJ/1myP7PA1LJs1er2IHJqKXrE/5 X-Received: by 2002:a05:6a20:8f21:b0:125:9d2e:ae20 with SMTP id b33-20020a056a208f2100b001259d2eae20mr16239239pzk.59.1688585564950; Wed, 05 Jul 2023 12:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585564; cv=none; d=google.com; s=arc-20160816; b=CiGBp/LK1P91hyMebxuZo6iZOi8h7PsyHDXvNcBBNHOdG7tt4Sv7ZMg8xXZAlYVB5S Ji8w2mVaKa5Vn+XZv2qeHPn85ZtXYryMhKV+3Se1nIwxy4Srma7cYphfQFPpM+XPE1uv eUtX04ShxkyGLMNNQ2M8ORQ/FmvrPVaIECMHqyjp7loNG6w3vmGlgFrejzNR6ucxUMHq dGJcUOk9dwwNR1FOplupk4A9g9rg6UT9bZVGtHygg2ixsdw0umMjGPk8SmyxyqSJP/Ap aGcP772XiZQqr/sbBbLyxvoDorGkle13oOQMtTPX1HSZlNd7bJXBVUELfQ6npGoZBlyj BQfg== 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=IZTu0lqNN/Ui6kYvudHKMDvPAQt9Z2i64RonMPk5pw8=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=vLuSdEN5QmbLS+Xmo31Dx95c4Pl9ajG6juybjZ7ZpkS3hNQkKjeRp+m+cCF/4yGthP FVT9r8UuJlU2WT9eWQlJhhqCtPM9cVyMRAFttVZCjXfFGmWxNlPHK2LLET4Yyo5a9X/e 2EKbsU88cyeSuK6lG6HYDoF01zXmhUbnzv1l54IHddpAexGahDUpoKQ3D4Yok1/lqAai d8mt0dPJzsbuX6eFpaO7W5y0NFFY2JrMubMv90P3PSSF59zWHlvQPA4FNLgLua1Ldh5m n78uKGH5bscTPkOIQwdBfiVmSWhHsWTmhQy/DTMnmK+8Jrv7r6swMbHM+4D/ODuG+Pf+ 0lDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AMGB23AP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a63574b000000b0055aeedd94d3si20028854pgm.58.2023.07.05.12.32.31; Wed, 05 Jul 2023 12:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AMGB23AP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233564AbjGETFI (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233640AbjGETED (ORCPT ); Wed, 5 Jul 2023 15:04:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B16E2108; Wed, 5 Jul 2023 12:03:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ED985616EC; Wed, 5 Jul 2023 19:03:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9794C433C9; Wed, 5 Jul 2023 19:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583821; bh=fdejnxV1LJvnaB0wtfuEm/JayRlnvFjmoK8r3gZzcgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AMGB23APQBhbU0+7gU0zX57RnL7A38MYS2ehUWP9J8yXQpkFUcO4rxbyzb1VHShSF dGftSU9lKa7rcsoKgZMWcpzoFtTLM9s8J6l1Fg9S+P/L8cyRNCXUzrXY5kJ9kPxxXl Oj5hJR0YbHRfZkCKn9B1ZNBl3MOS3maUKd3o5tZUSPfwSAKmHn2cCi6TtwN7xrv7pW aIWukeXI7rEcYeGE2aj5f2SG4LJ9RHfhHJz5PknkGDcmM8opALwrZZ6iA8S+o3vw2+ IHco4LdEeYd6RvlxQH48rCtcELnnPB6UWvJcvIE0d4ldQjJ4thrC3cxiLaB6QuFQ1K 9yEiJgc91mfVw== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 22/92] adfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:47 -0400 Message-ID: <20230705190309.579783-20-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610297438637206?= X-GMAIL-MSGID: =?utf-8?q?1770610297438637206?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/adfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index c3ac613d0975..20963002578a 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -270,7 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj) inode->i_mode = adfs_atts2mode(sb, inode); adfs_adfs2unix_time(&inode->i_mtime, inode); inode->i_atime = inode->i_mtime; - inode->i_ctime = inode->i_mtime; + inode_set_ctime_to_ts(inode, inode->i_mtime); if (S_ISDIR(inode->i_mode)) { inode->i_op = &adfs_dir_inode_operations; @@ -331,7 +331,7 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, if (ia_valid & ATTR_ATIME) inode->i_atime = attr->ia_atime; if (ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_set_ctime_to_ts(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { ADFS_I(inode)->attr = adfs_mode2atts(sb, inode, attr->ia_mode); inode->i_mode = adfs_atts2mode(sb, inode); From patchwork Wed Jul 5 19:00:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097684vqx; Wed, 5 Jul 2023 12:45:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlHuzocpQv85XlKOBbkYVTwDxKZQMM4FHu2GdxPK+VqGuqZYqODJDzLShwrNAdqbpK716Br3 X-Received: by 2002:a05:6a20:728c:b0:12f:c61e:7cb7 with SMTP id o12-20020a056a20728c00b0012fc61e7cb7mr2276860pzk.51.1688586322166; Wed, 05 Jul 2023 12:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586322; cv=none; d=google.com; s=arc-20160816; b=wiu/x6OwD8WIGhA1BO+HtLs+72ZLUD/lYAaLTTHJHbFYw2SkDK6J9WZXdHnNjNQ8T+ 2so11HgzdpAVp6SoQq45ZUypOHJn8q09pmzRKLbVgCJ8gXMQSndjrWZ57nvRF/M5UaOF PZzWcB9WOpAlLtzfvB3WUOb7tz7TLowe7A/bXTXuj7NDJlhf8lhkpTJUNZd4qBrUvXD3 0OcYosZwVjcVgsPoy3Zb1eTdPNvHsvR9k8td+SzOmfrC2Qbk6X2NRPYPhbwBOCrwIg4g fcWDZXMv+CV//wv8xEZEx8g0Eg7nliPxGfdyCXtCgBNiBUX0NaqpUEv9SjrASwDvtLZU j5sw== 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=SEh6ItZtdNKu1MYne1B7VPBprkRie47IV2hfmGfoGM0=; fh=vUHNRmLjnWgeD+770GveZaiNol/JSKTRXBoXRht8FCg=; b=ocIfNXG6zCdohu48fwlCH2UjlhTxPAbTo2WWdqbKft41iPOGLLfXzLORggbKmuBMcw k12KMf91eMQ5X6ySL3nSngEO7I+VDQ/GqAFK50NIe8Iq0kH3ZUqKRqBLSiJH9mEwfwwr w7Q6u9R0sxvZP10NSPMAGQxSvoJYBYg/bW8sQcq7WdGo9z87LR0buKgtvly0BJ2tx1L5 aq6JEHJrRWQ96zSN8/5/fX+mjZliIiMYzm+b/VoZrLpsCAPIztj3j6GO13HzUa9QYUKX cjtxaogFLKl5MZufok431yW7ucWb9sElhyDz2t+tHNvcy0w8jDJ0ob858ke1OsBk/J2Q KubA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o8AAPs+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g124-20020a636b82000000b0055acc9229a4si20308557pgc.803.2023.07.05.12.45.09; Wed, 05 Jul 2023 12:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o8AAPs+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233572AbjGETFU (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233563AbjGETE3 (ORCPT ); Wed, 5 Jul 2023 15:04:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E322126; Wed, 5 Jul 2023 12:03:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7ADA4616F4; Wed, 5 Jul 2023 19:03:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51CF8C433C8; Wed, 5 Jul 2023 19:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583822; bh=wSyYyxAOPkc4UMvoUTNmso9bOR6OW/Z0q8azn3XnLKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o8AAPs+uOhNW5p5ZVDmLjOlmDWrSdbUEMj85BxAkCXEad3noFFCw+u2lAfB8+67xl EHH0Q7KmOJl5GFehxiCi9O/GivjvhQkrHYAKk1pc9+a8xeIJQGNFNL4ZKxdKCJdgW2 wtdkcqQ9bPP74wogVJiwPcLAcwMhoSwW7nZt0ydyE+ozUdZQEg0fsiQp/lbc7RvwV9 9GsRbywg0U0kF+WHw6AsFkEzPXDkYbDVFa0aiW05UINetBxnpPMEuGCSnuZqxtk0mg NHK4vqSjEnaKyqAZP1EYwlnJCnNxR1HVLQ8dgwldJ0ARxQyXNelaFKkBjZK3T2pnST WOKMcLaTKRpEQ== From: Jeff Layton To: Christian Brauner , David Sterba Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 23/92] affs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:48 -0400 Message-ID: <20230705190309.579783-21-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611091354539656?= X-GMAIL-MSGID: =?utf-8?q?1770611091354539656?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: David Sterba Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/affs/amigaffs.c | 6 +++--- fs/affs/inode.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c index 29f11e10a7c7..7ba93efc1143 100644 --- a/fs/affs/amigaffs.c +++ b/fs/affs/amigaffs.c @@ -60,7 +60,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh) mark_buffer_dirty_inode(dir_bh, dir); affs_brelse(dir_bh); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); inode_inc_iversion(dir); mark_inode_dirty(dir); @@ -114,7 +114,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh) affs_brelse(bh); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); inode_inc_iversion(dir); mark_inode_dirty(dir); @@ -315,7 +315,7 @@ affs_remove_header(struct dentry *dentry) else clear_nlink(inode); affs_unlock_link(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); done: diff --git a/fs/affs/inode.c b/fs/affs/inode.c index 27f77a52c5c8..060746c63151 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c @@ -149,13 +149,13 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino) break; } - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec - = (be32_to_cpu(tail->change.days) * 86400LL + - be32_to_cpu(tail->change.mins) * 60 + - be32_to_cpu(tail->change.ticks) / 50 + - AFFS_EPOCH_DELTA) + - sys_tz.tz_minuteswest * 60; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_atime.tv_nsec = 0; + inode->i_mtime.tv_sec = inode->i_atime.tv_sec = + inode_set_ctime(inode, + (be32_to_cpu(tail->change.days) * 86400LL + + be32_to_cpu(tail->change.mins) * 60 + + be32_to_cpu(tail->change.ticks) / 50 + AFFS_EPOCH_DELTA) + + sys_tz.tz_minuteswest * 60, 0).tv_sec; + inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = 0; affs_brelse(bh); unlock_new_inode(inode); return inode; @@ -314,7 +314,7 @@ affs_new_inode(struct inode *dir) inode->i_gid = current_fsgid(); inode->i_ino = block; set_nlink(inode, 1); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); atomic_set(&AFFS_I(inode)->i_opencnt, 0); AFFS_I(inode)->i_blkcnt = 0; AFFS_I(inode)->i_lc = NULL; From patchwork Wed Jul 5 19:00:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116308 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2084165vqx; Wed, 5 Jul 2023 12:17:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlFD9sni0eqj7/fgVqFVXIEW5TjVaRK3/A/tbsvG1dSVd0iMq0604Eu1MIs3ftWdYQjkslqa X-Received: by 2002:a17:902:e743:b0:1b5:1654:96d4 with SMTP id p3-20020a170902e74300b001b5165496d4mr15870197plf.4.1688584653750; Wed, 05 Jul 2023 12:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688584653; cv=none; d=google.com; s=arc-20160816; b=vuiKUjhqioGqqS7FJ3+Clax5D1p/iqd2ys1uJvTDDa0B40Dmz50034E7Znx4Pbu+DQ T5yRJfpxS6Bjj1YZhDOeGNbJ5RczaQQQhK07/0gyhL/WnGz1CokWI4xkX9zJY8evMoN1 OmIFkZAZIAQIeJ7licWI5KzZjQqpU9B8I2Pgbry/zaKgrkhXv69r3kXtfJhHArJH1Tsf Mb3pTgf6sRXuz1q52euBo8kM5bINaE1IjclZ1barjimIeInBQTA3r5wg1iKh/tSj8NdZ Ty06ochG23x6/XuRI7LLVT6KXsCI4dthx0gS38Nk1CpP3F8Ba6+nazWUB67HWKn5DMOQ E8RQ== 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=J7rZLvTDizl7ppKNbw/UyhZydqmXguFMvC+NmSXsIHE=; fh=qyItc0wfe6+MHXqFh6YlbDf3NL/D2gpICysJ/QxZENA=; b=fcntenhTOIcR9JSkT0ZdMMbsTm2gGbgE8h5WAZNUvxJRVJvLbDGtbXrFXnzWAOAr+5 qEozJPf/CwnESJ/WPrJXgV3qY8uSbyEh0fjvzWpFETsqbGLKhUSMoRXksq/uyWKt0nIg FQHSa6SUquImfV908sqKvb0r8FlnhBtllbcb+wcW0bPP3ItGTZ6ldDZw/L86Q2J6fmyM NSlozKa4zCj0bQR8x4JO2ZxCvqP/egpktLE5E7mEXYmgpipTg3HfNhsuAY2uIk7GfOvl S2u5OM2OTJJQd7Su/epSOacjihlrIkNX9rhtAcXf+DNwz9lZgZrxghQTVIShkqi8z8CD k7/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WmsTGikn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020a17090320d400b001b53b6b029csi20438634plb.124.2023.07.05.12.17.18; Wed, 05 Jul 2023 12:17:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WmsTGikn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231994AbjGETF3 (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233695AbjGETEp (ORCPT ); Wed, 5 Jul 2023 15:04:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D45142680; Wed, 5 Jul 2023 12:03:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21C72616D1; Wed, 5 Jul 2023 19:03:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C835BC433C8; Wed, 5 Jul 2023 19:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583824; bh=1B+MgxeTUKiB+Aq5PTxF0CcPr9pCEwQhTlsh6cqIOdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WmsTGikntTcs585octjgzEvGQ4NF2m05+liXMeHd7YWRLAsj/EWPPr668pReigKWX YZyp7UuLDK1/AYXJys666MxyTRACmx9TiSa3YjyQxI7oZq3/F79aQAXMpLWf6hg/18 I39raBK11jzCp//l9SZkPsDG+MsxNCWKnPPxtZsKMnAzkX/c2u3LteYNoACxQ8Mz3S isJq20UqJE/y9hy4OF8kHrFteHDj9iSackwnExM8HFDUGyUNkDoPF4eWIxd1NSh5dZ x8BDNmCqWOiHg+E7wPfo5+vWyKXFk9RnhXbqJGYfZOAlSap34gnK1KczLmSr4ObFom YZxuY9ITV40Vg== From: Jeff Layton To: Christian Brauner , David Howells , Marc Dionne Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org Subject: [PATCH v2 24/92] afs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:49 -0400 Message-ID: <20230705190309.579783-22-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609341784036374?= X-GMAIL-MSGID: =?utf-8?q?1770609341784036374?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/afs/dynroot.c | 2 +- fs/afs/inode.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index d7d9402ff718..95bcbd7654d1 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -88,7 +88,7 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root) set_nlink(inode, 2); inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; - inode->i_ctime = inode->i_atime = inode->i_mtime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_blocks = 0; inode->i_generation = 0; diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 866bab860a88..6b636f43f548 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -90,7 +90,7 @@ static int afs_inode_init_from_status(struct afs_operation *op, vnode->status = *status; t = status->mtime_client; - inode->i_ctime = t; + inode_set_ctime_to_ts(inode, t); inode->i_mtime = t; inode->i_atime = t; inode->i_flags |= S_NOATIME; @@ -206,7 +206,7 @@ static void afs_apply_status(struct afs_operation *op, t = status->mtime_client; inode->i_mtime = t; if (vp->update_ctime) - inode->i_ctime = op->ctime; + inode_set_ctime_to_ts(inode, op->ctime); if (vnode->status.data_version != status->data_version) data_changed = true; @@ -252,7 +252,7 @@ static void afs_apply_status(struct afs_operation *op, vnode->netfs.remote_i_size = status->size; if (change_size) { afs_set_i_size(vnode, status->size); - inode->i_ctime = t; + inode_set_ctime_to_ts(inode, t); inode->i_atime = t; } } From patchwork Wed Jul 5 19:00:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116392 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097899vqx; Wed, 5 Jul 2023 12:45:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlEo3e0U8Kzj0aG9VXRSaKOt/pMXv7avb3VN+TqTC+xjTOm8TQTyI+zVnHEOfpO2DQ0uAn1Q X-Received: by 2002:a17:90a:db87:b0:25e:a8ab:9157 with SMTP id h7-20020a17090adb8700b0025ea8ab9157mr16057519pjv.22.1688586346228; Wed, 05 Jul 2023 12:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586346; cv=none; d=google.com; s=arc-20160816; b=N8sNO2+nlHpNaCwppH9Jltysvyx2GjReEgBaU+n2YOp/0zzWurzqRu2mn1vAIS/1cC sIhpER0kwuTGLA+Ygd0vpiSKG5OJKxb2rHgXPQi9nwbU6/Y7npPmqReVqPn/5ybbCLRn mLO3u9fBhElqd0m6JNJl4pDDbAmFOlrCbYJxA+Bi2Q0NWFTsDxl2nhsXE7OCq3m6QFVS bUMmsBBNnBjH0Nc9377rj22W4Ac6NcN0J17gUgrhdVXgmkIoWJ6q85rxaRkRf/iCyUE7 BnHc0D+GId6CnazJfrtQ7TBK8gDueKRFHcyCztK4sfDSuEBKoiKHRbY6bpLUihp3DGme o6IQ== 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=W1LJ1Ev958+v2cYpgmJ52/5bNelskmJS3SGOJ4WTHtA=; fh=B/m+iuu4FX6zTmlBKCkoPhWUmq0A4/odiW2IXQbUjD4=; b=hLpW51Y6jh5BXRYjZ6mZNa1oJrVzzN+2XqqREdHBWJG5RSVWJD4Nw3i10EOo1KqZ79 3ZaoQSqBfm0iAqTvGpB6Wvr/L5LJg6cjfjGJSYFfHcn/3XizymzxqkcjUP8+Zz5cuECV zSv1ILerOp2W6HM3a2V4iX/UPmEtU7u4KKR+8t2o4lj6vKmOwopd1WV+lPW63OKrDDqb GC3Og4lZvhhYz/NCpgANGq7ersDU9Zqs2uZMCRhgrn6TgjIGguT5BGuAH4LhOgidxWkP 6k9M/5EmeB2U1r42lpBjzqncyJxBYQk+u+zZzL2Sfhb1PRazeXvywKz9LfcMunFUYBKM Z/aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Djy35r/J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx19-20020a17090af49300b00263cee680ecsi2290430pjb.89.2023.07.05.12.45.31; Wed, 05 Jul 2023 12:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Djy35r/J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233291AbjGETFk (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233356AbjGETE5 (ORCPT ); Wed, 5 Jul 2023 15:04:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9150C19BF; Wed, 5 Jul 2023 12:03:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA8AF616EF; Wed, 5 Jul 2023 19:03:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C394C433C8; Wed, 5 Jul 2023 19:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583827; bh=7amT9DrYu70ALB4f/8ioI9ChjNtEorP9RC8mHDJNfS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Djy35r/JI60Pfe0ZiI+Z9tvfNL61rTokHFk5MxL+luQelNZiTKVK6XlUnKTqVOt7h 10wc/pvErEgXyHf2RIUkXE4zE0UH3TK539DVcK0STS8UwkLmUkQlS66S3CcESJUIjC AC8Hr7c/iVK6xSwF3K4jPkjuBHYKz6BBOczAdB0F23f+G6uCV10RTaUgr2OaFK+Esr snFQPsZmnj2p9zcyrG0UVBJOmgvGgCgXp07gJ6a38nxOzeW5Fo4L/+ar/BjgcCow6L wwYrrso5LR4MSzSjySjM4N3yXTZyJ2qAk7DRfIiMn2vE3HwCBbk1wo4IFo95+y6M58 6XAVG3Zw534ow== From: Jeff Layton To: Christian Brauner , Alexander Viro , Eric Biederman , Kees Cook Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 25/92] fs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:50 -0400 Message-ID: <20230705190309.579783-23-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611116633516984?= X-GMAIL-MSGID: =?utf-8?q?1770611116633516984?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/attr.c | 2 +- fs/bad_inode.c | 3 +-- fs/binfmt_misc.c | 3 +-- fs/inode.c | 10 +++++++--- fs/nsfs.c | 2 +- fs/pipe.c | 2 +- fs/posix_acl.c | 2 +- fs/stack.c | 2 +- fs/stat.c | 2 +- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index d60dc1edb526..599f6d14c0ed 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -312,7 +312,7 @@ void setattr_copy(struct mnt_idmap *idmap, struct inode *inode, if (ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_set_ctime_to_ts(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { umode_t mode = attr->ia_mode; if (!in_group_or_capable(idmap, inode, diff --git a/fs/bad_inode.c b/fs/bad_inode.c index db649487d58c..6e21f7412a85 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@ -209,8 +209,7 @@ void make_bad_inode(struct inode *inode) remove_inode_hash(inode); inode->i_mode = S_IFREG; - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_op = &bad_inode_ops; inode->i_opflags &= ~IOP_XATTR; inode->i_fop = &bad_file_ops; diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index bb202ad369d5..e0108d17b085 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -547,8 +547,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) if (inode) { inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } return inode; } diff --git a/fs/inode.c b/fs/inode.c index 21b026d95b51..32e08c3fa9ff 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1851,6 +1851,7 @@ EXPORT_SYMBOL(bmap); static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, struct timespec64 now) { + struct timespec64 ctime; if (!(mnt->mnt_flags & MNT_RELATIME)) return 1; @@ -1862,7 +1863,8 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, /* * Is ctime younger than or equal to atime? If yes, update atime: */ - if (timespec64_compare(&inode->i_ctime, &inode->i_atime) >= 0) + ctime = inode_get_ctime(inode); + if (timespec64_compare(&ctime, &inode->i_atime) >= 0) return 1; /* @@ -1885,7 +1887,7 @@ int generic_update_time(struct inode *inode, struct timespec64 *time, int flags) if (flags & S_ATIME) inode->i_atime = *time; if (flags & S_CTIME) - inode->i_ctime = *time; + inode_set_ctime_to_ts(inode, *time); if (flags & S_MTIME) inode->i_mtime = *time; @@ -2071,6 +2073,7 @@ EXPORT_SYMBOL(file_remove_privs); static int inode_needs_update_time(struct inode *inode, struct timespec64 *now) { int sync_it = 0; + struct timespec64 ctime; /* First try to exhaust all avenues to not sync */ if (IS_NOCMTIME(inode)) @@ -2079,7 +2082,8 @@ static int inode_needs_update_time(struct inode *inode, struct timespec64 *now) if (!timespec64_equal(&inode->i_mtime, now)) sync_it = S_MTIME; - if (!timespec64_equal(&inode->i_ctime, now)) + ctime = inode_get_ctime(inode); + if (!timespec64_equal(&ctime, now)) sync_it |= S_CTIME; if (IS_I_VERSION(inode) && inode_iversion_need_inc(inode)) diff --git a/fs/nsfs.c b/fs/nsfs.c index f602a96a1afe..647a22433bd8 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -84,7 +84,7 @@ static int __ns_get_path(struct path *path, struct ns_common *ns) return -ENOMEM; } inode->i_ino = ns->inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_flags |= S_IMMUTABLE; inode->i_mode = S_IFREG | S_IRUGO; inode->i_fop = &ns_file_operations; diff --git a/fs/pipe.c b/fs/pipe.c index 2d88f73f585a..174682103669 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -899,7 +899,7 @@ static struct inode * get_pipe_inode(void) inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); return inode; diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 7fa1b738bbab..a05fe94970ce 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -1027,7 +1027,7 @@ int simple_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, return error; } - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (IS_I_VERSION(inode)) inode_inc_iversion(inode); set_cached_acl(inode, type, acl); diff --git a/fs/stack.c b/fs/stack.c index c9830924eb12..b5e01bdb5f5f 100644 --- a/fs/stack.c +++ b/fs/stack.c @@ -68,7 +68,7 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src) dest->i_rdev = src->i_rdev; dest->i_atime = src->i_atime; dest->i_mtime = src->i_mtime; - dest->i_ctime = src->i_ctime; + inode_set_ctime_to_ts(dest, inode_get_ctime(src)); dest->i_blkbits = src->i_blkbits; dest->i_flags = src->i_flags; set_nlink(dest, src->i_nlink); diff --git a/fs/stat.c b/fs/stat.c index 7c238da22ef0..8c2b30af19f5 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -58,7 +58,7 @@ void generic_fillattr(struct mnt_idmap *idmap, struct inode *inode, stat->size = i_size_read(inode); stat->atime = inode->i_atime; stat->mtime = inode->i_mtime; - stat->ctime = inode->i_ctime; + stat->ctime = inode_get_ctime(inode); stat->blksize = i_blocksize(inode); stat->blocks = inode->i_blocks; } From patchwork Wed Jul 5 19:00:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116354 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096100vqx; Wed, 5 Jul 2023 12:41:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4IdIK+bAbj7kfvdeebXP3sE1mIGh7bRLkJSNePFhf/0IBB3sYa+VtuGBwRKoVvTA4OoXHx X-Received: by 2002:a05:6a20:5499:b0:12d:346f:d8ac with SMTP id i25-20020a056a20549900b0012d346fd8acmr22371558pzk.44.1688586106617; Wed, 05 Jul 2023 12:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586106; cv=none; d=google.com; s=arc-20160816; b=jhl/6YqXuASU4c04k1NGByZBDH3PU7y1dqxMYArIvijyMEOn2sgxoJJQfP+S8jb6Ab k1cTQ+Q7xKykM+e7MZEyoTmuh3VgSLKJi0/4/LA9wr+hzxKcdzvFZo3RtVAbXCBf2E/W mjN3uPkFp+6MXv6YHZ+aQSwz+ROSgLK5saw9S41fBlJHZh97WwNjy3QK7jYC/9Qb5vVR Kra0ewaT/lsfvZZM8laBmGJD4K/biakNR8YZYU/PQl+JaTtPHGj9XBzuE0qMC1V3avGf 6qNajdZYd26MryHv5oEaVaTS47tzOuxSQdlyh4ujIpNhbEoXA7SjVjPOQsvKyIWjioe9 59/w== 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=xw5NF1TWLFsv2fqLYMtpii4z/S8eGOCHw14/OfWvSBA=; fh=a8iI2bxkX551Ugp/D3SzbrEfdEB7XWg2kahEH2LbrM4=; b=QQwAdj7fPggK2pgYni9mzHdRIrCKCL4adwV7JUOPjEFguLpti9t8snAK4nvQDFOSEr kbaD4Gjr8qhkJAVP1Cs0fcc0z+1bM9HWK635967s8JLkAG4oHISac42xalOLjidzs19U XcE3nB6A8z2m7/XMssvagONsr2KFy4YPdmWqfsDSfUvgSaqp1T4fm//jdIIwdXymQhkt TA/HL2r8LsLWCAO5IJwUEkWaxyL2hm22W3v5d2TD3Fxuz/5bF9P773BB/ORtR/uREgy6 bDHcR/1dNXYGI09L/Xr2bWtBSo7N8c5lnLgfLC8NiEiwy+H6AudmBH0oNREv+lEY2amE syCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QL+9A8CR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv12-20020a056a00414c00b00676fd3ad23dsi20779902pfb.384.2023.07.05.12.41.34; Wed, 05 Jul 2023 12:41:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QL+9A8CR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233675AbjGETFz (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233663AbjGETFS (ORCPT ); Wed, 5 Jul 2023 15:05:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E99E269D; Wed, 5 Jul 2023 12:03:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 706B361659; Wed, 5 Jul 2023 19:03:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 350CEC433C8; Wed, 5 Jul 2023 19:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583828; bh=VKXzwQVEpqzwAn2zr28fV/ocLF/ZTfcqcAZm4WHBcUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QL+9A8CRS0JtOr1uR0GOj5A9Ne5Uh2DuRDFtt6sauq4vBdl9YbFxhrOnlAvEOBmi8 QiLozocDcw8otXcnlIOYHOY+Q3ufzOEb71eqpT+tR9UrYLp7eM8xwSYt6/7Tu+HN8f dg5ecqw0Ngs18gpqShHvR8YkWrsLa3mUerTocRqPs4bccL28SAzAfSwOapba/4tVPv BaMIrjKJslGoIksb4lLT0oTuTmSw+mhy2isJQWq9vxiDUax9xqGCaFvzOD12/VAoLf TaDyCtArYiYqZV47eh3z16ysFTJbNCWeGnqm2zP2SCkvIpBVNz1lwxlyO8NMMu1GPZ NrlJ746LIvDLw== From: Jeff Layton To: Christian Brauner , Ian Kent Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, autofs@vger.kernel.org Subject: [PATCH v2 26/92] autofs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:51 -0400 Message-ID: <20230705190309.579783-24-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610865324692959?= X-GMAIL-MSGID: =?utf-8?q?1770610865324692959?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Ian Kent Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/autofs/inode.c | 2 +- fs/autofs/root.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index affa70360b1f..2b49662ed237 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -370,7 +370,7 @@ struct inode *autofs_get_inode(struct super_block *sb, umode_t mode) inode->i_uid = d_inode(sb->s_root)->i_uid; inode->i_gid = d_inode(sb->s_root)->i_gid; } - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_ino = get_next_ino(); if (S_ISDIR(mode)) { diff --git a/fs/autofs/root.c b/fs/autofs/root.c index 93046c9dc461..512b9a26c63d 100644 --- a/fs/autofs/root.c +++ b/fs/autofs/root.c @@ -600,7 +600,7 @@ static int autofs_dir_symlink(struct mnt_idmap *idmap, p_ino = autofs_dentry_ino(dentry->d_parent); p_ino->count++; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); return 0; } @@ -633,7 +633,7 @@ static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry) d_inode(dentry)->i_size = 0; clear_nlink(d_inode(dentry)); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); spin_lock(&sbi->lookup_lock); __autofs_add_expiring(dentry); @@ -749,7 +749,7 @@ static int autofs_dir_mkdir(struct mnt_idmap *idmap, p_ino = autofs_dentry_ino(dentry->d_parent); p_ino->count++; inc_nlink(dir); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); return 0; } From patchwork Wed Jul 5 19:00:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095789vqx; Wed, 5 Jul 2023 12:41:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlFj5Tz9PPqcO04r1U0g/HuLQmTm06y81vdCBOICFtTHs2dyGZ9Wilm0FKwK/rNOsJNPAgDY X-Received: by 2002:a17:902:f544:b0:1b5:2b12:6f50 with SMTP id h4-20020a170902f54400b001b52b126f50mr15274039plf.12.1688586067703; Wed, 05 Jul 2023 12:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586067; cv=none; d=google.com; s=arc-20160816; b=MFJEtm/P7fHIjCYN+KOMJcvYiDWUHVcwLvAlrUoxYTf2+uInrbFSFH27w8QMkysN88 GPAbIuWRnFmCai66flr9UgL9ODpmfNsrjk1acxnTixz+jVik+9utgs4/Ac83uZr3ZTsB zF66ZTauUF0o1IsUReh32GNIvjTZCioqfsyN1mPR9C5dWwJILFCk6Ev1sLbVUVWBZxwN wbazIKZh2dt4JqVGeUT2falOQgB/0wwV7tEYSt4uNOygxnKz0Q1/mTQ0pLMk9YHrUvcr v/IV2Ww2+A/ee358DhetO0/+M0CqcBfN/njoP2ThA4G3APmWdxyJ6OOUOBFLzobKggZA Rdbg== 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=MjLlPyOezCDBUE27u26evd4DH1uIGYtnjxO39lIacyM=; fh=+EIqLGY28gjsI6vJqbPvHsG2taor7FkLkcE8lZlE7Oo=; b=PMQC1jdYzOOy6cOjtqPda/r08XFZSFOAQpK+ERDtGyXfeImsmY2D8FTVfWg75wpJBQ fM2HS+CrlorxtqcSd8b1fPrt5Zo+BcL/CpTL238CYHQES1KFuekfhGU8LkYPoXwbm20P rIRFb0z0zO5CVhPOxPOJD4I4s7tlEMaDyx6w7ydNx8ywT7qszUWokO0nlx7IJMiOjn5e Nae13Y8MnaoTMfkbedCTZtkUdA4v5ujjD9sVvgmf1yzC6bvLlA3tvUayc32LMpzwghPV OkZD/aVtb6UxqkTRpfJnSm7/CX75E3JQekGHdYRtVI2awtGM2WbGrhJfKoWhMQjBMA5Z LROA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BBxSrlLh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a170902e84400b001b87e0a8780si12292236plg.36.2023.07.05.12.40.52; Wed, 05 Jul 2023 12:41:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BBxSrlLh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233614AbjGETFn (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233606AbjGETFA (ORCPT ); Wed, 5 Jul 2023 15:05:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F184A1BCD; Wed, 5 Jul 2023 12:03:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D41A361702; Wed, 5 Jul 2023 19:03:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98412C433C9; Wed, 5 Jul 2023 19:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583830; bh=EkEDsbsq0gEwanNdh7DFtJ1vDCUiiAF7B/nTe8m875k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BBxSrlLhwot8ixu9Af7vP4IOcseCDxNSs9rRs5a/63QIOm6XbGKwsC816HQs2kvdp UTn+t3q0xhyWI5sau4Hc3lfzaafnm4OLXKZ6uDzLJqXpIrnpZF7W/A60OAIQ+vrGWX suV056vSmTk6M/6jGGVzkKsIoJNKvAcGkGArowRrynh0wdT2Sgol80nL2wa5nw2yxR bN4k5Co0U/eaXA1O0HkRaxwAMnc4INwMuIrsg2vWN4nF0k4c/p57B7vN6IkWqwPq5J CIFXBgU1n8k5YY43S1q/2WJEvoQ30hkc8/KA+66XHDoliieToqzokIVusEHRb1Zp7e ps1NxDN/64PyQ== From: Jeff Layton To: Christian Brauner , Luis de Bethencourt , Salah Triki Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 27/92] befs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:52 -0400 Message-ID: <20230705190309.579783-25-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610824588511092?= X-GMAIL-MSGID: =?utf-8?q?1770610824588511092?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/befs/linuxvfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index eee9237386e2..9a16a51fbb88 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -363,7 +363,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) inode->i_mtime.tv_sec = fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16; inode->i_mtime.tv_nsec = 0; /* lower 16 bits are not a time */ - inode->i_ctime = inode->i_mtime; + inode_set_ctime_to_ts(inode, inode->i_mtime); inode->i_atime = inode->i_mtime; befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num); From patchwork Wed Jul 5 19:00:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096317vqx; Wed, 5 Jul 2023 12:42:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NoZQzcFGtQGuQyGW4E34UIi+SKMbenBcZr5KxWlBnlj8OViK3PzY6whDwlbx02aXHklCD X-Received: by 2002:a05:6808:3096:b0:39a:bd0e:43d with SMTP id bl22-20020a056808309600b0039abd0e043dmr17454365oib.36.1688586136165; Wed, 05 Jul 2023 12:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586136; cv=none; d=google.com; s=arc-20160816; b=M9LxEwzpk6Zv504Eu7fe8/PFzeEmeP9VCEvPdBjIxHNLpy2lrCUGtpL7T0fEr57rpw 3+uxospcae+rfIwd0wk8hiGXuzDVqQ0B7oVXYTVbLVHhQA8hEzNDbzDx8hth5kX9ohM6 VO+/l1v/IFkDJlujsYHmlAY+6RqUMqQgGTkd5hQHM+yXLp8kiCLch9PkAcO2+Ze/wW1I JR30VlS2Unnif2p+w4KyJn3DV7gXzDlku2Q1ocWacrM70DrHo3r1FdxIK+M8CZox1Q3u 36hf40MESmCHddE45D18+s3V9niyw+870c79fOFuFuuKT0kJTzzIMkx0EN99PJLNpIQu SRfw== 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=ieoBlkdOOTurFxvzAw3ag4TWwh/b+QATBaiU6kJw2qo=; fh=AzeZTaQ1KKvSmmikrtHSu0y2fSYyJQkmMYXLo/U8qIs=; b=t9ZqgYY/vHYb6NdHOgK0q87iktGfsZ5X43mJMXfBrfQNn1ruNpLQ8x0Iya5HpTRyC7 bQxMV8aX4OmuOVVU7Z8Sl5kjwksl5gSNccS5riNCKLOCAFNHxpZyURdFSws6c81pIrHF RPATGu75tFcDorn4ZExb/2H3Bt3dS/Lzktuhe2xTsQBuCsnL76hrgCnwz8MzLib5AMxF l729vYcxfuS9lSSouywgblSAcg+CwGVprDn/buQIlz/WfX3lWMghFHTh6gXevvFhnCH+ RVQZiaeq9IZER9JSRs0Fu2SJmw/yh7FXWw0Cc8GtysR7P0LjE52Vs5SbwhEhhM296Xdy geAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CIlJTiQA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a634617000000b005576fecf094si23475647pga.2.2023.07.05.12.42.02; Wed, 05 Jul 2023 12:42:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CIlJTiQA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233751AbjGETFv (ORCPT + 99 others); Wed, 5 Jul 2023 15:05:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233707AbjGETFP (ORCPT ); Wed, 5 Jul 2023 15:05:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 641952699; Wed, 5 Jul 2023 12:03:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 639BD61701; Wed, 5 Jul 2023 19:03:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3905CC433C8; Wed, 5 Jul 2023 19:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583831; bh=q+AolKk5Qd5HjhRfDaJMmThWb5Ke6kzXDESezzezSpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CIlJTiQAJFdr7tYOf69y5XoUmE5D3VGRoqvZvL3JPtMG3YgIrQSeUQ3gooUjRLa+P 2UD2s+b2Gm5eFayBwCmoKaGwJL0cuTbR9GCPtU0RuTQvJ/TMcYLYhilsQNDBKtCGns jvinl4mpkOD/mXLBjhgDhmF95+8Q04Kbrovqr0r6lohluWAamFUZ2n6HgVTFpnzq7N I7/a1I69wpk1Ycyb9uYt+LmFeb2jpRwWcIm+TB8Xgi2G8MsBW5qn3CBkGyny4h2kGQ TAaAfwK3rYJjECWy0HUhMSMysoTHme8UO7B/R1DFNHIdqd40Vf9Xll4++e2We/Bvsb QiUmVumnwAfew== From: Jeff Layton To: Christian Brauner , "Tigran A. Aivazian" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 28/92] bfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:53 -0400 Message-ID: <20230705190309.579783-26-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610896334122319?= X-GMAIL-MSGID: =?utf-8?q?1770610896334122319?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/bfs/dir.c | 16 ++++++++-------- fs/bfs/inode.c | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index d2e8a2a56b05..12b8af04dcb3 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c @@ -97,7 +97,7 @@ static int bfs_create(struct mnt_idmap *idmap, struct inode *dir, set_bit(ino, info->si_imap); info->si_freei--; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_blocks = 0; inode->i_op = &bfs_file_inops; inode->i_fop = &bfs_file_operations; @@ -158,7 +158,7 @@ static int bfs_link(struct dentry *old, struct inode *dir, return err; } inc_nlink(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); ihold(inode); d_instantiate(new, inode); @@ -187,9 +187,9 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry) } de->ino = 0; mark_buffer_dirty_inode(bh, dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); inode_dec_link_count(inode); error = 0; @@ -240,10 +240,10 @@ static int bfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, goto end_rename; } old_de->ino = 0; - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + old_dir->i_mtime = inode_set_ctime_current(old_dir); mark_inode_dirty(old_dir); if (new_inode) { - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); inode_dec_link_count(new_inode); } mark_buffer_dirty_inode(old_bh, old_dir); @@ -292,9 +292,9 @@ static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) pos = (block - sblock) * BFS_BSIZE + off; if (pos >= dir->i_size) { dir->i_size += BFS_DIRENT_SIZE; - dir->i_ctime = current_time(dir); + inode_set_ctime_current(dir); } - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); de->ino = cpu_to_le16((u16)ino); for (i = 0; i < BFS_NAMELEN; i++) diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 1926bec2c850..e6a76ae9eb44 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -82,10 +82,9 @@ struct inode *bfs_iget(struct super_block *sb, unsigned long ino) inode->i_blocks = BFS_FILEBLOCKS(di); inode->i_atime.tv_sec = le32_to_cpu(di->i_atime); inode->i_mtime.tv_sec = le32_to_cpu(di->i_mtime); - inode->i_ctime.tv_sec = le32_to_cpu(di->i_ctime); + inode_set_ctime(inode, le32_to_cpu(di->i_ctime), 0); inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; brelse(bh); unlock_new_inode(inode); @@ -143,7 +142,7 @@ static int bfs_write_inode(struct inode *inode, struct writeback_control *wbc) di->i_nlink = cpu_to_le32(inode->i_nlink); di->i_atime = cpu_to_le32(inode->i_atime.tv_sec); di->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); - di->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec); + di->i_ctime = cpu_to_le32(inode_get_ctime(inode).tv_sec); i_sblock = BFS_I(inode)->i_sblock; di->i_sblock = cpu_to_le32(i_sblock); di->i_eblock = cpu_to_le32(BFS_I(inode)->i_eblock); From patchwork Wed Jul 5 19:00:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095405vqx; Wed, 5 Jul 2023 12:40:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bbb7PjW/QCJ2SpltzM0JJKdr7FL8Bv0drF0OG6p5FEXWhc13Cqe8XMfjzT0sa2pprxexo X-Received: by 2002:a05:6808:1986:b0:39e:d559:61fc with SMTP id bj6-20020a056808198600b0039ed55961fcmr19846765oib.30.1688586017754; Wed, 05 Jul 2023 12:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586017; cv=none; d=google.com; s=arc-20160816; b=ZB3u2A+oee7YQCh0hf+N9fBhJ976t9sdqhsxC/Kb30lUpYcXu6BR7OJJohk09FOMhY 2PCKFv9pePLaRM+/k5pz8otna3YYwuaWQ24u1NzvP8GX9GZRoWKbhDoPIdm22O5TiiZk QGgIbQmw286+yxKdMXSBXyezJGKWFKekQ2G4ima0axBoVLXBmxGTJmdGb35cxjL1FfTZ NDn4giJ5duJ09Ry1Rcx8vEgfUdN5an3YpihULtWLp1KGCyJzZ8d2PlGOpQfNQaPNjEDU ilUKBT0OmlAUWZOowncUlGou+7DmVkb/XC69TBcu373Bs6gZTzK1WUyvIIU2OS7uvM2u ce7A== 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=6U7tg9NcUgpNqgaFCptB1u7gByZhjQRNoZLN9JA78LA=; fh=+m02MSv56yOKV/hJBHUvILXEeWhcMnvNeC2jSpXhgRA=; b=aLk87QGpZIT5Eyubj6GccyBpwpOdyUYI4SDchbQ3O4G3HwYi7NTYgEVVqkgW5nnMS4 /srLR0WwIyD95bhXjK+yqDYYOoJOAOy4/wdtD43QaKZ36B7xICNPsa+Y7umt98VrZrMI sN91dv0jgYt7dAvYyUrW8zQJdEbjyDLFnQiFsHAqxr5f9NCXQcPs/lP+G7h7iv03WGbk rQI14aL34JTGyGJGotAc3N2It/96OkR4GvFiabl15nDXashHn9J2ByDR4XxGSd19UVin cu14tC283R3oZp/OSDnLXqsVHWwMoicMPoUykXbHUVbrgcn4pLXQ/bx04V2Kf2JuXHWw deqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hnPzgXUP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a63c14b000000b0053f2551834fsi23298518pgi.552.2023.07.05.12.40.03; Wed, 05 Jul 2023 12:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hnPzgXUP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233784AbjGETGH (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233581AbjGETF0 (ORCPT ); Wed, 5 Jul 2023 15:05:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1989D198B; Wed, 5 Jul 2023 12:03:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 36D5261707; Wed, 5 Jul 2023 19:03:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1735C433CA; Wed, 5 Jul 2023 19:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583834; bh=tXQqpdr5LMuFhhQjRHrn1pEJrvaZj3E1BAr+ANA4Ew0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hnPzgXUPIUCoXqTctDBSvlACegAOSQA17MXGF56Tnwj7ORXx2hRvSBaQXQDFt5h8F mpC3wQdeXMIQTW+UxxOeSYvpWKaDuYeA6OZyom3XW06cWIu8CqH4nj+akZOnK9NT+X fcyBDMfXOFOZME5oaETvMtYMUyCaFG2lsLrUWFM/Uezx5mGmmrAYy0i6WzSd83B0hY z8tQqJxDanOje5gnZqST0/Zh9NkA6UMusDh0yW7blsNvadjrZ+dHkBE0B/wtGbe8J1 MXkTvjKKO6qlrSHRyHHS26y/VThHECkbGzxp1hmgdVncKJwXw5lN+0VW+3cMXhU7Y/ GNkk3A7u9K1xw== From: Jeff Layton To: Christian Brauner , Chris Mason , Josef Bacik , David Sterba Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: [PATCH v2 29/92] btrfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:54 -0400 Message-ID: <20230705190309.579783-27-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610771886561917?= X-GMAIL-MSGID: =?utf-8?q?1770610771886561917?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/btrfs/delayed-inode.c | 8 ++++---- fs/btrfs/file.c | 21 +++++++++------------ fs/btrfs/inode.c | 39 ++++++++++++++++----------------------- fs/btrfs/ioctl.c | 2 +- fs/btrfs/reflink.c | 3 +-- fs/btrfs/transaction.c | 3 +-- fs/btrfs/tree-log.c | 4 ++-- fs/btrfs/xattr.c | 4 ++-- 8 files changed, 36 insertions(+), 48 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index c0a6a1784697..e2753d228037 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1808,9 +1808,9 @@ static void fill_stack_inode_item(struct btrfs_trans_handle *trans, inode->i_mtime.tv_nsec); btrfs_set_stack_timespec_sec(&inode_item->ctime, - inode->i_ctime.tv_sec); + inode_get_ctime(inode).tv_sec); btrfs_set_stack_timespec_nsec(&inode_item->ctime, - inode->i_ctime.tv_nsec); + inode_get_ctime(inode).tv_nsec); btrfs_set_stack_timespec_sec(&inode_item->otime, BTRFS_I(inode)->i_otime.tv_sec); @@ -1861,8 +1861,8 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev) inode->i_mtime.tv_sec = btrfs_stack_timespec_sec(&inode_item->mtime); inode->i_mtime.tv_nsec = btrfs_stack_timespec_nsec(&inode_item->mtime); - inode->i_ctime.tv_sec = btrfs_stack_timespec_sec(&inode_item->ctime); - inode->i_ctime.tv_nsec = btrfs_stack_timespec_nsec(&inode_item->ctime); + inode_set_ctime(inode, btrfs_stack_timespec_sec(&inode_item->ctime), + btrfs_stack_timespec_nsec(&inode_item->ctime)); BTRFS_I(inode)->i_otime.tv_sec = btrfs_stack_timespec_sec(&inode_item->otime); diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fd03e689a6be..d7a9ece7a40b 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1108,7 +1108,7 @@ void btrfs_check_nocow_unlock(struct btrfs_inode *inode) static void update_time_for_write(struct inode *inode) { - struct timespec64 now; + struct timespec64 now, ctime; if (IS_NOCMTIME(inode)) return; @@ -1117,8 +1117,9 @@ static void update_time_for_write(struct inode *inode) if (!timespec64_equal(&inode->i_mtime, &now)) inode->i_mtime = now; - if (!timespec64_equal(&inode->i_ctime, &now)) - inode->i_ctime = now; + ctime = inode_get_ctime(inode); + if (!timespec64_equal(&ctime, &now)) + inode_set_ctime_to_ts(inode, now); if (IS_I_VERSION(inode)) inode_inc_iversion(inode); @@ -2459,10 +2460,8 @@ int btrfs_replace_file_extents(struct btrfs_inode *inode, */ inode_inc_iversion(&inode->vfs_inode); - if (!extent_info || extent_info->update_times) { - inode->vfs_inode.i_mtime = current_time(&inode->vfs_inode); - inode->vfs_inode.i_ctime = inode->vfs_inode.i_mtime; - } + if (!extent_info || extent_info->update_times) + inode->vfs_inode.i_mtime = inode_set_ctime_current(&inode->vfs_inode); ret = btrfs_update_inode(trans, root, inode); if (ret) @@ -2703,8 +2702,7 @@ static int btrfs_punch_hole(struct file *file, loff_t offset, loff_t len) ASSERT(trans != NULL); inode_inc_iversion(inode); - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; + inode->i_mtime = inode_set_ctime_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); updated_inode = true; btrfs_end_transaction(trans); @@ -2721,11 +2719,10 @@ static int btrfs_punch_hole(struct file *file, loff_t offset, loff_t len) * for detecting, at fsync time, if the inode isn't yet in the * log tree or it's there but not up to date. */ - struct timespec64 now = current_time(inode); + struct timespec64 now = inode_set_ctime_current(inode); inode_inc_iversion(inode); inode->i_mtime = now; - inode->i_ctime = now; trans = btrfs_start_transaction(root, 1); if (IS_ERR(trans)) { ret = PTR_ERR(trans); @@ -2796,7 +2793,7 @@ static int btrfs_fallocate_update_isize(struct inode *inode, if (IS_ERR(trans)) return PTR_ERR(trans); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); i_size_write(inode, end); btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 521c08b8ad04..daa47a2238bd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3901,8 +3901,8 @@ static int btrfs_read_locked_inode(struct inode *inode, inode->i_mtime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->mtime); inode->i_mtime.tv_nsec = btrfs_timespec_nsec(leaf, &inode_item->mtime); - inode->i_ctime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->ctime); - inode->i_ctime.tv_nsec = btrfs_timespec_nsec(leaf, &inode_item->ctime); + inode_set_ctime(inode, btrfs_timespec_sec(leaf, &inode_item->ctime), + btrfs_timespec_nsec(leaf, &inode_item->ctime)); BTRFS_I(inode)->i_otime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->otime); @@ -4073,9 +4073,9 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, inode->i_mtime.tv_nsec); btrfs_set_token_timespec_sec(&token, &item->ctime, - inode->i_ctime.tv_sec); + inode_get_ctime(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode->i_ctime.tv_nsec); + inode_get_ctime(inode).tv_nsec); btrfs_set_token_timespec_sec(&token, &item->otime, BTRFS_I(inode)->i_otime.tv_sec); @@ -4273,9 +4273,8 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, btrfs_i_size_write(dir, dir->vfs_inode.i_size - name->len * 2); inode_inc_iversion(&inode->vfs_inode); inode_inc_iversion(&dir->vfs_inode); - inode->vfs_inode.i_ctime = current_time(&inode->vfs_inode); - dir->vfs_inode.i_mtime = inode->vfs_inode.i_ctime; - dir->vfs_inode.i_ctime = inode->vfs_inode.i_ctime; + inode_set_ctime_current(&inode->vfs_inode); + dir->vfs_inode.i_mtime = inode_set_ctime_current(&dir->vfs_inode); ret = btrfs_update_inode(trans, root, dir); out: return ret; @@ -4448,8 +4447,7 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, btrfs_i_size_write(dir, dir->vfs_inode.i_size - fname.disk_name.len * 2); inode_inc_iversion(&dir->vfs_inode); - dir->vfs_inode.i_mtime = current_time(&dir->vfs_inode); - dir->vfs_inode.i_ctime = dir->vfs_inode.i_mtime; + dir->vfs_inode.i_mtime = inode_set_ctime_current(&dir->vfs_inode); ret = btrfs_update_inode_fallback(trans, root, dir); if (ret) btrfs_abort_transaction(trans, ret); @@ -5091,8 +5089,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr) if (newsize != oldsize) { inode_inc_iversion(inode); if (!(mask & (ATTR_CTIME | ATTR_MTIME))) { - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; + inode->i_mtime = inode_set_ctime_current(inode); } } @@ -5736,9 +5733,8 @@ static struct inode *new_simple_dir(struct super_block *s, inode->i_opflags &= ~IOP_XATTR; inode->i_fop = &simple_dir_operations; inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; - inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); inode->i_atime = inode->i_mtime; - inode->i_ctime = inode->i_mtime; BTRFS_I(inode)->i_otime = inode->i_mtime; return inode; @@ -6075,7 +6071,7 @@ static int btrfs_update_time(struct inode *inode, struct timespec64 *now, if (flags & S_VERSION) dirty |= inode_maybe_inc_iversion(inode, dirty); if (flags & S_CTIME) - inode->i_ctime = *now; + inode_set_ctime_to_ts(inode, *now); if (flags & S_MTIME) inode->i_mtime = *now; if (flags & S_ATIME) @@ -6378,9 +6374,8 @@ int btrfs_create_new_inode(struct btrfs_trans_handle *trans, goto discard; } - inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); inode->i_atime = inode->i_mtime; - inode->i_ctime = inode->i_mtime; BTRFS_I(inode)->i_otime = inode->i_mtime; /* @@ -6545,12 +6540,10 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, * log replay procedure is responsible for setting them to their correct * values (the ones it had when the fsync was done). */ - if (!test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) { - struct timespec64 now = current_time(&parent_inode->vfs_inode); + if (!test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) + parent_inode->vfs_inode.i_mtime = + inode_set_ctime_current(&parent_inode->vfs_inode); - parent_inode->vfs_inode.i_mtime = now; - parent_inode->vfs_inode.i_ctime = now; - } ret = btrfs_update_inode(trans, root, parent_inode); if (ret) btrfs_abort_transaction(trans, ret); @@ -6690,7 +6683,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, BTRFS_I(inode)->dir_index = 0ULL; inc_nlink(inode); inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); ihold(inode); set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); @@ -9733,7 +9726,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode, *alloc_hint = ins.objectid + ins.offset; inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; if (!(mode & FALLOC_FL_KEEP_SIZE) && (actual_len > inode->i_size) && diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a895d105464b..a18ee7b5a166 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -384,7 +384,7 @@ int btrfs_fileattr_set(struct mnt_idmap *idmap, binode->flags = binode_flags; btrfs_sync_inode_flags_to_i_flags(inode); inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); out_end_trans: diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c index 0474bbe39da7..65d2bd6910f2 100644 --- a/fs/btrfs/reflink.c +++ b/fs/btrfs/reflink.c @@ -30,8 +30,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans, inode_inc_iversion(inode); if (!no_time_update) { - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; + inode->i_mtime = inode_set_ctime_current(inode); } /* * We round up to the block size at eof when determining which diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index e7cfc992e02a..d8d20ea5a41f 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1831,8 +1831,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, btrfs_i_size_write(BTRFS_I(parent_inode), parent_inode->i_size + fname.disk_name.len * 2); - parent_inode->i_mtime = current_time(parent_inode); - parent_inode->i_ctime = parent_inode->i_mtime; + parent_inode->i_mtime = inode_set_ctime_current(parent_inode); ret = btrfs_update_inode_fallback(trans, parent_root, BTRFS_I(parent_inode)); if (ret) { btrfs_abort_transaction(trans, ret); diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 365a1cc0a3c3..ffcff7188170 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4148,9 +4148,9 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, inode->i_mtime.tv_nsec); btrfs_set_token_timespec_sec(&token, &item->ctime, - inode->i_ctime.tv_sec); + inode_get_ctime(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode->i_ctime.tv_nsec); + inode_get_ctime(inode).tv_nsec); /* * We do not need to set the nbytes field, in fact during a fast fsync diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index fc4b20c2688a..96828a13dd43 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -264,7 +264,7 @@ int btrfs_setxattr_trans(struct inode *inode, const char *name, goto out; inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); if (ret) btrfs_abort_transaction(trans, ret); @@ -407,7 +407,7 @@ static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler, ret = btrfs_set_prop(trans, inode, name, value, size, flags); if (!ret) { inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); if (ret) btrfs_abort_transaction(trans, ret); From patchwork Wed Jul 5 19:00:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2094691vqx; Wed, 5 Jul 2023 12:38:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70UbRRAEvl4lZaRFcph/0k7C44fA/AstQ0FLr9UFvPMprkTx9HzBr+m3zYfyzTiR3mafba X-Received: by 2002:a05:6a20:9385:b0:12c:df89:502a with SMTP id x5-20020a056a20938500b0012cdf89502amr21842055pzh.52.1688585926049; Wed, 05 Jul 2023 12:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585926; cv=none; d=google.com; s=arc-20160816; b=QvHR1obWOHUhq3PMCIqAI4mIRIQE3okYB0woS0OO0s5MrBS4l6ly/oNmmYuhBVDUIE 5LGe+9dG66vZjkzIEHeLgy2jnJFfxTRC+mM1YzBddSKBADCYqu36MpBJrxAE+sY4skSN Ax4Tgx0Ro9TeH2bx55apx/bQgkJ6SiliUR3S1+q/s2WFFjBwQV4pTuLSG22xKUh3qPpa 2dVIEuuVBWAc2yBeuXzK/hDDQSSjDoefrwNZN1DCjZ73kj2A+Bp7uC6GEQgvXNGnYZ+O jRRSy3Zx+eGX3OvhkVXaO8Bu85lWjJFz8DCjl7atgxc7RxcLwTGo25JG3lI5DNuZmyvB MffA== 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=3dqhRCuxYDtZC8DjKX2SQucK7BXrLlO4RdmdUEnmSog=; fh=r/64C+grae6tPwlRgDX/wCiorB4uPIiFgwzJkSoEMfo=; b=Bhxu6CtgkYaNegtX/XCQEmo6mhMyYezgQUJmjmDD3VddceDn2zbOs5yHKUs7yJcsLj 8ny3AIJAVNTtRqCBusH0YVJqJ1WQNbCdv6Wref3GH8hWxA1kPHgpEbTOnzozY9KUNtrx TMtzAJKNoonLGUrkd8J0gZbJtbjbEh1CiXxOY+N50bUNztNGeuvGPwgCyKvC/QvujacE 2YQXkH/ESr9ly9KsAfG0PvZ62a9XpW8G95loePTvoeC8s/lNcYyNv7V4JYpDZilM1jcp DxwoCk6AciFErhIpOz/PtM957fxbtL2RWjnlobpF+T6YJ4i5mzewdklfUz1XDN2fVkhQ Qxuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DbAiKeFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a634617000000b005576fecf094si23475647pga.2.2023.07.05.12.38.33; Wed, 05 Jul 2023 12:38:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DbAiKeFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbjGETGE (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233423AbjGETF0 (ORCPT ); Wed, 5 Jul 2023 15:05:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B97A526AB; Wed, 5 Jul 2023 12:03:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54F0161705; Wed, 5 Jul 2023 19:03:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07038C433C7; Wed, 5 Jul 2023 19:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583836; bh=agaQfFLs97B/2laDvZLTXaipIE9mmbV688h50qblTPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DbAiKeFwgLo61vRFNDyy+Zg2tk4IEJSRgdihuWLOcuSYFYDLHRWkc3bFDWt2pv+6p YYlkIHYAwU7f3QBhErbQ09dAHiCR/lrKLDRn2zFvLgAir7wREK3FzSp2Cy5nbr6wBX Bkqv2A7eixzvZyQhIC/ywkVCTP3o3xcmdGmy/SXDsANqZdBTVosQyTLibPeQvT0nH2 9lIoK6yQ+XKQVKNZFq93MI+ZCmEoNc7zpdEPf4199iQEq5v2ZcpH35i4ReN7JYS7jn XFrziUiZH8LCk2pjVadEMShdoXf/dphspLeh8uuEkGUoy3eltkz6K85WcGeoL81wZN VAh6z9WNkzWXQ== From: Jeff Layton To: Christian Brauner , Xiubo Li , Ilya Dryomov Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org Subject: [PATCH v2 30/92] ceph: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:55 -0400 Message-ID: <20230705190309.579783-28-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610675851925978?= X-GMAIL-MSGID: =?utf-8?q?1770610675851925978?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Xiubo Li Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ceph/acl.c | 2 +- fs/ceph/caps.c | 2 +- fs/ceph/inode.c | 17 ++++++++++------- fs/ceph/snap.c | 2 +- fs/ceph/xattr.c | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c index 6945a938d396..c91b293267d7 100644 --- a/fs/ceph/acl.c +++ b/fs/ceph/acl.c @@ -93,7 +93,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, char *value = NULL; struct iattr newattrs; struct inode *inode = d_inode(dentry); - struct timespec64 old_ctime = inode->i_ctime; + struct timespec64 old_ctime = inode_get_ctime(inode); umode_t new_mode = inode->i_mode, old_mode = inode->i_mode; if (ceph_snap(inode) != CEPH_NOSNAP) { diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index e2bb0d0072da..09cd6d334604 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1400,7 +1400,7 @@ static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap, arg->mtime = inode->i_mtime; arg->atime = inode->i_atime; - arg->ctime = inode->i_ctime; + arg->ctime = inode_get_ctime(inode); arg->btime = ci->i_btime; arg->change_attr = inode_peek_iversion_raw(inode); diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 8e5f41d45283..bcdb1a0beccf 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -100,7 +100,7 @@ struct inode *ceph_get_snapdir(struct inode *parent) inode->i_uid = parent->i_uid; inode->i_gid = parent->i_gid; inode->i_mtime = parent->i_mtime; - inode->i_ctime = parent->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(parent)); inode->i_atime = parent->i_atime; ci->i_rbytes = 0; ci->i_btime = ceph_inode(parent)->i_btime; @@ -688,6 +688,7 @@ void ceph_fill_file_time(struct inode *inode, int issued, struct timespec64 *mtime, struct timespec64 *atime) { struct ceph_inode_info *ci = ceph_inode(inode); + struct timespec64 ictime = inode_get_ctime(inode); int warn = 0; if (issued & (CEPH_CAP_FILE_EXCL| @@ -696,11 +697,12 @@ void ceph_fill_file_time(struct inode *inode, int issued, CEPH_CAP_AUTH_EXCL| CEPH_CAP_XATTR_EXCL)) { if (ci->i_version == 0 || - timespec64_compare(ctime, &inode->i_ctime) > 0) { + timespec64_compare(ctime, &ictime) > 0) { dout("ctime %lld.%09ld -> %lld.%09ld inc w/ cap\n", - inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, + inode_get_ctime(inode).tv_sec, + inode_get_ctime(inode).tv_nsec, ctime->tv_sec, ctime->tv_nsec); - inode->i_ctime = *ctime; + inode_set_ctime_to_ts(inode, *ctime); } if (ci->i_version == 0 || ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { @@ -738,7 +740,7 @@ void ceph_fill_file_time(struct inode *inode, int issued, } else { /* we have no write|excl caps; whatever the MDS says is true */ if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { - inode->i_ctime = *ctime; + inode_set_ctime_to_ts(inode, *ctime); inode->i_mtime = *mtime; inode->i_atime = *atime; ci->i_time_warp_seq = time_warp_seq; @@ -2166,7 +2168,8 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) bool only = (ia_valid & (ATTR_SIZE|ATTR_MTIME|ATTR_ATIME| ATTR_MODE|ATTR_UID|ATTR_GID)) == 0; dout("setattr %p ctime %lld.%ld -> %lld.%ld (%s)\n", inode, - inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, + inode_get_ctime(inode).tv_sec, + inode_get_ctime(inode).tv_nsec, attr->ia_ctime.tv_sec, attr->ia_ctime.tv_nsec, only ? "ctime only" : "ignored"); if (only) { @@ -2191,7 +2194,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) if (dirtied) { inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, &prealloc_cf); - inode->i_ctime = attr->ia_ctime; + inode_set_ctime_to_ts(inode, attr->ia_ctime); inode_inc_iversion_raw(inode); } diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 343d738448dc..c9920ade15f5 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -660,7 +660,7 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, capsnap->size = i_size_read(inode); capsnap->mtime = inode->i_mtime; capsnap->atime = inode->i_atime; - capsnap->ctime = inode->i_ctime; + capsnap->ctime = inode_get_ctime(inode); capsnap->btime = ci->i_btime; capsnap->change_attr = inode_peek_iversion_raw(inode); capsnap->time_warp_seq = ci->i_time_warp_seq; diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 806183959c47..1cbd84cc82a8 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -1238,7 +1238,7 @@ int __ceph_setxattr(struct inode *inode, const char *name, dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL, &prealloc_cf); ci->i_xattrs.dirty = true; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); } spin_unlock(&ci->i_ceph_lock); From patchwork Wed Jul 5 19:00:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116374 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097072vqx; Wed, 5 Jul 2023 12:44:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlF+IhC7jYaaE/lyocmz/l1/8LPn2qD6KcNJNUJ13aNq7j0/0Ls6zDLW4qrwoDCGlFLKhu8z X-Received: by 2002:a05:6a20:158a:b0:12f:b9aa:ffc4 with SMTP id h10-20020a056a20158a00b0012fb9aaffc4mr2474033pzj.28.1688586240802; Wed, 05 Jul 2023 12:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586240; cv=none; d=google.com; s=arc-20160816; b=d/E8DtvzBv8adQya9+wMUBCRyC6KWzkqpMIYU7P0Is9WXnTGHKKOqZqhEpICuQyi8l xxrXc16l1+DTs1ldtDOhK8yhAJcyuG8aNleQIiXoGilR30T2RY0lJ6svtGkwV1xvBUr4 XsvxKegwyYIIYqeYdxIptNspgsBkehnR02zsGy2tclaEsXnHAU9eKQm83aoMLADJEaKG nSvae91l1Cgdieq1Chkb/+5z/YB8DvSrp1dLueaksU0x1AYEzVYQpHGn/j+eQUMmaEuF lAA86UsDN7dzXJc299b8L1S7hIg+Cie+myeUwtRJNYqBcg727ThbHTIhmpiYrZw/vV+z hLyw== 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=0GRs2O2qZkROChFzjkPSmnR70AXhVvKyeeaBwaGKwRE=; fh=DizfKaVs8aKEvXlArxYJWsV1Ghx5ly07uDU8k8uuwZI=; b=HsWHzbAXe3V6vCTnFH8tSk26EDd0id71fit3wJAveXgAJ9duTe946aFDiezfXxihp3 qiyVkzNeVamBopmHXqHXLqQ0RP9JGxgh4DqNaXnrvagKjFPBbau8gCvac+yNErVhph4t cGGHtzeT56IBaS7uGuxoba947YG63ZiE9S5j0CBRiU0QmPq01/1YMLPGrLM6cOzN7r/Z W6dM+dO8cMeo396Fm415X1AaOCxQFsKEK9nNhMp6vpDW3loAwIKB5GdcIE+X98KPoiqL /4gy7RppUzsUMmHMH/l+Q354mFwuMQMYEBBimPoydvawcC8mbjYH6DMsWrVse6qHiwQD sFng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BMduXHxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b001b3f9cedbb7si21935161plr.398.2023.07.05.12.43.46; Wed, 05 Jul 2023 12:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BMduXHxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233790AbjGETGY (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbjGETFk (ORCPT ); Wed, 5 Jul 2023 15:05:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D221226BC; Wed, 5 Jul 2023 12:04:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54733616F4; Wed, 5 Jul 2023 19:03:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01CDDC433C8; Wed, 5 Jul 2023 19:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583838; bh=/ofqfygaQhpzuHURS13Tugz1rrEcdSJN70uEQLUNyc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BMduXHxC5Ivtd2IdCY0O9tJt0hGMXyrwpA/yVvc3tBwz4FrCpQqps8SIc8rT43idR 3CZxOOiiPUZZTQ55Lre6+YDrMbYGaTdP/w1SPPwGeVdhgSJcOJ8vSgYkzEtgN+EI++ CBn+HM7Gga7HddiZmreoNPBfE8U/ureuwwaV/J9b1dkXvxRFTQulVcO6Uk36Iax5Bt DqYp3MGQ7PpEpiepHo8csmWql331rhDqHNFXLJgWOzbWAx40TFU1nz3gl9xDJbjxRV iiR/fZbIQpedK/hVCp6JWMk/GNsoz7nkluIKP1M/HQM3CDhApu6v7ebc3I2SND8eqI cjdLJCLjBdInQ== From: Jeff Layton To: Christian Brauner , Jan Harkes , coda@cs.cmu.edu Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, codalist@coda.cs.cmu.edu Subject: [PATCH v2 31/92] coda: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:56 -0400 Message-ID: <20230705190309.579783-29-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611005903048319?= X-GMAIL-MSGID: =?utf-8?q?1770611005903048319?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/coda/coda_linux.c | 3 ++- fs/coda/dir.c | 2 +- fs/coda/file.c | 2 +- fs/coda/inode.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c index 903ca8fa4b9b..ae023853a98f 100644 --- a/fs/coda/coda_linux.c +++ b/fs/coda/coda_linux.c @@ -127,7 +127,8 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) if (attr->va_mtime.tv_sec != -1) inode->i_mtime = coda_to_timespec64(attr->va_mtime); if (attr->va_ctime.tv_sec != -1) - inode->i_ctime = coda_to_timespec64(attr->va_ctime); + inode_set_ctime_to_ts(inode, + coda_to_timespec64(attr->va_ctime)); } diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 8450b1bd354b..1d4f40048efc 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -111,7 +111,7 @@ static inline void coda_dir_update_mtime(struct inode *dir) /* optimistically we can also act as if our nose bleeds. The * granularity of the mtime is coarse anyways so we might actually be * right most of the time. Note: we only do this for directories. */ - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); #endif } diff --git a/fs/coda/file.c b/fs/coda/file.c index 12b26bd13564..42346618b4ed 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c @@ -84,7 +84,7 @@ coda_file_write_iter(struct kiocb *iocb, struct iov_iter *to) ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos, 0); coda_inode->i_size = file_inode(host_file)->i_size; coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9; - coda_inode->i_mtime = coda_inode->i_ctime = current_time(coda_inode); + coda_inode->i_mtime = inode_set_ctime_current(coda_inode); inode_unlock(coda_inode); file_end_write(host_file); diff --git a/fs/coda/inode.c b/fs/coda/inode.c index d661e6cf17ac..3e64679c1620 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -269,7 +269,7 @@ int coda_setattr(struct mnt_idmap *idmap, struct dentry *de, memset(&vattr, 0, sizeof(vattr)); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); coda_iattr_to_vattr(iattr, &vattr); vattr.va_type = C_VNON; /* cannot set type */ From patchwork Wed Jul 5 19:00:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2085314vqx; Wed, 5 Jul 2023 12:19:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXd8M4R3wKRDyG96MsOtxm23f/2KKMZN9tr1tk6SwoABzJt1YK2upqrp3xvFHStmzi26Vf X-Received: by 2002:a17:902:da92:b0:1b8:6a47:705f with SMTP id j18-20020a170902da9200b001b86a47705fmr19566805plx.69.1688584783059; Wed, 05 Jul 2023 12:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688584783; cv=none; d=google.com; s=arc-20160816; b=C6xP9MQ5B68M5x8M01MX/Pd+hbKuTd1EbU/WJROkiGorL/8wtn73kErCafgNb+1ztj IWF+0cp1KMfcYF3aYgHokmJfQWO1vbMyJOTP6+qNAxCyef0uGoPhSnDyOkXc2YBDan95 p3aHn03i5jR2iz+8fPenj2It1iwq+qzMxibeVrJRTspuIlILi/c6UmKtKBihQ1R6MRu5 JtvoKmAhjG3ZZGN7ito5EQH/MShlExaCsI/0nYMXdeiBIfUn2fZvlYJR8Eh1qzVV2rzV LFQEuoOE/Kkdh6bZisYS+YlzIA9JVNgw0fmEHrYy66JzUMyzF02G27iG9HIM/UJ61JDx fHJg== 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=PRgH5Rpr8n1m/gtkDgQYS8pwXP0CmmnYkeLa8MeBnE0=; fh=tv+k1PFF3Srrq76KPuWBI9zf2XTO3UcT8YmoCfyDVlg=; b=uYKLbbpgobJFUGxjal6bXd+Q3BPxOfleJdfrpOMZA1GCvYxEsM2iJzp7QLVfeSB7ze uB+sYenIi4m1pHeP10HPuLFW3qLZtkSpvdP5IgRAzCBSCnMsTyy5+1JFfqXNIgJSXubc DgpcuAADwugVwvy5wjP8uZv5tTqzjF//FWhcGcgUuu33GqJtzgzeWnCp0MBOXKC+/vdr bAlZ5jPAbsf1wQUC0pLPaCIlMyGvXwfLEiUlsat+BkUXSAvC1817kY+yTSA9/WPRS6M/ Is8UTsdMTW2XX/U4t3hQwGmsgGFwnSID4l7MrCUMPbh/lAl+WzGRwtJL+cHvv3MFYfaY 7Dvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OZdARDRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r6-20020a1709028bc600b001b80c35bc65si18094457plo.641.2023.07.05.12.19.28; Wed, 05 Jul 2023 12:19:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OZdARDRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233767AbjGETGr (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233750AbjGETFv (ORCPT ); Wed, 5 Jul 2023 15:05:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 355161BD5; Wed, 5 Jul 2023 12:04:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BDC02616F0; Wed, 5 Jul 2023 19:04:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BB1EC433C7; Wed, 5 Jul 2023 19:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583840; bh=Yj3Hja39coL+y8AGiASW+H0zrb4hw9veEJV3lRuQS5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OZdARDRyu9HbK/4xlHu8SAsr9eP5a3ntrvWZg7JjqlkrGjPE61KU+o5xrpt0LTFs2 eaQKPHbnCvFZd4g7qru7U8YXCnny1r/rYg3pYmPcqPDpaoYyCO4mtAeG4rbb/nhUJV 1UiJdf3nVkkrbawqi8CpDeOo+g1PxdYjnMhpiMD1uyMKzyt7I9N9uNVoDCJNdFC7kw vtHid1+P0gTzfyB7gNbwhz93I2jsEAfb7QVI1shoPeDvQ5zIdUF4LET7zGoL+0C41I YUGQ/YUyljDueIkvTRlNOZODRNMkZA0Z3s64YbOjGsHQpcyv7M+HFpPR4fcirsfvCf nqACRgw72eAIQ== From: Jeff Layton To: Christian Brauner , Joel Becker , Christoph Hellwig Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 32/92] configfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:57 -0400 Message-ID: <20230705190309.579783-30-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609477412583149?= X-GMAIL-MSGID: =?utf-8?q?1770609477412583149?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara Acked-by: Joel Becker --- fs/configfs/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index 1c15edbe70ff..fbdcb3582926 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -88,8 +88,7 @@ int configfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, static inline void set_default_inode_attr(struct inode * inode, umode_t mode) { inode->i_mode = mode; - inode->i_atime = inode->i_mtime = - inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) @@ -99,7 +98,7 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) inode->i_gid = iattr->ia_gid; inode->i_atime = iattr->ia_atime; inode->i_mtime = iattr->ia_mtime; - inode->i_ctime = iattr->ia_ctime; + inode_set_ctime_to_ts(inode, iattr->ia_ctime); } struct inode *configfs_new_inode(umode_t mode, struct configfs_dirent *sd, @@ -172,7 +171,7 @@ struct inode *configfs_create(struct dentry *dentry, umode_t mode) return ERR_PTR(-ENOMEM); p_inode = d_inode(dentry->d_parent); - p_inode->i_mtime = p_inode->i_ctime = current_time(p_inode); + p_inode->i_mtime = inode_set_ctime_current(p_inode); configfs_set_inode_lock_class(sd, inode); return inode; } From patchwork Wed Jul 5 19:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116305 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2081350vqx; Wed, 5 Jul 2023 12:12:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBTh16LX2DM7kkPmOypIxjjZzPf8/JJ2sn1qocD10FipGdHDTCsrcXbHimVoL2wK9StbIL X-Received: by 2002:a17:90a:358:b0:263:e804:3988 with SMTP id 24-20020a17090a035800b00263e8043988mr4854234pjf.1.1688584339807; Wed, 05 Jul 2023 12:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688584339; cv=none; d=google.com; s=arc-20160816; b=O3zwgRvgXquB6wo+bRaxO7DDw51L+dPs8FJJAERmSWfRjOCqKOTECXULXOP/3EjJ5V OJqxhLp0Hn2MKwyE4lmmbeNjDsTucA+5Nu/dkUfpgi5g+mib7Vmcw6e2vgws9+XDTxFm beymePbmRrh2+lrsP7vEF4J2i0W8L7z7hGntmuvu/t6e6GocEjqxo5P3EeMgaRr7v+5N KKaH2aYhN8FluhEDRu2RI0i+50heJnO2pERh3soyppis26+JGAl6dLkKRfNzvR8uoL9w gURs/P8qT9MDT8Nj5V5UOoDIH+gh/w8Mh93o/v1RfrZyyJgd+t1ZTBXvoAIhG+UeFGQw 1MBA== 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=Xxfb48DCKZe+tWFQR3GrjeJmRR1qCxGP7WKRieyMIFk=; fh=Qx6DBlB+zexErJyu2hink0N3DPpUJJnrNQjF2TLdHn0=; b=gB66IQYXzHg6aeni1COs/I4GtqGGsvqLzDVutjHp181e8Fo2QcELLZhuJAn5G6kfDD fgqY+jygyeTAu6TIDCxDc7biul5JKOM7o4SGKNr2M/UnzaKFFUgjGcWTacb8f7Ya0Ro/ L+xn78Dv/oV5THpXfSypBg+ZRWexcdE+eoVr4QDE+3FVohOmtgeCqzoXJOcoNewLZNE9 FgXKsgtNnjPOndGagkbHpt0lwI7nLVAC6a1LgyER2yzoVs1I3UbIq2Q4y1vF7CIAtTcN Kglm74fzioi34oKN3UUZj4ifwCNqIpQ6AJzg1xT39GniIrGd0veIs+r5v7yaYRxdE9xk O9pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vb0jQvFG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a17090a854200b00244883db2c7si2186598pjw.99.2023.07.05.12.12.04; Wed, 05 Jul 2023 12:12:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vb0jQvFG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233749AbjGETGo (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233655AbjGETFq (ORCPT ); Wed, 5 Jul 2023 15:05:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18C722713; Wed, 5 Jul 2023 12:04:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1777C61711; Wed, 5 Jul 2023 19:04:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E133BC433C8; Wed, 5 Jul 2023 19:04:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583841; bh=mmZWdyBieVaWGBZZnfvkzAkbN9EmGhp06VeUMrMf0Lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vb0jQvFGFj3mucwnCa//HhQveytRyCoGk3wgFGhrsi4b7AXsQ3PT52+88afbjCuM6 n06kmVboyxcXGooCBW51ttyaB0HQ8xSNS7Syvp0dbkrEKaDw4OnOH8jnV3dvBvekqd Sjx9TzxqLSTiMz+9jnkt/zb9Tkd/pLBCb8UFaSH0XtA0RQ74P/qjEl5nyvOK1THhzz bqkSKlKyJvtwlKmNhoX7EtDcGnhrTb+a+QH8O/NeCb8HL9wRc1ytZlGqhsJWfStHx7 NtA+oE6LvQTSwklGqvOv/7cFuQJMqpU0F7aVJA50j03S4Kdofut7iyhcJkvN8Seux3 4YwUct8r9IJxw== From: Jeff Layton To: Christian Brauner , Nicolas Pitre Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 33/92] cramfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:58 -0400 Message-ID: <20230705190309.579783-31-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609012588512358?= X-GMAIL-MSGID: =?utf-8?q?1770609012588512358?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Nicolas Pitre Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/cramfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 27c6597aa1be..e755b2223936 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -133,7 +133,8 @@ static struct inode *get_cramfs_inode(struct super_block *sb, } /* Struct copy intentional */ - inode->i_mtime = inode->i_atime = inode->i_ctime = zerotime; + inode->i_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, + zerotime); /* inode->i_nlink is left 1 - arguably wrong for directories, but it's the best we can do without reading the directory contents. 1 yields the right result in GNU find, even From patchwork Wed Jul 5 19:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116382 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097607vqx; Wed, 5 Jul 2023 12:45:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlH6Fg5HS1lz9S8DEx4zJQwxRoAEqrEZl3rRdqOV+qFkIIdSIbp+MxO5GbRfF1Ry+iiCqE+T X-Received: by 2002:a05:6a00:24d3:b0:675:8f71:28f1 with SMTP id d19-20020a056a0024d300b006758f7128f1mr18160956pfv.30.1688586311400; Wed, 05 Jul 2023 12:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586311; cv=none; d=google.com; s=arc-20160816; b=VYWF1ZOdO7jkbnZVd0RFG75W+9Trz6fC+gPGwMJkCu/d+OkCRJE+WFl71DXOcpmpzS CjPCEvSE6LnixZTjQjdQ9jqW9TP4LDR6t2rC33XqgleWajWNLD+jFkS/3A1j2SZnyJWw R6AFTym4+0j1nJZgWwLgY4FpTvHn9o+GpKLlS5VfyEr/JisF2PCpBoOCwY7gRhvODLEX vZhHnFLRccUaoIPNUYSL6EjiHp+YR1JJfqn2EOEp5ip1ZARjWGECUqwsLAyx8hUvK0tJ gS9yxBxw9QQR69WpwQk8KcD1zUj37Ysb0RMlvKNGs9QQ3NaQO6sbAGKqr3faAG4zsk1J 2d2g== 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=Y7nttLs7jWS/7o71+Y+nbGCplZOIyWtgMM8l8E44tF4=; fh=4PigTNM7SCUIB+bsPONPBGyOzxMNsq9f0SCz8y6m1k4=; b=M2F7mJ882ee1mrLXcNFoSrnOAXP+X/5pW2VDIaU57Ce9RsWSEr+HgWcgzvgvnf/qkd J2R9f6gf+9Kg3TT+lxkkbpny6D6l7bdHwrbIIfBgqR6u0JCl75SaVQ90XNSO+bl2vgoh pznPbBEDg4MHRLeJ0HkNFbrWvbMwYAtLIvNBg/vqrbgLqezCLGE/EuQtcemzmXpJ98iu obNDt3B34X3bKn/+qCSwQc7ibsxrrozedmqcUN10poqeDAV1vz+8bYg4tlJjpNWiPUUy 0baSIrnUDO0g+SXu2lau14Xr0jYyydIdA3HBWpr0UVqw4hCcGebsSC1iWb9eZVYySj/j 59OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bnPu6yyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020aa79887000000b0068259969675si12491075pfl.297.2023.07.05.12.44.56; Wed, 05 Jul 2023 12:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bnPu6yyt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233404AbjGETGS (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233398AbjGETFi (ORCPT ); Wed, 5 Jul 2023 15:05:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F4311990; Wed, 5 Jul 2023 12:04:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80F4E61708; Wed, 5 Jul 2023 19:04:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B233C433C8; Wed, 5 Jul 2023 19:04:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583842; bh=DUInkTGhM3RE+Yyt7MHGOgLEyFmaFCBsA/ds7TaIzd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnPu6yytz3ogb8uIc5oLsPmMTBixB6Ox42zUnbg/nA4m5GKzoDGn0aEv2VNzWS+54 e90wbleClenj/FFb0JS2tCmDbF//Dfv9x2qtEPbAWTnP/83193sm9S18SG0CUdZC45 yflsj5It4T6cqtO067gIcFjH1PssDKGxB8zWOM0pG/SmL/ugb/GxINRPBFZT/l4m1y GhsMWvlQ1wIdciWrRJeNanRObyYVpvELWrD0L3XpmY/fOdgLom8mF9x7nRa2hPXmEu 44nF3J3qdjz2ETHumOrapnbj3Gy+b++Ei+Hqat4OoOJ3JrIolLPFFFoKxjmpDrCqEz WKnyYgG7hSEeg== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 34/92] debugfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:00:59 -0400 Message-ID: <20230705190309.579783-32-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611080246385445?= X-GMAIL-MSGID: =?utf-8?q?1770611080246385445?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Greg Kroah-Hartman Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/debugfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 3f81f73c241a..83e57e9f9fa0 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -72,8 +72,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb) struct inode *inode = new_inode(sb); if (inode) { inode->i_ino = get_next_ino(); - inode->i_atime = inode->i_mtime = - inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } return inode; } From patchwork Wed Jul 5 19:01:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2089087vqx; Wed, 5 Jul 2023 12:27:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHDgjaTB0/R9ERUFgFxYnTGyWr8CYO9bhIoNSK8klspJOHYXA5W8SzUowQrnebQ/iw3bQmX X-Received: by 2002:a92:de4a:0:b0:345:ca59:1546 with SMTP id e10-20020a92de4a000000b00345ca591546mr83868ilr.10.1688585232012; Wed, 05 Jul 2023 12:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585231; cv=none; d=google.com; s=arc-20160816; b=vpFPXq5Nbk6MkfmnO9L8+bXUYQUY4DnsqWaipOHVSie5IxtuUUeFq/tXNcP88QGOTg wyPdCsfKGcyVLIThykM28B6jgFfx1SDi4GrxvtAP0pZNsaLLpMeyl0Md/DwMQNf8nUpg PnOJ34OWYXX4OWHFAHi4nSnen5EtGPTNrL9HGtRhjNhves8Y6UsNCElNMUSAS68b2t8B ypouvVGSf7RGr2wIoaNqbAXOgT41b+KAKtaf1iSF2R/5OQTqbBrDaeULaJECl5GHBL0Y k0IrHxyGhso8y9UCNkqSz0kSWJI0DxsyOKfZz3epbWHlkD3HkNoY3TxMJ5oghTCGWmDG Zxiw== 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=KsyYndLBU8uoRHwG+k/X97/2VKYkeWPP70z3jvLUviw=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=NV0YUmyXncDjGRg3uweQLIDCwgdJ7sDOWIRp1hvjZWH34gzR7FotCKiG0sh5Ka95EV 2X0cxlSPyEOKmAKhy8QGUt5aB72P+6sFWwI/oqiSHWKnmP4gULD0asnQtNSaMZztoJ/t aW58Bxs0hA08cJQfvHqqe/YphrwIKFw3gsHib4mPwlD/37UZ3sYOOm54QuAa4fM8uT+7 0SnVvLiny22yajBDUu46cPeJ0WWAHY/D6tRg+W71nY6HUMYqwSLrJhI7uvWkp2sdgsIV 1IjSGc2ULBjV6Je9YxTvGDJqHG9V/8a6c4BXSuKzFm62f9fL6cO/Ik5zGCKY5hf5iP0K SEbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n4yowcdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a634744000000b00547b25ea099si24034529pgk.682.2023.07.05.12.26.57; Wed, 05 Jul 2023 12:27:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n4yowcdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233841AbjGETGw (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233754AbjGETFw (ORCPT ); Wed, 5 Jul 2023 15:05:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7D542717; Wed, 5 Jul 2023 12:04:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B8159616E4; Wed, 5 Jul 2023 19:04:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1E3AC433C8; Wed, 5 Jul 2023 19:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583844; bh=7AwQTcUroME8/Q2S/DjQYPGa2W9Q4X/zNBG/BMgjzBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n4yowcdvobJkpXC5motsYtO5fZ7zHbDxk/T11hVCo1GfRv3qPbmOrDWqOjwwwV+O0 dd2EPQzzfuzT1It+C6Qb52bHmpbA1rVu05HsS0mlWiTm80m9pe+XP7pAQIitGql12j +lNBq23AtztpNZXiKJ4YzMtrTKC5+54SbkMaMGDw3UGN+0xMGqD6eZKuCYNxjP88wC 48N4W9BgQbgfrBV4R4ZEzJUI+RCp2DG8ZIA7R0RYnpF5GzLYNv6CxzRInEfmFPmbSM d0qy1bRZp0sskJXCMRP2JTTd1D+C8xCmWBrpLDpG8ofWxMqnE5eNpYh4TFaHs+PwN3 NpiZwdUCWuRoA== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 35/92] devpts: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:00 -0400 Message-ID: <20230705190309.579783-33-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609948578738715?= X-GMAIL-MSGID: =?utf-8?q?1770609948578738715?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/devpts/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index fe3db0eda8e4..5ede89880911 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -338,7 +338,7 @@ static int mknod_ptmx(struct super_block *sb) } inode->i_ino = 2; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); mode = S_IFCHR|opts->ptmxmode; init_special_inode(inode, mode, MKDEV(TTYAUX_MAJOR, 2)); @@ -451,7 +451,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) if (!inode) goto fail; inode->i_ino = 1; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; @@ -560,7 +560,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) inode->i_ino = index + 3; inode->i_uid = opts->setuid ? opts->uid : current_fsuid(); inode->i_gid = opts->setgid ? opts->gid : current_fsgid(); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index)); sprintf(s, "%d", index); From patchwork Wed Jul 5 19:01:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095520vqx; Wed, 5 Jul 2023 12:40:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlE2DSYeAkNGsDvxlkL+Iip6oPuM8czairi1JAnrSwt+ON9LsQdlv0+oZoyNSjqYrhMxzHxO X-Received: by 2002:a05:6a20:258c:b0:12e:5f07:7ede with SMTP id k12-20020a056a20258c00b0012e5f077edemr14510879pzd.41.1688586029582; Wed, 05 Jul 2023 12:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586029; cv=none; d=google.com; s=arc-20160816; b=ZeBH/pGyd31wU4zoc4SBvY247ifqMBaTXCouhaIi/BvUwQPhnA/DjC+nGn8Ca1YJ0v WvGmLYc8oAvhiF4+1Fx2QJyqDCFovHwnCBlCvs/phUAI0S3If2h/onJblu11eIVJV2i0 PXAkKGgEJ2xo5ehX4yp1h28udTedunWn9lBxThQoh30m6ETFtD2t3pAkycU8F74vokS8 wuo9qycsOsI5O78YvzpID8vpFgWtS1qJm5GWrfcwdsBX0Ood5UBj02BUb9jqpHL8NjmS 9Z2mutQkuY7bUX8+jsDusw5jR0PscGSQqxVTt4IcSaCuNXR06QTRZe77BxIISpLR3l7B 4mag== 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=TD6HONpLoEq1HWuuCLEpWBtPfX+Q9ESpp75wL6E+2ko=; fh=BEIf0HDejcEKM1qJAMu1Sh6l88BCiizvAfeBeKE5QE8=; b=oPJKKFAVDWziFSNKk8pHpPPMrmcEgE3BiKWyJtPeKJqyLJrk/O801URbpB+3XUW5qg VhS6J6TaJ7npbXFnLb+vu4xp+2ShinFa/qODIQuRFWifZQsbh/q3XAD5JfLN+76nFODq u9SeTcYWXfXBZQwalD8fXj+On8pysN1lZ92zHiCq9aXZKCwUftkrqU+IgbDhXBaZV/NQ Kt5DuQKWzP0qVT02FBe3PPfp43EEWnFpS10sDBsK/NN/yVg2PRc1Pg+nEH6HFZRLYWSl M4ar8TZDUKgdiyeNyI+RZ6foUG2+UvH9eHuniengLcih3tI9B7858ELlmKe0MDVuIpar gGEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T8Af0tVe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cl8-20020a056a0032c800b0067d2eeacacesi17915361pfb.355.2023.07.05.12.40.15; Wed, 05 Jul 2023 12:40:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T8Af0tVe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233901AbjGETHt (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233817AbjGETGn (ORCPT ); Wed, 5 Jul 2023 15:06:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30FBF268E; Wed, 5 Jul 2023 12:04:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 33B93616CC; Wed, 5 Jul 2023 19:04:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E04F3C433C8; Wed, 5 Jul 2023 19:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583845; bh=uqLX2ipX4NvFoAzT/nc+anY78MkZU06KJM9/1GObuX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T8Af0tVezKUyyFTwpB8fkopaRFlqfs2/J01smC29vC9jnk2VzXjb/HOSDVs8+S1I1 H18bhrBxnL8Wqy+8f2QLVxKzTWbRDu/kG8UFoUbGO6quVb2IkVZn4Ew3/hKKv7OBny 3lYhc4BJan6Hq2SNN+Y6Ujxo0+8KxDKiQM3kgH1SQGSLuMUuxWlw3bPNxtCW/2nXln quQVcNEPodabzxhyNpS/7zo+pTDzjaD/xAK5cAXo2atP9rH8E7nJNRB+J821QGtfnJ Th6itlpuhTUQvs0he1LvgkZ8ofyTlPaArpcaoFn+hKwMCOPfn4pWHg9S+fTZC5Un/m FC5l3PNic5jhw== From: Jeff Layton To: Christian Brauner , Tyler Hicks Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ecryptfs@vger.kernel.org Subject: [PATCH v2 36/92] ecryptfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:01 -0400 Message-ID: <20230705190309.579783-34-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610784312273021?= X-GMAIL-MSGID: =?utf-8?q?1770610784312273021?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ecryptfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 83274915ba6d..b491bb239c8f 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -148,7 +148,7 @@ static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, } fsstack_copy_attr_times(dir, lower_dir); set_nlink(inode, ecryptfs_inode_to_lower(inode)->i_nlink); - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); out_unlock: dput(lower_dentry); inode_unlock(lower_dir); From patchwork Wed Jul 5 19:01:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090054vqx; Wed, 5 Jul 2023 12:29:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7d8cQWEU7+84dE3jedZnf+XLMAZphqQOfpMhFezwtJgUCBm02azV7Y3QAzBr8i1n5cFCu7 X-Received: by 2002:a05:6808:13d6:b0:397:f946:1e5 with SMTP id d22-20020a05680813d600b00397f94601e5mr16712211oiw.15.1688585350711; Wed, 05 Jul 2023 12:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585350; cv=none; d=google.com; s=arc-20160816; b=vEY8NN18kwv0JijxhiQEX1BaCwvzW3P3Ky4x3oMeKeQ2k6z7PqW+nu7ceb43h+RmlH CkJYdA/BWAjQLF4s7xX5UkuvcIZzXcqPtydX4T0IwvRg4C8IN8v7BMIYwzSTOoL7HU/O WEvk8wITWvO9koLC93QTaR3njy6j8zruy6AGnHz+wmjDFM7BTS6NqftZhvzv1DjoOdDu tEagxe57q0PfAVgp3ZexuXIg745cVPrtPdYNMj82ogRAtyWAbTdpjP8qb1tLChGRegoo tH10kk1y4Xg7vyPZxeywQ5t+iO1M9vtDFrPhgDQoTvRqwqz9CN6wTkkPBUVlvNhnoAN8 n2UA== 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=TVTrGlDEWWzZtH6pQW70o/mmfvwG4qXzrUPa98XwU8I=; fh=HAO2JJZuc9osmNUcdmJ13OJ8gAwSEUYLoO0odXf8GRQ=; b=Cd4pgPQsco1uzV4X6/++4znABWZvYcbXvjmfD3kppUmI4+bvCj0Knd6WnBn/7Hmoj/ cPhVaXK7Qh/cqAWAwhPqmkkrPZeT+bBCiRjpwpjmPlbUHMxOMb8BPhm30xzvBFaKtDDy 480OX/RQJlJhjH7dsWZKJPU/QA3qebeJ8Ay/UhoYr8Kod0R7/PnugdR2L+1YxtkKJFDb gpXiO8E+xXhtdiZ/JLwsNNETYCBexjY74Ydy5BiW62UitBqWtk9f+CXpTl0fyZEPnQt9 wxPXPZpFIPcwK2OSoL5a1cFR6bvTOqwfrZOD1Fga2+MZRFsrDp2qWaSnIzHJW3lUNOm1 HYJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CnOQJEmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a63dd0a000000b0054f96f7bcf3si23552124pgg.105.2023.07.05.12.28.56; Wed, 05 Jul 2023 12:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CnOQJEmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233806AbjGETGb (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233372AbjGETFk (ORCPT ); Wed, 5 Jul 2023 15:05:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE80E198E; Wed, 5 Jul 2023 12:04:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA4D9616EE; Wed, 5 Jul 2023 19:04:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 847C8C433C8; Wed, 5 Jul 2023 19:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583847; bh=Quk2EFrPq5vmfbKVzBbf5WGVzDjIaHl3AZ/HhYZtAs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CnOQJEmx1tn4tJvxJ+WakjK4eFv5cuangho52AJ5dDXyahBF1yE+GGMP0bN9GD0TY neLYHX58Y7GTijY9fR27/Fe0OITplMow1xNOkAtTiTcxGVYiDJ+WOewKAET4QgUZzF CBjt8HwANSkamwTDF1eCsLsdoaiZhoXm6gsg2EchyzZqXao5rfeWA0nKMAtznp6aR+ 8bC7aGmzJgMAHnzGgQV1Lvx+iZBxNCNC507pbyV2uEC4hSqVFBWhrOMsaSiVcCeONi oQWjX0azc0u6/t2HWBsIweHk3TJL/u8HVwka/7guxYNn/ymjiJr/zvqA9k1s5QS8Vn Kn7ljESIHHRLQ== From: Jeff Layton To: Christian Brauner , Jeremy Kerr , Ard Biesheuvel Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH v2 37/92] efivarfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:02 -0400 Message-ID: <20230705190309.579783-35-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610072761584805?= X-GMAIL-MSGID: =?utf-8?q?1770610072761584805?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/efivarfs/file.c | 2 +- fs/efivarfs/inode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index 375576111dc3..59b52718a3a2 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c @@ -51,7 +51,7 @@ static ssize_t efivarfs_file_write(struct file *file, } else { inode_lock(inode); i_size_write(inode, datasize + sizeof(attributes)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); inode_unlock(inode); } diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index b973a2c03dde..db9231f0e77b 100644 --- a/fs/efivarfs/inode.c +++ b/fs/efivarfs/inode.c @@ -25,7 +25,7 @@ struct inode *efivarfs_get_inode(struct super_block *sb, if (inode) { inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_flags = is_removable ? 0 : S_IMMUTABLE; switch (mode & S_IFMT) { case S_IFREG: From patchwork Wed Jul 5 19:01:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097600vqx; Wed, 5 Jul 2023 12:45:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlH7hI4zh1OzbNBYZt0P7rmOCv8PsxbpvSTyxflmTuN8EzSxg6k32qlJx/+2Tn1L/QhXUIDG X-Received: by 2002:a05:6808:eca:b0:3a3:c64f:3446 with SMTP id q10-20020a0568080eca00b003a3c64f3446mr5780280oiv.39.1688586310333; Wed, 05 Jul 2023 12:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586310; cv=none; d=google.com; s=arc-20160816; b=kV9lasVtNrNy+6okBawaNfcgv8EZjpotcgEIN+DRZJ4cHQA3yiOv66QaIswqTLrwYh kyiEWWX/SnpXAiJF0JnGXnrDyt+bnhuPIta1S91eXKxOt4audNW4Nb1lLDoVSo7Gjl06 9WGYma7IA7pacW4eh2GLm+o2+Un/iJ35QcpVzooJkxKm89yt4JtUdcNbD4E5zRtfA1Hz eCFCD5Os5EvLFxxROtSJffx9JqDpJg0q5R81YCu8tuEYPLvd4xrci/ghWHWJltTYAT84 /t4i6sz1EopoXTEJTUcwAyvb/hFd30EFBmEm2qTYY7+tUDkA3wm4BI9s+ORZSb3OrV/A d2hQ== 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=jL4TMPm3ap1PPY1/PU3DAat+cZl/fUotcIhU2z0vkGo=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=Ejq8fjGq41llBn135XBWDcF6Y+EIZWeXqsSA7LlwZYgaEBwEhLYMYfig4ur90qiof5 BxcBRhKTdGSw8pze0gdGAh6rEnRxAp9gb42nj0zQUrnawzivFpUZcDSTo+Cs5eYA27hq JkX6cYzFbTWCSTPyeQY/ZloXlyeiaSIk18z70Cxh2Fr8ft74O9oc9LbXVgW/MpkG8GM7 LtvZQH7QA8G2aT92CKw5I/Q+V40P6EaYaGbk3TdOy4rZ0Wmq18husXJLvmc6xR17fPDT oz46r2FYXOCdUnVen/dLtz5Vj8JDBsXth+EpDuEHX6zVdO0YctBTf5YzS/FWVLvbc9eD FbgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aOm99tMX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a63dd0a000000b0054f96f7bcf3si23576962pgg.105.2023.07.05.12.44.56; Wed, 05 Jul 2023 12:45:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aOm99tMX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233906AbjGETIu (ORCPT + 99 others); Wed, 5 Jul 2023 15:08:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233664AbjGETGo (ORCPT ); Wed, 5 Jul 2023 15:06:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A802D4F; Wed, 5 Jul 2023 12:04:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1E6F86171C; Wed, 5 Jul 2023 19:04:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08474C433C7; Wed, 5 Jul 2023 19:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583848; bh=HTBHTFlA5RxJ0OO7bJDzoz9Pa37uljN3z9pWnlY8GV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aOm99tMX5bBnXkWVa6CJqTOT4j9ZJrPL4lzx90SOuqo6YoLt9KicPGSd/T0L0CMJO mjmQVT8Z1YGbshbCtC+FivXzBAnclRDwEFadkOe/1qCSoYKrZwhvYXpXbdyoedtKdT ECjYUIRmcYh4tOUMyi5j/JFFLxLaVq956U2dJMIaA67CJSJhXndVPjsNq7qFlphTUi bcyaeLFyqmhGjIeTc7625wtbL5E2EgRGkARdg3+ztZ6G+MpMlQVByrbb6DOBnR2CW/ QIEoGL26snEwviCv/gmGpDTKrpZqqwkqYP9/YWwtiw2MKIyJIvNueRV4+yWNgnSKK/ NnEhNuT96riiQ== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 38/92] efs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:03 -0400 Message-ID: <20230705190309.579783-36-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611079106616345?= X-GMAIL-MSGID: =?utf-8?q?1770611079106616345?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/efs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/efs/inode.c b/fs/efs/inode.c index 3ba94bb005a6..3789d22ba501 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c @@ -105,8 +105,8 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino) inode->i_size = be32_to_cpu(efs_inode->di_size); inode->i_atime.tv_sec = be32_to_cpu(efs_inode->di_atime); inode->i_mtime.tv_sec = be32_to_cpu(efs_inode->di_mtime); - inode->i_ctime.tv_sec = be32_to_cpu(efs_inode->di_ctime); - inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0; + inode_set_ctime(inode, be32_to_cpu(efs_inode->di_ctime), 0); + inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = 0; /* this is the number of blocks in the file */ if (inode->i_size == 0) { From patchwork Wed Jul 5 19:01:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116345 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095200vqx; Wed, 5 Jul 2023 12:39:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHYZ6NjQfBGb9AtmE037ewnAS8eJ0L/185Rm9X4Iv7ry2itynCx6dx9y1Kb2bcBw5ot/5j X-Received: by 2002:a17:902:e5c1:b0:1b1:bf4c:868a with SMTP id u1-20020a170902e5c100b001b1bf4c868amr17876534plf.42.1688585992402; Wed, 05 Jul 2023 12:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585992; cv=none; d=google.com; s=arc-20160816; b=pVNMSy/A3kJSJOQW9h0skeWyyzuG+tfO5Iq+6IvG4IxF6qZn1GPzWwvOndi85xyWxI ldDX/C+nhm/JfemCwkixq5ORi67bnov4q9QklAjK7hc/yeUbv2MOI/VWpMPh0X5aL6L0 yHm+rJUp8acMI28ZzT+xMZvIjZa4BDkCl1d+izhJcX7dTZTMleMYiKUVEj9e0oys+K6z 4bPwY9aNNFjPcGLlW2qsRFRPKx/HOvk9bb6BG4TozyzdiSxE1ZRbhQ4pMmnwfeAye77y o4fE/Lqa4KtVoeYwOYUBfBLu4DDuFm7zTPC6mzbHSO3nhxR/Qgl/ujNFXLBEpxz7wvHA s2qA== 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=NDQlp6PwqX071MlTgexeVD/xPRMy6FXQzwfWLLAUWho=; fh=vZMI/nhoSq29/sSv9T3sTd0/Rq+efSjXbJNoQYOudps=; b=r3CP+fEL6xltdnmR3w5oUtHaCWSHvNBbCDhYxtNw7x4T2jdPnJHVq6RJMyGS7ewLzB WljtZ7A2WJ3arS77/umalOThReWu/XxDwOJedqNnEnb866yvS3Cuc++e941bigN835Yo E7POi0s/7W6MBWVaQ5xxsmX9jX3+ZgdiQkf/ikbIkxWt2PCrWpL99D81+KfreIot2Hmk 15yC8qWuW1iPzjvCwJKHIQmUESbRTQl/51RcaYBH4Q3lzYxMHTGQBuO65h/snOAuXPes gQ6cBGg2FZer+Ki2POua3EvBGxVaatD8H7afITPXLXy6+MQhvrbVm2QHHKy+a1kbpVns ua/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aTZ/kFDN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b001b3f9cedbb7si21935161plr.398.2023.07.05.12.39.37; Wed, 05 Jul 2023 12:39:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aTZ/kFDN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233644AbjGETGe (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233645AbjGETFq (ORCPT ); Wed, 5 Jul 2023 15:05:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76E852709; Wed, 5 Jul 2023 12:04:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C9062616C4; Wed, 5 Jul 2023 19:04:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EC62C433C8; Wed, 5 Jul 2023 19:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583850; bh=drNbTch4MFALaAjIb0HJv1jQX0IS4DSN9KjY5vGKrAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aTZ/kFDNnI/Q6Nnc34HxC0VQoYl3zKC53va1kTdUOoKojmOoKUesyDkj6ouWjcOtI 0gUwxaA1JhO3R/Y9Z37Kz2eaLuN2OAKZxD/1gnOpT9+sTwL0oO91GR5FxC+/cYLBrq CrC5ozhtoNq9y2bUf3uhRcHTw34CtkUS2tVrSvNUW6pPPQxmW82waJY4frYpdAN8PX AcaM5AAxI+JqFd4dTebrgPUmDqtcERFteRq2GId1n65B7XxKbFnVAOtwhQUHVSSnqM +nxbzXjZX2a6JctMRh4Cw/pXqAo9VrTmqBv5YZdytZjTSqtoej4pEjmQBbApJIocru FYni8LeZ11A3A== From: Jeff Layton To: Christian Brauner , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org Subject: [PATCH v2 39/92] erofs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:04 -0400 Message-ID: <20230705190309.579783-37-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610745652755938?= X-GMAIL-MSGID: =?utf-8?q?1770610745652755938?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Gao Xiang Signed-off-by: Jeff Layton --- fs/erofs/inode.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index d70b12b81507..806374d866d1 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -105,8 +105,8 @@ static void *erofs_read_inode(struct erofs_buf *buf, set_nlink(inode, le32_to_cpu(die->i_nlink)); /* extended inode has its own timestamp */ - inode->i_ctime.tv_sec = le64_to_cpu(die->i_mtime); - inode->i_ctime.tv_nsec = le32_to_cpu(die->i_mtime_nsec); + inode_set_ctime(inode, le64_to_cpu(die->i_mtime), + le32_to_cpu(die->i_mtime_nsec)); inode->i_size = le64_to_cpu(die->i_size); @@ -148,8 +148,7 @@ static void *erofs_read_inode(struct erofs_buf *buf, set_nlink(inode, le16_to_cpu(dic->i_nlink)); /* use build time for compact inodes */ - inode->i_ctime.tv_sec = sbi->build_time; - inode->i_ctime.tv_nsec = sbi->build_time_nsec; + inode_set_ctime(inode, sbi->build_time, sbi->build_time_nsec); inode->i_size = le32_to_cpu(dic->i_size); if (erofs_inode_is_data_compressed(vi->datalayout)) @@ -176,10 +175,10 @@ static void *erofs_read_inode(struct erofs_buf *buf, vi->chunkbits = sb->s_blocksize_bits + (vi->chunkformat & EROFS_CHUNK_FORMAT_BLKBITS_MASK); } - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec; - inode->i_atime.tv_sec = inode->i_ctime.tv_sec; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec; - inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec; + inode->i_mtime.tv_sec = inode_get_ctime(inode).tv_sec; + inode->i_atime.tv_sec = inode_get_ctime(inode).tv_sec; + inode->i_mtime.tv_nsec = inode_get_ctime(inode).tv_nsec; + inode->i_atime.tv_nsec = inode_get_ctime(inode).tv_nsec; inode->i_flags &= ~S_DAX; if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) && From patchwork Wed Jul 5 19:01:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116304 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2081311vqx; Wed, 5 Jul 2023 12:12:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlFzUR8f5MDGLaaE2W65j+twSQIRi93Lpkc2O7to7ztloLzlRjw4HLkETgDtk4+1EnQ3zOy5 X-Received: by 2002:a17:902:ec8b:b0:1af:d225:9002 with SMTP id x11-20020a170902ec8b00b001afd2259002mr15506439plg.14.1688584335711; Wed, 05 Jul 2023 12:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688584335; cv=none; d=google.com; s=arc-20160816; b=i4Mmx1cuMN8BW73KW56w9ZaU6wZEgtVWWUj1BCCfw8TRiRCYeizIbyGZxLpsLNy031 nsVp6Ji7G5OOUzNHd9TbxcOYCA4gsk+rrXpnynNlSqVRPDhffOPq1butsjo3MPTmTiBD J1tfcF3DUAt04C1td7t1Of2YSzngyVsexcZu2whEI1vug9AS5wYmeMNfl122PuL4L5NS cDFGeWXnl2ajrB8pnSN6msRLiTO4WYGV4zoRyavKA+Tjt/BF6gd23Q+U1dw4n0HrNeCv tzCu6fc3Hq5jf2zMyqK6VU0HANnRh84b+ygrjblYvPe2SWIkkiV9rii4zZknB1usQGRZ /QCQ== 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=7H20scUqV7SbZXBxHV9KALc20DInNjomsrW64tWNf0g=; fh=Nk/0tMRLb8D+wJo4Zmm3v7/GPXN2K9PAwHUJV3gzhLs=; b=PxucCCGOoAZI3KL+F3WrFh04lT+Z6/r5Dpj1AAAVmOLNdccmA090uH68nFVHSAKIV3 ZZkY465mCvm4VjNW0KzW4D9dObVp1bWISgBiJNkkR7qP012F1oy/ApFv9SuitxKfRSuI hnkgZde67BNnVGm3FugqjEApUGgFE9EichOqFnuZVDR7oa2U+XWBMpKPOI80r1lSqSj4 2ra3B/8lk9B/23eYTewKccSnJoJ2MGHa4jX15YwhNBleKEyBvTybaQilZl1+S7Ocof9C jvwLblWPlZE6nAFvcu7T0vihcWx/aZn8jPrDCDVMMh7QRCqTA2Cp7WjNInHtQN0paRzs /DBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="C0OQBd/D"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a170902d4d000b001b530ede2besi25302290plg.614.2023.07.05.12.11.56; Wed, 05 Jul 2023 12:12:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="C0OQBd/D"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233989AbjGETJV (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbjGETHT (ORCPT ); Wed, 5 Jul 2023 15:07:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83FC42D7B; Wed, 5 Jul 2023 12:04:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C377D616D1; Wed, 5 Jul 2023 19:04:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84C7BC433C7; Wed, 5 Jul 2023 19:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583852; bh=UuG0R0U0cRQYdeg+NT+3LnrqnY7pXt2obAtGOeiYJHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C0OQBd/DHStoi63xy4zOgoCRQMzPX/Tn3+cI6hYTcwI603Hjonc/Xz5KVPuXljUbH Y4qRRIaEswFpGqfH3JzxWODp8tY3h+0yn4WzfWeL/9X2bBV7mWKZT+ZubpRCL0iou7 7qCE3RLvIZmF08vYUG5Za1lNxD3R4U70X6I57XfADKxo3x9hwzWSrobT3aRK6noXK3 YMXLOqkEvaDxe2pXjJAuOsGOO1GdhHxMzA4obec9kOGbvGBZJku7INl5rGqbZi5Dcw nMsHsOTzJI4HtolnS3oXblHRFk6pGL/51v6eMeiXrEBVIZZ3GO03XRbwoxNB4cv42X O1JU0gc+tYYJw== From: Jeff Layton To: Christian Brauner , Namjae Jeon , Sungjong Seo Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 40/92] exfat: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:05 -0400 Message-ID: <20230705190309.579783-38-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609008094517371?= X-GMAIL-MSGID: =?utf-8?q?1770609008094517371?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/exfat/file.c | 4 ++-- fs/exfat/inode.c | 6 +++--- fs/exfat/namei.c | 21 +++++++++------------ fs/exfat/super.c | 3 +-- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 3cbd270e0cba..f40ecfeee3a4 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -22,7 +22,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) if (err) return err; - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); if (!IS_SYNC(inode)) @@ -290,7 +290,7 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, } if (attr->ia_valid & ATTR_SIZE) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); setattr_copy(&nop_mnt_idmap, inode, attr); exfat_truncate_atime(&inode->i_atime); diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 481dd338f2b8..13329baeafbc 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -355,7 +355,7 @@ static void exfat_write_failed(struct address_space *mapping, loff_t to) if (to > i_size_read(inode)) { truncate_pagecache(inode, i_size_read(inode)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); exfat_truncate(inode); } } @@ -398,7 +398,7 @@ static int exfat_write_end(struct file *file, struct address_space *mapping, exfat_write_failed(mapping, pos+len); if (!(err < 0) && !(ei->attr & ATTR_ARCHIVE)) { - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); ei->attr |= ATTR_ARCHIVE; mark_inode_dirty(inode); } @@ -577,7 +577,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info) inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9; inode->i_mtime = info->mtime; - inode->i_ctime = info->mtime; + inode_set_ctime_to_ts(inode, info->mtime); ei->i_crtime = info->crtime; inode->i_atime = info->atime; diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index e91022ff80ef..c007de6ac1c7 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -569,7 +569,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else @@ -582,8 +582,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = - EXFAT_I(inode)->i_crtime = current_time(inode); + inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = inode_set_ctime_current(inode); exfat_truncate_atime(&inode->i_atime); /* timestamp is already written, so mark_inode_dirty() is unneeded. */ @@ -817,7 +816,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); + dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -825,7 +824,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) mark_inode_dirty(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); @@ -852,7 +851,7 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else @@ -866,8 +865,7 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = - EXFAT_I(inode)->i_crtime = current_time(inode); + inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = inode_set_ctime_current(inode); exfat_truncate_atime(&inode->i_atime); /* timestamp is already written, so mark_inode_dirty() is unneeded. */ @@ -979,7 +977,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); + dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -988,7 +986,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) drop_nlink(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); @@ -1353,8 +1351,7 @@ static int exfat_rename(struct mnt_idmap *idmap, exfat_warn(sb, "abnormal access to an inode dropped"); WARN_ON(new_inode->i_nlink == 0); } - new_inode->i_ctime = EXFAT_I(new_inode)->i_crtime = - current_time(new_inode); + EXFAT_I(new_inode)->i_crtime = inode_set_ctime_current(new_inode); } unlock: diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 8c32460e031e..8e0ca4b0fc8f 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -379,8 +379,7 @@ static int exfat_read_root(struct inode *inode) ei->i_size_ondisk = i_size_read(inode); exfat_save_attr(inode, ATTR_SUBDIR); - inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime = - current_time(inode); + inode->i_mtime = inode->i_atime = ei->i_crtime = inode_set_ctime_current(inode); exfat_truncate_atime(&inode->i_atime); return 0; } From patchwork Wed Jul 5 19:01:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116319 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090062vqx; Wed, 5 Jul 2023 12:29:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlHhe5zNmw/iOoxwNBuDnAnH/IFQZA14Pgz12KumaGRk09OdTgSHB6HRaPiPFy+rrYQRevRM X-Received: by 2002:a05:6808:14c2:b0:3a3:9337:4099 with SMTP id f2-20020a05680814c200b003a393374099mr19078628oiw.56.1688585351302; Wed, 05 Jul 2023 12:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585351; cv=none; d=google.com; s=arc-20160816; b=LohIFRS8kgDqIHPGCBlYFkBP3Sg7ZesVqasRawSifP7jL56n+sLGVrDS7zWlOUNcv1 CFM2abFdfXhaSMvCoekLN5GJy87LN0hCJL66y1EE+bFqjGLDDOTSzueJG76nOfgdOuc7 8t8Wu91Oz5gX01u5SVbVN6V/qKMz/IjmftDyXG9aLhqNvnou3G9eg3k/Rq+BXAjc/+33 oWKzcFh/E/C/7B20+aZhiSNw7b0RIpCHvHIhQL9RJ7E5fiVahgM4jtOXZlMhvWk1M6Dh eZE1/F5NPf/BUezFH6uTre5LdDXWIThnadEf/06A+mENHJtG5c3pErcVkqi83II81fGk LaKw== 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=k6vdDG/QTcdYrx/7eSDI7OceKOrz0FAzgg4DJuNF9dY=; fh=Viictrsy2u3tTDmZAvOjKApZPCJSZ0GXpjsvMwCOyCY=; b=Q2cQs+XIWrQ/yQEfJOwZxRi68iidCXghC6CeAvbzS/BYxVHimlcf1YHAHmOkmjgW1m uTTWO2ZFECI1uxX1Ogqauk0Tgm3+KR4r4TvJetXB917bsnU6+3iGcrr0aiGF4ANP/S6Q K7HiqKlXaAMnv2OSRxlBaWI4fwuWe6C3KlPJi8e26HvKY23stRY3arTZRnueKt9eG5WF IlAR0JxSP8obAfFD5tvcxAHjWeLdtliIt95AljVLdvMiDGYvYg3qTTGCIONbAvcjAeRv sBlhPB9AZm3E0fhmxwgoDcJeRDI/pQtmfY2nTKTC5WsKVAP/HKUX/Ll8Jnsa6juMs97Y jwwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fTkuY/N3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a63e742000000b0055b66cf8d77si220757pgk.412.2023.07.05.12.28.57; Wed, 05 Jul 2023 12:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fTkuY/N3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233836AbjGETGu (ORCPT + 99 others); Wed, 5 Jul 2023 15:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233584AbjGETGE (ORCPT ); Wed, 5 Jul 2023 15:06:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4002E2720; Wed, 5 Jul 2023 12:04:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 685FA61702; Wed, 5 Jul 2023 19:04:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20933C433C8; Wed, 5 Jul 2023 19:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583854; bh=1em4ldhK72uQK1Pwww0B1ScMyFG1sAykvMf/fTZ7qsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fTkuY/N3k+aPpXgDdHzusoWb53s1qEbX4pZhY/Vjw6NX42VqCK9i2kPw7KADd6ZcX 0kR8vUoxzJgR1Gcogkeuyz/S3pTYIfIQ3vEoLXswkiK9AsN1uSi5WRb3VUDuN/5wXb JPXLWB7c3XjcP6HR2qWSC+cxbmY0tyDOOmJPI/b8YEmu5o7tnBEHOL1hl7vLKRy5W0 /Wz4u2uMoqgYCGI55Zh/LOInBbHA8QGtSJqKR6Y0EN0lAOecB7lgx5e7dfzUrlw3/l 59nqpcn+CZr3tS5rwLAk24ZQ8nfUz/S7QSwlxwxVdNe6DO8hj/A43sMV6qgDsvyEQG F8BYX1G7e1lOQ== From: Jeff Layton To: Christian Brauner , Jan Kara Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH v2 41/92] ext2: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:06 -0400 Message-ID: <20230705190309.579783-39-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610073577207320?= X-GMAIL-MSGID: =?utf-8?q?1770610073577207320?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ext2/acl.c | 2 +- fs/ext2/dir.c | 6 +++--- fs/ext2/ialloc.c | 2 +- fs/ext2/inode.c | 10 +++++----- fs/ext2/ioctl.c | 4 ++-- fs/ext2/namei.c | 8 ++++---- fs/ext2/super.c | 2 +- fs/ext2/xattr.c | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 82b17d7fc93f..7e54c31589c7 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c @@ -237,7 +237,7 @@ ext2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, error = __ext2_set_acl(inode, acl, type); if (!error && update_mode) { inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); } return error; diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 42db804794bd..b335f17f682f 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -468,7 +468,7 @@ int ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, ext2_set_de_type(de, inode); ext2_commit_chunk(page, pos, len); if (update_times) - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; mark_inode_dirty(dir); return ext2_handle_dirsync(dir); @@ -555,7 +555,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode) de->inode = cpu_to_le32(inode->i_ino); ext2_set_de_type (de, inode); ext2_commit_chunk(page, pos, rec_len); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; mark_inode_dirty(dir); err = ext2_handle_dirsync(dir); @@ -606,7 +606,7 @@ int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct page *page) pde->rec_len = ext2_rec_len_to_disk(to - from); dir->inode = 0; ext2_commit_chunk(page, pos, to - from); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); EXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL; mark_inode_dirty(inode); return ext2_handle_dirsync(inode); diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index 34cd5dc1da23..c24d0de95a83 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -546,7 +546,7 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode, inode->i_ino = ino; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); memset(ei->i_data, 0, sizeof(ei->i_data)); ei->i_flags = ext2_mask_flags(mode, EXT2_I(dir)->i_flags & EXT2_FL_INHERITED); diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 75983215c7a1..1259995977d2 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -595,7 +595,7 @@ static void ext2_splice_branch(struct inode *inode, if (where->bh) mark_buffer_dirty_inode(where->bh, inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); } @@ -1287,7 +1287,7 @@ static int ext2_setsize(struct inode *inode, loff_t newsize) __ext2_truncate_blocks(inode, newsize); filemap_invalidate_unlock(inode->i_mapping); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); if (inode_needs_sync(inode)) { sync_mapping_buffers(inode->i_mapping); sync_inode_metadata(inode, 1); @@ -1409,9 +1409,9 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) set_nlink(inode, le16_to_cpu(raw_inode->i_links_count)); inode->i_size = le32_to_cpu(raw_inode->i_size); inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime); - inode->i_ctime.tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime); + inode_set_ctime(inode, (signed)le32_to_cpu(raw_inode->i_ctime), 0); inode->i_mtime.tv_sec = (signed)le32_to_cpu(raw_inode->i_mtime); - inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0; + inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = 0; ei->i_dtime = le32_to_cpu(raw_inode->i_dtime); /* We now have enough fields to check if the inode was active or not. * This is needed because nfsd might try to access dead inodes @@ -1541,7 +1541,7 @@ static int __ext2_write_inode(struct inode *inode, int do_sync) raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); raw_inode->i_size = cpu_to_le32(inode->i_size); raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec); - raw_inode->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec); + raw_inode->i_ctime = cpu_to_le32(inode_get_ctime(inode).tv_sec); raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); raw_inode->i_blocks = cpu_to_le32(inode->i_blocks); diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index cc87d413eb43..44e04484e570 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c @@ -44,7 +44,7 @@ int ext2_fileattr_set(struct mnt_idmap *idmap, (fa->flags & EXT2_FL_USER_MODIFIABLE); ext2_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); return 0; @@ -77,7 +77,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } inode_lock(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode->i_generation = generation; inode_unlock(inode); diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 937dd8f60f96..059517068adc 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -211,7 +211,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir, if (err) return err; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -291,7 +291,7 @@ static int ext2_unlink(struct inode *dir, struct dentry *dentry) if (err) goto out; - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); inode_dec_link_count(inode); err = 0; out: @@ -367,7 +367,7 @@ static int ext2_rename (struct mnt_idmap * idmap, ext2_put_page(new_page, new_de); if (err) goto out_dir; - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); @@ -383,7 +383,7 @@ static int ext2_rename (struct mnt_idmap * idmap, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); mark_inode_dirty(old_inode); err = ext2_delete_entry(old_de, old_page); diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 2959afc7541c..aaf3e3e88cb2 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1572,7 +1572,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type, if (inode->i_size < off+len-towrite) i_size_write(inode, off+len-towrite); inode_inc_iversion(inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); return len - towrite; } diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 8906ba479aaf..1c9187188d68 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -773,7 +773,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh, /* Update the inode. */ EXT2_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (IS_SYNC(inode)) { error = sync_inode_metadata(inode, 1); /* In case sync failed due to ENOSPC the inode was actually From patchwork Wed Jul 5 19:01: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: 116342 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2094810vqx; Wed, 5 Jul 2023 12:39:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEufRvNWHQzofjIOkbIzcJ5ME5ujmXZZEax9dNTbVFaFlRKXfvGLeyC+DFmSj4EcMSMaxey X-Received: by 2002:a17:90a:fe07:b0:262:ca9c:edcb with SMTP id ck7-20020a17090afe0700b00262ca9cedcbmr83370pjb.9.1688585941540; Wed, 05 Jul 2023 12:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585941; cv=none; d=google.com; s=arc-20160816; b=ECdcf+fSh+aUNS+Ow8nmmL3e9jmThbBkVy/XfI3cVuryEsqSyl5EEPvkoI2shm5Csy jkQ2nk+mEyER9dxVoDUjoQ3QaS7eqV+PzRUFFf7RsYBFDTfuWxI6KLp4vW6O6sL3Gn9F iOEIeTaHk2Fq6t3xNrxxBH/8ue2xpJU6/6i1n4MXDUBsNYDnmp5MZST4aQHbEIscejo1 /DEwwpjQcco0kLXBQoNwpUmkEJ3wzRFUDsKzLWo3pW7L6yt9od1Wtp3wpteHaO7P9igE uk5FNtTTf2z9F0zhFPmzt2NWlFyww6Fzc1tigiyynjymLy1/rVf6o05x8Kz1C5JKH42K S2ZQ== 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=o+ZVFK/tZqnVT15cDkeGQiPfBjHbSVlNWzyC/+gK2FU=; fh=zVinveaPEWEHexTuw7bsYFAuFwZGlFeUGEMG70rOxNY=; b=xjqXt2/iaxRKfZMr4QKGD6d5hAy+9CoKgBTQ5JujaPMxi1+Sc30mXBbJEH520kkruM 3l7gcltthQqz/Hko8nADKOVy2ENf+QkNjJQZPDeyBNDJ+vuUjRqHAjnOsUSZmQcbzTS1 ZyJLus3FnHAbHqhwRdMduHFjPbQ6ItXSEk0dO88j1tw/82k9do/mMX+WZedigb2w83bv xLfSUJtqBJNw6v9y+csK7KRrDDGqmOX2DbXVKzJLbtqotE2k75FT3rXUPvMAy1bW34SJ 8cnF7dJ/g1rGCU0enTd+vqj6LzVH13FgP888+rX7czYTsVml0L4CkeWZiRBCW3Fu2gAu A6hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VHgbi1LS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b001b3f9cedbb7si21935161plr.398.2023.07.05.12.38.44; Wed, 05 Jul 2023 12:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VHgbi1LS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233851AbjGETHF (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233774AbjGETGF (ORCPT ); Wed, 5 Jul 2023 15:06:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A104F2723; Wed, 5 Jul 2023 12:04:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 731E261659; Wed, 5 Jul 2023 19:04:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F8E5C433C8; Wed, 5 Jul 2023 19:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583857; bh=Db/u8HY7vCWKKMotT4F9r3ht7l6kq9+H+CG13wTY/Ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VHgbi1LSu8EYlv0frYAwW5iSrFPswSggnxUnApyD5AoGg/+qU3q7V2GUohC4cvLA+ cVeFpuK2pRfrfe6TJ344TIyOOKKTtO6s1ULPucHgFQBAjzw9S/T1cymiSu0AGdOgjA WOGaf+AhN6YRqlHKbZdgDCctuTW+gVWIaSeHanS93aAIlEbM3IHoPRDzBIBZpWmpLF PtNuzwUXqGKotldP4G+yleTyoFVawbkuwpDiVmMygd810Wzd1mqLyT1FtBdI9VhCh1 5xNlP4F/dQiin9XVU3S6HmysvR14nqN7tfFnM0uBAJGN5b8GyPCAIadWPVT9Q1KXyj wK7J8998fG9Aw== From: Jeff Layton To: Christian Brauner , "Theodore Ts'o" , Andreas Dilger Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH v2 42/92] ext4: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:07 -0400 Message-ID: <20230705190309.579783-40-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610692591904588?= X-GMAIL-MSGID: =?utf-8?q?1770610692591904588?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton --- fs/ext4/acl.c | 2 +- fs/ext4/ext4.h | 21 +++++++++++++++++++++ fs/ext4/extents.c | 12 ++++++------ fs/ext4/ialloc.c | 2 +- fs/ext4/inline.c | 4 ++-- fs/ext4/inode.c | 16 +++++++--------- fs/ext4/ioctl.c | 9 +++++---- fs/ext4/namei.c | 26 ++++++++++++-------------- fs/ext4/super.c | 2 +- fs/ext4/xattr.c | 6 +++--- 10 files changed, 59 insertions(+), 41 deletions(-) diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index 27fcbddfb148..3bffe862f954 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c @@ -259,7 +259,7 @@ ext4_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, error = __ext4_set_acl(handle, inode, type, acl, 0 /* xattr_flags */); if (!error && update_mode) { inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); error = ext4_mark_inode_dirty(handle, inode); } out_stop: diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 0a2d55faa095..d502b930431b 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -3823,6 +3823,27 @@ static inline int ext4_buffer_uptodate(struct buffer_head *bh) return buffer_uptodate(bh); } +static inline void ext4_inode_set_ctime(struct inode *inode, struct ext4_inode *raw_inode) +{ + struct timespec64 ctime = inode_get_ctime(inode); + + if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), i_ctime_extra)) { + raw_inode->i_ctime = cpu_to_le32(ctime.tv_sec); + raw_inode->i_ctime_extra = ext4_encode_extra_time(&ctime); + } else { + raw_inode->i_ctime = cpu_to_le32(clamp_t(int32_t, ctime.tv_sec, S32_MIN, S32_MAX)); + } +} + +static inline void ext4_inode_get_ctime(struct inode *inode, const struct ext4_inode *raw_inode) +{ + struct timespec64 ctime = { .tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime) }; + + if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), i_ctime_extra)) + ext4_decode_extra_time(&ctime, raw_inode->i_ctime_extra); + inode_set_ctime(inode, ctime.tv_sec, ctime.tv_nsec); +} + #endif /* __KERNEL__ */ #define EFSBADCRC EBADMSG /* Bad CRC detected */ diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index e4115d338f10..202c76996b62 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4476,12 +4476,12 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset, map.m_lblk += ret; map.m_len = len = len - ret; epos = (loff_t)map.m_lblk << inode->i_blkbits; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (new_size) { if (epos > new_size) epos = new_size; if (ext4_update_inode_size(inode, epos) & 0x1) - inode->i_mtime = inode->i_ctime; + inode->i_mtime = inode_get_ctime(inode); } ret2 = ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); @@ -4617,7 +4617,7 @@ static long ext4_zero_range(struct file *file, loff_t offset, /* Now release the pages and zero block aligned part of pages */ truncate_pagecache_range(inode, start, end - 1); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); ret = ext4_alloc_file_blocks(file, lblk, max_blocks, new_size, flags); @@ -4642,7 +4642,7 @@ static long ext4_zero_range(struct file *file, loff_t offset, goto out_mutex; } - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); if (new_size) ext4_update_inode_size(inode, new_size); ret = ext4_mark_inode_dirty(handle, inode); @@ -5378,7 +5378,7 @@ static int ext4_collapse_range(struct file *file, loff_t offset, loff_t len) up_write(&EXT4_I(inode)->i_data_sem); if (IS_SYNC(inode)) ext4_handle_sync(handle); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); ret = ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); @@ -5488,7 +5488,7 @@ static int ext4_insert_range(struct file *file, loff_t offset, loff_t len) /* Expand file to avoid data loss if there is error while shifting */ inode->i_size += len; EXT4_I(inode)->i_disksize += len; - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); ret = ext4_mark_inode_dirty(handle, inode); if (ret) goto out_stop; diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 754f961cd9fd..48abef5f23e7 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -1250,7 +1250,7 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap, inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); /* This is the optimal IO size (for stat), not the fs block size */ inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); ei->i_crtime = inode->i_mtime; memset(ei->i_data, 0, sizeof(ei->i_data)); diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index a4b7e4bc32d4..003861037374 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1037,7 +1037,7 @@ static int ext4_add_dirent_to_inline(handle_t *handle, * happen is that the times are slightly out of date * and/or different from the directory change time. */ - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); ext4_update_dx_flag(dir); inode_inc_iversion(dir); return 1; @@ -1991,7 +1991,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) ext4_orphan_del(handle, inode); if (err == 0) { - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); err = ext4_mark_inode_dirty(handle, inode); if (IS_SYNC(inode)) ext4_handle_sync(handle); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 3d253e250871..bbc57954dfd3 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3986,7 +3986,7 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) if (IS_SYNC(inode)) ext4_handle_sync(handle); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); ret2 = ext4_mark_inode_dirty(handle, inode); if (unlikely(ret2)) ret = ret2; @@ -4146,7 +4146,7 @@ int ext4_truncate(struct inode *inode) if (inode->i_nlink) ext4_orphan_del(handle, inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); err2 = ext4_mark_inode_dirty(handle, inode); if (unlikely(err2 && !err)) err = err2; @@ -4249,7 +4249,7 @@ static int ext4_fill_raw_inode(struct inode *inode, struct ext4_inode *raw_inode } raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); - EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode); + ext4_inode_set_ctime(inode, raw_inode); EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode); EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode); EXT4_EINODE_SET_XTIME(i_crtime, ei, raw_inode); @@ -4858,7 +4858,7 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, } } - EXT4_INODE_GET_XTIME(i_ctime, inode, raw_inode); + ext4_inode_get_ctime(inode, raw_inode); EXT4_INODE_GET_XTIME(i_mtime, inode, raw_inode); EXT4_INODE_GET_XTIME(i_atime, inode, raw_inode); EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode); @@ -4981,7 +4981,7 @@ static void __ext4_update_other_inode_time(struct super_block *sb, spin_unlock(&inode->i_lock); spin_lock(&ei->i_raw_lock); - EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode); + ext4_inode_get_ctime(inode, raw_inode); EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode); EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode); ext4_inode_csum_set(inode, raw_inode, ei); @@ -5376,10 +5376,8 @@ int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry, * Update c/mtime on truncate up, ext4_truncate() will * update c/mtime in shrink case below */ - if (!shrink) { - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; - } + if (!shrink) + inode->i_mtime = inode_set_ctime_current(inode); if (shrink) ext4_fc_track_range(handle, inode, diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 331859511f80..b0349f451863 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -449,7 +449,8 @@ static long swap_inode_boot_loader(struct super_block *sb, diff = size - size_bl; swap_inode_data(inode, inode_bl); - inode->i_ctime = inode_bl->i_ctime = current_time(inode); + inode_set_ctime_current(inode); + inode_set_ctime_current(inode_bl); inode_inc_iversion(inode); inode->i_generation = get_random_u32(); @@ -663,7 +664,7 @@ static int ext4_ioctl_setflags(struct inode *inode, ext4_set_inode_flags(inode, false); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_iversion(inode); err = ext4_mark_iloc_dirty(handle, inode, &iloc); @@ -774,7 +775,7 @@ static int ext4_ioctl_setproject(struct inode *inode, __u32 projid) } EXT4_I(inode)->i_projid = kprojid; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_iversion(inode); out_dirty: rc = ext4_mark_iloc_dirty(handle, inode, &iloc); @@ -1266,7 +1267,7 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } err = ext4_reserve_inode_write(handle, inode, &iloc); if (err == 0) { - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_iversion(inode); inode->i_generation = generation; err = ext4_mark_iloc_dirty(handle, inode, &iloc); diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 0caf6c730ce3..07f6d96ebc60 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2203,7 +2203,7 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, * happen is that the times are slightly out of date * and/or different from the directory change time. */ - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); ext4_update_dx_flag(dir); inode_inc_iversion(dir); err2 = ext4_mark_inode_dirty(handle, dir); @@ -3197,7 +3197,8 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry) * recovery. */ inode->i_size = 0; ext4_orphan_add(handle, inode); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + dir->i_mtime = inode_set_ctime_current(dir); + inode_set_ctime_current(inode); retval = ext4_mark_inode_dirty(handle, inode); if (retval) goto end_rmdir; @@ -3271,7 +3272,7 @@ int __ext4_unlink(struct inode *dir, const struct qstr *d_name, retval = ext4_delete_entry(handle, dir, de, bh); if (retval) goto out_handle; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); ext4_update_dx_flag(dir); retval = ext4_mark_inode_dirty(handle, dir); if (retval) @@ -3286,7 +3287,7 @@ int __ext4_unlink(struct inode *dir, const struct qstr *d_name, drop_nlink(inode); if (!inode->i_nlink) ext4_orphan_add(handle, inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); retval = ext4_mark_inode_dirty(handle, inode); if (dentry && !retval) ext4_fc_track_unlink(handle, dentry); @@ -3463,7 +3464,7 @@ int __ext4_link(struct inode *dir, struct inode *inode, struct dentry *dentry) if (IS_DIRSYNC(dir)) ext4_handle_sync(handle); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); ext4_inc_count(inode); ihold(inode); @@ -3641,8 +3642,7 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent, if (ext4_has_feature_filetype(ent->dir->i_sb)) ent->de->file_type = file_type; inode_inc_iversion(ent->dir); - ent->dir->i_ctime = ent->dir->i_mtime = - current_time(ent->dir); + ent->dir->i_mtime = inode_set_ctime_current(ent->dir); retval = ext4_mark_inode_dirty(handle, ent->dir); BUFFER_TRACE(ent->bh, "call ext4_handle_dirty_metadata"); if (!ent->inlined) { @@ -3941,7 +3941,7 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old.inode->i_ctime = current_time(old.inode); + inode_set_ctime_current(old.inode); retval = ext4_mark_inode_dirty(handle, old.inode); if (unlikely(retval)) goto end_rename; @@ -3955,9 +3955,9 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (new.inode) { ext4_dec_count(new.inode); - new.inode->i_ctime = current_time(new.inode); + inode_set_ctime_current(new.inode); } - old.dir->i_ctime = old.dir->i_mtime = current_time(old.dir); + old.dir->i_mtime = inode_set_ctime_current(old.inode); ext4_update_dx_flag(old.dir); if (old.dir_bh) { retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); @@ -4053,7 +4053,6 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, }; u8 new_file_type; int retval; - struct timespec64 ctime; if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) && !projid_eq(EXT4_I(new_dir)->i_projid, @@ -4147,9 +4146,8 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - ctime = current_time(old.inode); - old.inode->i_ctime = ctime; - new.inode->i_ctime = ctime; + inode_set_ctime_current(old.inode); + inode_set_ctime_current(new.inode); retval = ext4_mark_inode_dirty(handle, old.inode); if (unlikely(retval)) goto end_rename; diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c94ebf704616..b54c70e1a74e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -7103,7 +7103,7 @@ static int ext4_quota_off(struct super_block *sb, int type) } EXT4_I(inode)->i_flags &= ~(EXT4_NOATIME_FL | EXT4_IMMUTABLE_FL); inode_set_flags(inode, 0, S_NOATIME | S_IMMUTABLE); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); err = ext4_mark_inode_dirty(handle, inode); ext4_journal_stop(handle); out_unlock: diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 321e3a888c20..dbe54cddda3d 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -356,13 +356,13 @@ ext4_xattr_inode_hash(struct ext4_sb_info *sbi, const void *buffer, size_t size) static u64 ext4_xattr_inode_get_ref(struct inode *ea_inode) { - return ((u64)ea_inode->i_ctime.tv_sec << 32) | + return ((u64) inode_get_ctime(ea_inode).tv_sec << 32) | (u32) inode_peek_iversion_raw(ea_inode); } static void ext4_xattr_inode_set_ref(struct inode *ea_inode, u64 ref_count) { - ea_inode->i_ctime.tv_sec = (u32)(ref_count >> 32); + inode_set_ctime(ea_inode, (u32)(ref_count >> 32), 0); inode_set_iversion_raw(ea_inode, ref_count & 0xffffffff); } @@ -2459,7 +2459,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, } if (!error) { ext4_xattr_update_super_block(handle, inode->i_sb); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_iversion(inode); if (!value) no_expand = 0; From patchwork Wed Jul 5 19:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096541vqx; Wed, 5 Jul 2023 12:42:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlFlfRik7O4rVDM8M6Ub3EHHtcQO2Dfq3DkmKT8FM11ryuEeuQ/uG+5wKIySAq2GCbOGnWef X-Received: by 2002:a17:90a:d202:b0:262:ea3e:e248 with SMTP id o2-20020a17090ad20200b00262ea3ee248mr4675821pju.7.1688586166825; Wed, 05 Jul 2023 12:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586166; cv=none; d=google.com; s=arc-20160816; b=L3Z2Ji9gZ4ogwXEZI+cFSop5pmZ0v9pkfVwKRAfKns12c60P+xzTNUFvOTInJkGlcZ miX2NpfmF2zjO3UCaJI/3OZkZk2NT9AN0uuSKIhf9BcpJo0R4eiv4p5ROCpKeYOskdRf vGZTxBAQah/lKQtH2wOo6z4zPnovYSqdX8Of4FAwbba0ETANAYZA4rJ/0Ogtqdz+0i7n OXRozrv92JPbM5Cll4+OdPXL0M2RFi6OiV+xBrevE9XW6MYZr9DJfJBxrj1Zmnt19baa XeTjgp55T+dMCgCGu7iurP03iGaD5lQpiygG9hX+aZDCQOsucCK7h93BXrEDP4dqX4VY GrKw== 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=y3IzNsgwmhcwdUqI3mNergz4R1lXbQbAL5DlB21BNKM=; fh=RpPjG2XzT0riP3Bo7uqTWHftciAPeVMSgmg/sw1IX6M=; b=SQFeV+W0zUiIbjlArIWr52083eEK03EHs9nAVGoIg0Yft112mVc4Ac9dWaC3YzCiWP VPDEIIdjHYx76jmf+loKF8x0CVWXMR2kV3/3FIw4JEHAvWyt9XsBTSUjvUXTYyW/kOTZ H81YdGX4sNmAmm7Vr/XURY905fVBin2eHqxa3zhiNaVuhibmruZRreZMMGcApb34OdCf VM51d+SDjzyZB/XHQslQfkvuj0uEvgl6OyODyG7mQQQZQm4sxV73V5c9ug5QrxoGiXxG KLsLBD56/BiBo1t026rkwPV8wZj8t5hLiaJM0qOd+jwlrVWtNyIj8GpZC0+1PlRJOhAI RbYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uAAbnG55; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a63dc0b000000b005573a9229f0si24463834pgg.841.2023.07.05.12.42.33; Wed, 05 Jul 2023 12:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uAAbnG55; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233793AbjGETH0 (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbjGETG2 (ORCPT ); Wed, 5 Jul 2023 15:06:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0DE21BD8; Wed, 5 Jul 2023 12:04:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5302B616EC; Wed, 5 Jul 2023 19:04:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3BF0C433C8; Wed, 5 Jul 2023 19:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583860; bh=D922Cq2SEXEwUPorCNhui1jv3NnTtUlXFDIcqs6xt8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uAAbnG555vPHng2XwacHERfeDI1a8Bgd29T3IqWiiqpvTLHOR/mRr2MSaYwH0ZBmb 4XIyW4ejHpMr1kXrk/HMd9//yhhtQ/2m7zDcS8DD4gZvMCCZJMsu+++Shm2Xph94Wp xkHzp+lTDQyccTQstASQMXzT7jAvW6WEFX4z4XjN7x8RHEZkp5UN/xy67FnQIIublN o7V7TzDUHqlF+FgbnnhTyYpT34nOQQuEB4LtNqzIzrNhH+x6luN4ZjBJpxxU/DJ3IS LBq535e92TwCrp4hguQ6JS5IKU/zSKtCgz7j16Es67eQA4VNOhxHAdKTQS44Cxlm7M TYbwfJK+Jv+BA== From: Jeff Layton To: Christian Brauner , Jaegeuk Kim , Chao Yu Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v2 43/92] f2fs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:08 -0400 Message-ID: <20230705190309.579783-41-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610928472346417?= X-GMAIL-MSGID: =?utf-8?q?1770610928472346417?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/f2fs/dir.c | 8 ++++---- fs/f2fs/f2fs.h | 4 +++- fs/f2fs/file.c | 20 ++++++++++---------- fs/f2fs/inline.c | 2 +- fs/f2fs/inode.c | 10 +++++----- fs/f2fs/namei.c | 12 ++++++------ fs/f2fs/recovery.c | 4 ++-- fs/f2fs/super.c | 2 +- fs/f2fs/xattr.c | 2 +- 9 files changed, 33 insertions(+), 31 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index d635c58cf5a3..8aa29fe2e87b 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -455,7 +455,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de, de->file_type = fs_umode_to_ftype(inode->i_mode); set_page_dirty(page); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); f2fs_mark_inode_dirty_sync(dir, false); f2fs_put_page(page, 1); } @@ -609,7 +609,7 @@ void f2fs_update_parent_metadata(struct inode *dir, struct inode *inode, f2fs_i_links_write(dir, true); clear_inode_flag(inode, FI_NEW_INODE); } - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); f2fs_mark_inode_dirty_sync(dir, false); if (F2FS_I(dir)->i_current_depth != current_depth) @@ -858,7 +858,7 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode) if (S_ISDIR(inode->i_mode)) f2fs_i_links_write(dir, false); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); f2fs_i_links_write(inode, false); if (S_ISDIR(inode->i_mode)) { @@ -919,7 +919,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, } f2fs_put_page(page, 1); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); f2fs_mark_inode_dirty_sync(dir, false); if (inode) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index c7cb2177b252..e18272ae3119 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3303,9 +3303,11 @@ static inline void clear_file(struct inode *inode, int type) static inline bool f2fs_is_time_consistent(struct inode *inode) { + struct timespec64 ctime = inode_get_ctime(inode); + if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime)) return false; - if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime)) + if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &ctime)) return false; if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime)) return false; diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 093039dee992..b018800223c4 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -794,7 +794,7 @@ int f2fs_truncate(struct inode *inode) if (err) return err; - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); f2fs_mark_inode_dirty_sync(inode, false); return 0; } @@ -905,7 +905,7 @@ static void __setattr_copy(struct mnt_idmap *idmap, if (ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_set_ctime_to_ts(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { umode_t mode = attr->ia_mode; vfsgid_t vfsgid = i_gid_into_vfsgid(idmap, inode); @@ -1008,7 +1008,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, return err; spin_lock(&F2FS_I(inode)->i_size_lock); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); F2FS_I(inode)->last_disk_size = i_size_read(inode); spin_unlock(&F2FS_I(inode)->i_size_lock); } @@ -1835,7 +1835,7 @@ static long f2fs_fallocate(struct file *file, int mode, } if (!ret) { - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); f2fs_mark_inode_dirty_sync(inode, false); f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); } @@ -1937,7 +1937,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) else clear_inode_flag(inode, FI_PROJ_INHERIT); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); f2fs_set_inode_flags(inode); f2fs_mark_inode_dirty_sync(inode, true); return 0; @@ -2874,10 +2874,10 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, if (ret) goto out_unlock; - src->i_mtime = src->i_ctime = current_time(src); + src->i_mtime = inode_set_ctime_current(src); f2fs_mark_inode_dirty_sync(src, false); if (src != dst) { - dst->i_mtime = dst->i_ctime = current_time(dst); + dst->i_mtime = inode_set_ctime_current(dst); f2fs_mark_inode_dirty_sync(dst, false); } f2fs_update_time(sbi, REQ_TIME); @@ -3073,7 +3073,7 @@ static int f2fs_ioc_setproject(struct inode *inode, __u32 projid) goto out_unlock; fi->i_projid = kprojid; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); f2fs_mark_inode_dirty_sync(inode, true); out_unlock: f2fs_unlock_op(sbi); @@ -3511,7 +3511,7 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg) } set_inode_flag(inode, FI_COMPRESS_RELEASED); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); f2fs_mark_inode_dirty_sync(inode, true); f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); @@ -3710,7 +3710,7 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg) if (ret >= 0) { clear_inode_flag(inode, FI_COMPRESS_RELEASED); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); f2fs_mark_inode_dirty_sync(inode, true); } unlock_inode: diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 4638fee16a91..88fc9208ffa7 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -698,7 +698,7 @@ void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page, set_page_dirty(page); f2fs_put_page(page, 1); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); f2fs_mark_inode_dirty_sync(dir, false); if (inode) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 09e986b050c6..c1c2ba9f28e5 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -403,7 +403,7 @@ static void init_idisk_time(struct inode *inode) struct f2fs_inode_info *fi = F2FS_I(inode); fi->i_disk_time[0] = inode->i_atime; - fi->i_disk_time[1] = inode->i_ctime; + fi->i_disk_time[1] = inode_get_ctime(inode); fi->i_disk_time[2] = inode->i_mtime; } @@ -434,10 +434,10 @@ static int do_read_inode(struct inode *inode) inode->i_blocks = SECTOR_FROM_BLOCK(le64_to_cpu(ri->i_blocks) - 1); inode->i_atime.tv_sec = le64_to_cpu(ri->i_atime); - inode->i_ctime.tv_sec = le64_to_cpu(ri->i_ctime); + inode_set_ctime(inode, le64_to_cpu(ri->i_ctime), + le32_to_cpu(ri->i_ctime_nsec)); inode->i_mtime.tv_sec = le64_to_cpu(ri->i_mtime); inode->i_atime.tv_nsec = le32_to_cpu(ri->i_atime_nsec); - inode->i_ctime.tv_nsec = le32_to_cpu(ri->i_ctime_nsec); inode->i_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec); inode->i_generation = le32_to_cpu(ri->i_generation); if (S_ISDIR(inode->i_mode)) @@ -714,10 +714,10 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) set_raw_inline(inode, ri); ri->i_atime = cpu_to_le64(inode->i_atime.tv_sec); - ri->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); + ri->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); ri->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); ri->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); - ri->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + ri->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ri->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); if (S_ISDIR(inode->i_mode)) ri->i_current_depth = diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index bee0568888da..193b22a2d6bf 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -243,7 +243,7 @@ static struct inode *f2fs_new_inode(struct mnt_idmap *idmap, inode->i_ino = ino; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); F2FS_I(inode)->i_crtime = inode->i_mtime; inode->i_generation = get_random_u32(); @@ -420,7 +420,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir, f2fs_balance_fs(sbi, true); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); ihold(inode); set_inode_flag(inode, FI_INC_LINK); @@ -1052,7 +1052,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir, f2fs_set_link(new_dir, new_entry, new_page, old_inode); new_page = NULL; - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); f2fs_down_write(&F2FS_I(new_inode)->i_sem); if (old_dir_entry) f2fs_i_links_write(new_inode, false); @@ -1086,7 +1086,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir, f2fs_i_pino_write(old_inode, new_dir->i_ino); f2fs_up_write(&F2FS_I(old_inode)->i_sem); - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); f2fs_mark_inode_dirty_sync(old_inode, false); f2fs_delete_entry(old_entry, old_page, old_dir, NULL); @@ -1251,7 +1251,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, f2fs_i_pino_write(old_inode, new_dir->i_ino); f2fs_up_write(&F2FS_I(old_inode)->i_sem); - old_dir->i_ctime = current_time(old_dir); + inode_set_ctime_current(old_dir); if (old_nlink) { f2fs_down_write(&F2FS_I(old_dir)->i_sem); f2fs_i_links_write(old_dir, old_nlink > 0); @@ -1270,7 +1270,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, f2fs_i_pino_write(new_inode, old_dir->i_ino); f2fs_up_write(&F2FS_I(new_inode)->i_sem); - new_dir->i_ctime = current_time(new_dir); + inode_set_ctime_current(new_dir); if (new_nlink) { f2fs_down_write(&F2FS_I(new_dir)->i_sem); f2fs_i_links_write(new_dir, new_nlink > 0); diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 4e7d4ceeb084..b8637e88d94f 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -321,10 +321,10 @@ static int recover_inode(struct inode *inode, struct page *page) f2fs_i_size_write(inode, le64_to_cpu(raw->i_size)); inode->i_atime.tv_sec = le64_to_cpu(raw->i_atime); - inode->i_ctime.tv_sec = le64_to_cpu(raw->i_ctime); + inode_set_ctime(inode, le64_to_cpu(raw->i_ctime), + le32_to_cpu(raw->i_ctime_nsec)); inode->i_mtime.tv_sec = le64_to_cpu(raw->i_mtime); inode->i_atime.tv_nsec = le32_to_cpu(raw->i_atime_nsec); - inode->i_ctime.tv_nsec = le32_to_cpu(raw->i_ctime_nsec); inode->i_mtime.tv_nsec = le32_to_cpu(raw->i_mtime_nsec); F2FS_I(inode)->i_advise = raw->i_advise; diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index ca31163da00a..28aeffc0048c 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2703,7 +2703,7 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, if (len == towrite) return err; - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); f2fs_mark_inode_dirty_sync(inode, false); return len - towrite; } diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 476b186b90a6..4ae93e1df421 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -764,7 +764,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, same: if (is_inode_flag_set(inode, FI_ACL_MODE)) { inode->i_mode = F2FS_I(inode)->i_acl_mode; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); clear_inode_flag(inode, FI_ACL_MODE); } From patchwork Wed Jul 5 19:01:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096282vqx; Wed, 5 Jul 2023 12:42:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57VoCfKqLc8W60kH3ZIEP+NEk3N9GyvBwOsLYfvgJtsygi5ijN5PQzccVsh13SODEM4LeX X-Received: by 2002:a05:6a21:6d88:b0:122:e4f:25c7 with SMTP id wl8-20020a056a216d8800b001220e4f25c7mr15567491pzb.31.1688586129764; Wed, 05 Jul 2023 12:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586129; cv=none; d=google.com; s=arc-20160816; b=w12dWQi9dPQEzwwQtemKp/hglLT25TLHvrAoFSO6/BIEduuIvIfCn8dHdTLyiQbLDC 7fJ4HC1qkicT3Ftu+vlA7GMp67jgA3W40WoshZP30vvqht1sIqK3rJXfog13cOXNCI+2 VkDNBIzO3RLAf/GLQMtzZKXQx8bRoJW0jGkZ8an9jRYu9cnZiPRFAFR259Saeamxy4V7 Oj/SRgyaMmgA+RiXtUb+jOd3xTxL5wIovdqWt/M59SeyR3PkxySDvFWa0WufPKZX9QZy qJRZF1EKssUmWeuB62nezXjRub/2BivRrENOI1tLNw0zmx8r578EzGKrGrfh/w9m720P b1lA== 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=Rth1t+yZAO6WuRgzc6NaInNv3oaRpJ18BYPDD6lk4KY=; fh=NSc8dZdErb2gdcRKDV2tZv9WN36uFA+9uWEteurYwJA=; b=a4fV1dE8rgRuU1rikJELWivIb1XlmUMe68pMHWXmGUnLGaIxhdwfHyz6GhLvXNPeDa u98p1vKVldHwsCyujK2BW7uEcXDdgzHxyWvHMluRHXyPsZNPhljy677Ag+4GcCIgDcZd ChiPmEPFsRhAq4E35va+PYN3qRopqjKT58SCITUt6Pm/FBfFw5NNFtt+1dVbWyM2lw2f TafqFd7KaSca3qKfRufSn7F99g5U4F1qaySgiiNUFsYR7rOuFex7WADqSZ2NuPZ7g/4x wIGP6Kjf/8sj88SgMKNwUGYCMYW5j+g812pxbghDU4subMsF+DbYdRLJUbePBrXlXZ8b 7ltw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gyAtYMyc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a056a0016c500b0065ee6c40f91si25033272pfc.159.2023.07.05.12.41.55; Wed, 05 Jul 2023 12:42:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gyAtYMyc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233781AbjGETHT (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233375AbjGETGR (ORCPT ); Wed, 5 Jul 2023 15:06:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0653273C; Wed, 5 Jul 2023 12:04:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CED1161701; Wed, 5 Jul 2023 19:04:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2D94C433C9; Wed, 5 Jul 2023 19:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583862; bh=EE1pMrQ7eUtaCqd78aDEt+l5fcwyOfnOdSwd15ijX/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gyAtYMycE2dNDYESwnLkyjwZ2jj7Wj2l2RbcnD8pGImfzoiHw4JLq17FhFfjhZ5rn u90N7i5SUOWEwsJpAps+KyFTPl+odwR5AisrTwBzk5DbwenAUVE0S+rDNwHcOVKNxz IpGRBrsFDqXdyP0EKogBhkafqbVs25wCr3f8fMyoAbHHB+9DedwZw10Tx+h8X2csQB OJoWI8Bd4LkN2W0nQO19G7pk8AHZxarXXs7P9yz5kI4QZ1HFYCxBwEyauVzd2t8nK+ 6fyvuk/SLiIsHo/n9uI5xYuef4rusM8rEzCo+Wpw+b3J6L9mqtZxl7OWv58wMAF5t3 FKY7zkSWSWt6Q== From: Jeff Layton To: Christian Brauner , OGAWA Hirofumi Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 44/92] fat: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:09 -0400 Message-ID: <20230705190309.579783-42-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610889500072649?= X-GMAIL-MSGID: =?utf-8?q?1770610889500072649?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton --- fs/fat/inode.c | 7 ++++--- fs/fat/misc.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index d99b8549ec8f..2be40ff8a74f 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -562,7 +562,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) & ~((loff_t)sbi->cluster_size - 1)) >> 9; fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); - inode->i_ctime = inode->i_mtime; + inode_set_ctime_to_ts(inode, inode->i_mtime); if (sbi->options.isvfat) { fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); fat_time_fat2unix(sbi, &MSDOS_I(inode)->i_crtime, de->ctime, @@ -1407,8 +1407,9 @@ static int fat_read_root(struct inode *inode) MSDOS_I(inode)->mmu_private = inode->i_size; fat_save_attrs(inode, ATTR_DIR); - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = 0; - inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec = 0; + inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode_set_ctime(inode, + 0, 0).tv_sec; + inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = 0; set_nlink(inode, fat_subdirs(inode)+2); return 0; diff --git a/fs/fat/misc.c b/fs/fat/misc.c index 7e5d6ae305f2..67006ea08db6 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c @@ -332,7 +332,8 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags) * but ctime updates are ignored. */ if (flags & S_MTIME) - inode->i_mtime = inode->i_ctime = fat_truncate_mtime(sbi, now); + inode->i_mtime = inode_set_ctime_to_ts(inode, + fat_truncate_mtime(sbi, now)); return 0; } From patchwork Wed Jul 5 19:01:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116399 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2098315vqx; Wed, 5 Jul 2023 12:46:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56f4HmDwTqZwE/Vui0bwokYHbLK4fNl0IsWY4/cJW7FQ/X53CAKW+qMxfdiBBvU2bceT6F X-Received: by 2002:a05:6a20:1388:b0:114:6993:5a3b with SMTP id hn8-20020a056a20138800b0011469935a3bmr10286675pzc.13.1688586395629; Wed, 05 Jul 2023 12:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586395; cv=none; d=google.com; s=arc-20160816; b=i9YT/G684UlPoEFAJFVyTWgefDNu1uUZ/rsGypjHPzy5Ba/L0h3WE4BJJ8eSg/QBks 7ii27j7wSlwk1pn9OfStxN5WvduQiSc24a4OXQ1HH8R2PJT9Zj9T7x/zY9Rabg2t40Np prUDyz5jW23Lwp4k2NMUcdP2d2X1epBqXp974jckP8GbNySOvZxqgQIaNBDHLLa7Wj2E /aiX+FYYX/+GLHPrFKzK7iDuNGbRxVUBZLUFFBlYUKpFpw9BCFaJLF9r9fKksBoSrSGK Rxwc8C3JJo+DDDz5TlqjGMQbugDEIeNZunEdtQqcy8niD4pHJSQLBLSwppm+Xr4ew2pR CS1g== 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=vPjvSCZtir/TybwIUZ3Thc/OhQlLsUHUNncZl5P7Nq0=; fh=IslLLxRsdDHcuh7/BdnrqqCDEGuIsx7UtYpmlRBC8N4=; b=R/lEHMnMIkXMuegjH60EDrugWd2pww4EL6mQ9+O37cCpXfzNhp94e7M5+Oj4r7eP51 8BXu7J/49Q/CVqE63APEWDQHFyEY6RRqsp5FFljBw6Km3WI5WDEmjWni5xxLBGcIvQ0G eIgeie38tfvbtSc8m5t/LSiL3nQz2dzwfJqXepxjH4jY29qBXfx6MuWlnJ7Laez0EhOB oub+Q6JqOuwcxhg8BC6yVNTtfeNGWfpQKeQQ6gmpV3qgjhHoyV+p25grhzLys0mICYsZ fHu+pWTNDnJ9i3frWKkFIrLID0GCAgkNSbOu1XTbFIMFhkCuVIslVXH2vrzKj/JBQ5qx gB9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KLOgOXVG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a056a0016c500b0065ee6c40f91si25033272pfc.159.2023.07.05.12.46.21; Wed, 05 Jul 2023 12:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KLOgOXVG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233995AbjGETJY (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234034AbjGETIS (ORCPT ); Wed, 5 Jul 2023 15:08:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81FC51FD4; Wed, 5 Jul 2023 12:04:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3220A6170C; Wed, 5 Jul 2023 19:04:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04510C433C8; Wed, 5 Jul 2023 19:04:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583863; bh=XUGLj6vRT2nD6OcTnqWk1j5eSDsjuOt1nCtiIEhrnV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KLOgOXVGV+KiWlI9cx0L7N77auOJqmGI5YUpgqp4j5nt8APesTi0+DLwaxbepOnOI jMU3uM7XJqSkTTjXyh8rtglLHfrInkXQLJWt0WF0qROqd/wMH7HP/avbYMIMgaiw85 fqJ/5E3lBSDUUUp8dyhsfxM38NsBsXOMKSxb+t+Hgr1cCW2Rs8QIvogGv/B7071BQ1 CWpH/3dwS2GyJsoVnGWlvb8i+Cpt4Vzq5Pga5VZY7hvNObpAYIfxXsM7KVWGzKl4Dz keJiXv0SfWRV9MWv5uqCNyyCGMSP8MKxDflrErIhi+rlZ6cN4oQPseIbND8vj6xsQi axXz/PLKlqJhg== From: Jeff Layton To: Christian Brauner , Christoph Hellwig Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 45/92] freevxfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:10 -0400 Message-ID: <20230705190309.579783-43-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611168049826658?= X-GMAIL-MSGID: =?utf-8?q?1770611168049826658?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/freevxfs/vxfs_inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c index ceb6a12649ba..ac5d43b164b5 100644 --- a/fs/freevxfs/vxfs_inode.c +++ b/fs/freevxfs/vxfs_inode.c @@ -110,10 +110,9 @@ static inline void dip2vip_cpy(struct vxfs_sb_info *sbi, inode->i_size = vip->vii_size; inode->i_atime.tv_sec = vip->vii_atime; - inode->i_ctime.tv_sec = vip->vii_ctime; + inode_set_ctime(inode, vip->vii_ctime, 0); inode->i_mtime.tv_sec = vip->vii_mtime; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; inode->i_blocks = vip->vii_blocks; From patchwork Wed Jul 5 19:01:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095489vqx; Wed, 5 Jul 2023 12:40:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4s0kujhyQ8QTQ5r9rys9yHf0p5ZLgi+0ZT8S/U+ObYOteDMubwbFvQUmij53ZIRBvDMaI9 X-Received: by 2002:a05:6a21:33a9:b0:12d:5b6:7b32 with SMTP id yy41-20020a056a2133a900b0012d05b67b32mr16416620pzb.3.1688586026218; Wed, 05 Jul 2023 12:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586026; cv=none; d=google.com; s=arc-20160816; b=gqqTPJHhGafgUxORAzztXxLVQ0xU+3qJw4xO6fyz732y5vKxzclX7tv3/lDkZAZxpz dMZUw/pbgN8e1WBzU9sjx+qF8L+eSdtdFuLCm6qmu0IM5DsDOxrZqjJOdFmX1UFwYj8g gpXA4ra1jYuSrvahL/yNHO8q3MW1jAkj44kBZqX9Fe46GWFc4ZQZRJvkbcb2Sn31mcC9 jw0X2NpI6EJv+VGJ8c4k7A5oZyivAOKjhIA/BcqwUoMHQfRhzVnBJ+psKt9wdlhq/izA KukyhOcuiwc2NpwdtdWWVfuzkOSuFMSapm9d3MLpjcDL+FWSHnzwAWyM2+3OqzK6j1JI bo1g== 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=paC3U5IuM373PWVLwwX4XtpaU7VVzri/JLFVAth5hVE=; fh=RSAQQ2pZQih3ZSdMtlLW7v1/+vcvNPk/jNYOHhRP69o=; b=TG9IRNL2MkVczc0gkRTxrTrbUgNVWfvu8MAp5KaRVjTRrBEnqzTR+O+ye9AXXDsvho f3GGLV3I3B72lIEKH33pSDLjRehWgv1SUTC+fy+KlJZ2Z9iQ/+HmmAZ6m41urcnn70Bk rzKmhdtFf+mjAk3cuW5Gdol5mssqqORsljQxMKzuEq92TS9zglVjoD+ejGqW3mmwxMBW d47BPHY6dmXqoTfPYGtby1GQ7CXsC1OJEksofwqCCwelGB+/+UBwyRf8PYt7lB2DHW28 EBu0uYx37G5Hzr+yiukBauFpQtWiXQmP5qbGekbyY7s6kpT9eYMCqbdQKWcm8RFz6luX hYmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=brvK73Qq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y64-20020a638a43000000b0054fd4d7d642si22995043pgd.4.2023.07.05.12.40.13; Wed, 05 Jul 2023 12:40:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=brvK73Qq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233486AbjGETHc (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233810AbjGETGb (ORCPT ); Wed, 5 Jul 2023 15:06:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A67C01BD2; Wed, 5 Jul 2023 12:04:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D6B4561705; Wed, 5 Jul 2023 19:04:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7D32C433C8; Wed, 5 Jul 2023 19:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583865; bh=mQW5JcbP2u/DVpTyR/7WzgrSSXpDBi/vKKvh+Np3ZoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=brvK73QqnVBmoM+j4jwx4s3h2qw5YCF1HZIxSkZup3LSqi5KlXu39cYCq7sBTJkxR 3vkxuOu3zzIG89v6ymOnRCdPeKbPM3UtGQZvoGKRJjWNXWSpD/Pj2FgHGvxPWN4xG0 i4b9zbGHL8CBvZ2D/enU1jz5tmvdyQEp2GjSKOdn6NtzInIJ7pMtK7q+wWsk8IlCNb p61BaIhcLkVMnjLRuhSmM38B7SOBl67vZj/1VJeCo2REHwwVnQSqvBaCVztJU7wfhA rBI6ueXRL3MgGlz1yEJGvFbSLjP1QoTOsOHrVat5UINg1AFK4XIUQFPSri0Wbf6m0s 2gmHy/ap7hEXA== From: Jeff Layton To: Christian Brauner , Miklos Szeredi Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 46/92] fuse: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:11 -0400 Message-ID: <20230705190309.579783-44-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610780804149267?= X-GMAIL-MSGID: =?utf-8?q?1770610780804149267?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/fuse/control.c | 2 +- fs/fuse/dir.c | 8 ++++---- fs/fuse/inode.c | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 247ef4f76761..ab62e4624256 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -235,7 +235,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, inode->i_mode = mode; inode->i_uid = fc->user_id; inode->i_gid = fc->group_id; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); /* setting ->i_op to NULL is not allowed */ if (iop) inode->i_op = iop; diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index f67bef9d83c4..672245ee0394 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -933,7 +933,7 @@ void fuse_flush_time_update(struct inode *inode) static void fuse_update_ctime_in_cache(struct inode *inode) { if (!IS_NOCMTIME(inode)) { - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty_sync(inode); fuse_flush_time_update(inode); } @@ -1715,8 +1715,8 @@ int fuse_flush_times(struct inode *inode, struct fuse_file *ff) inarg.mtimensec = inode->i_mtime.tv_nsec; if (fm->fc->minor >= 23) { inarg.valid |= FATTR_CTIME; - inarg.ctime = inode->i_ctime.tv_sec; - inarg.ctimensec = inode->i_ctime.tv_nsec; + inarg.ctime = inode_get_ctime(inode).tv_sec; + inarg.ctimensec = inode_get_ctime(inode).tv_nsec; } if (ff) { inarg.valid |= FATTR_FH; @@ -1857,7 +1857,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr, if (attr->ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (attr->ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_set_ctime_to_ts(inode, attr->ia_ctime); /* FIXME: clear I_DIRTY_SYNC? */ } diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index f19d748890f0..549358ffea8b 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -194,8 +194,7 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, inode->i_mtime.tv_nsec = attr->mtimensec; } if (!(cache_mask & STATX_CTIME)) { - inode->i_ctime.tv_sec = attr->ctime; - inode->i_ctime.tv_nsec = attr->ctimensec; + inode_set_ctime(inode, attr->ctime, attr->ctimensec); } if (attr->blksize != 0) @@ -259,8 +258,8 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, attr->mtimensec = inode->i_mtime.tv_nsec; } if (cache_mask & STATX_CTIME) { - attr->ctime = inode->i_ctime.tv_sec; - attr->ctimensec = inode->i_ctime.tv_nsec; + attr->ctime = inode_get_ctime(inode).tv_sec; + attr->ctimensec = inode_get_ctime(inode).tv_nsec; } if ((attr_version != 0 && fi->attr_version > attr_version) || @@ -318,8 +317,7 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr, inode->i_size = attr->size; inode->i_mtime.tv_sec = attr->mtime; inode->i_mtime.tv_nsec = attr->mtimensec; - inode->i_ctime.tv_sec = attr->ctime; - inode->i_ctime.tv_nsec = attr->ctimensec; + inode_set_ctime(inode, attr->ctime, attr->ctimensec); if (S_ISREG(inode->i_mode)) { fuse_init_common(inode); fuse_init_file_inode(inode, attr->flags); @@ -1401,16 +1399,18 @@ EXPORT_SYMBOL_GPL(fuse_dev_free); static void fuse_fill_attr_from_inode(struct fuse_attr *attr, const struct fuse_inode *fi) { + struct timespec64 ctime = inode_get_ctime(&fi->inode); + *attr = (struct fuse_attr){ .ino = fi->inode.i_ino, .size = fi->inode.i_size, .blocks = fi->inode.i_blocks, .atime = fi->inode.i_atime.tv_sec, .mtime = fi->inode.i_mtime.tv_sec, - .ctime = fi->inode.i_ctime.tv_sec, + .ctime = ctime.tv_sec, .atimensec = fi->inode.i_atime.tv_nsec, .mtimensec = fi->inode.i_mtime.tv_nsec, - .ctimensec = fi->inode.i_ctime.tv_nsec, + .ctimensec = ctime.tv_nsec, .mode = fi->inode.i_mode, .nlink = fi->inode.i_nlink, .uid = fi->inode.i_uid.val, From patchwork Wed Jul 5 19:01:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095632vqx; Wed, 5 Jul 2023 12:40:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlE5T6qF0n0DvJRcD2XwHTuHoLHUGJK0gdGnrLGppR+URerddcD5+ypha5jASp/ZiknGvs09 X-Received: by 2002:a05:6808:616:b0:3a3:99ea:7770 with SMTP id y22-20020a056808061600b003a399ea7770mr10373346oih.30.1688586042868; Wed, 05 Jul 2023 12:40:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586042; cv=none; d=google.com; s=arc-20160816; b=G6909CVq+nFO4Afdijpb9MEgDmW6FvV4HUkF0HdQmbADqPss0+ViBBSOrkjqx0iyR7 8nyFQ+LCDfOkOD3nMUPjrGUquQq3F+/I6wR7526OTWf6tHDhlOKsmrsBmd8xaizhgBjB 3qwgHpUQEXbRMq6P7HN2tfcr+qvDs0HmIHKu+DvJblTmcrrIFgqtjUY8LxxK1JCibPKd vZ1+Dsy16rO5l6P9n12CeFNU8dDLKQKhEaXVa5xHdmU5oHx8I2i+5ULtJoJ9njt24U+l F9e/sZEZBh+9I0yWVcquSIN5bnkeZvpJTHq4Vzr8VyzRghLh0vxQlCqJtPevpTTNqXQr Q//A== 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=kPxdiMXaMrrx0iwO2e3E6QtRPx7rKJLBACi5fE6HB04=; fh=EALXZcQgYmziEoUUPmz2GI2OofIToepn//SlkgLCdXo=; b=cuSCJRpmu4KbXvMpeq1goJGQ2FAs5AddJXnfH82iQf/BdhlxT/zC+aB1e3keqacKYV maGjs9X5DFIvyWHE9PpItI4mSngUg6ql8yI5Tl7Hl1Wlpu8f9vw7YfNLkv/2Y1m7aoxD aOuBcbQEVwf/5N1ozqABcGdTNdi9gU/hitmswRSkH3GKhfKr5w3bM7gPOdFLiEiQFwGx pcRSzo+rqWJ7pnu5rStwJUp7ahfPUXngwYbNpC4IYbru628k0PrP3MSPXRSL2cIQJ9+F 8EV6tCvl9H4ywtaYsAB/efn0DkjobnN/jrJ8w8c+oKHNDzQDiMP85N6EETRgDEKBrnup VF7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fRUV8hWx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w70-20020a638249000000b0055acc7f8086si20959813pgd.821.2023.07.05.12.40.30; Wed, 05 Jul 2023 12:40:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fRUV8hWx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233499AbjGETH3 (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233805AbjGETGa (ORCPT ); Wed, 5 Jul 2023 15:06:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A79731BEB; Wed, 5 Jul 2023 12:04:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 88B1E616F5; Wed, 5 Jul 2023 19:04:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 331F8C433C7; Wed, 5 Jul 2023 19:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583868; bh=2TryOk3H01wwKrfbnwqW6IB135YzidSv2NOVrbNXzZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRUV8hWxJX1yjZ8Zl6BLM4mVDeoIWXgGzp8E1qb/9iLbvK9RfgfSuW305nFZX0DXN wxdn8wRuV9dAWghkTs8WQEcYL0BMeg8eXkDi2TrsK+Q8qU0n2PX27QbkloTS0AZ344 770Ra/iYPlHIyJED/d0TQil+avuL40nnhfYNauXmLSIuQYj2jO6l4Azl946vMBNqe1 BVg5Ao0HxfFYW4TxCKRBQWyqiUsp8JxbHjFpFJEUMvm1mKka6vfMfoCK8ox8H+1Agj tt1EZfrf86yRz1ra2douP46OqDOMpDmOtLr2pUxj/nk6bhOVel9Me0suOXrq3hbpGv VSPhKWEGTqZ6Q== From: Jeff Layton To: Christian Brauner , Bob Peterson , Andreas Gruenbacher Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cluster-devel@redhat.com Subject: [PATCH v2 47/92] gfs2: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:12 -0400 Message-ID: <20230705190309.579783-45-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610798443708035?= X-GMAIL-MSGID: =?utf-8?q?1770610798443708035?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/gfs2/acl.c | 2 +- fs/gfs2/bmap.c | 11 +++++------ fs/gfs2/dir.c | 15 ++++++++------- fs/gfs2/file.c | 2 +- fs/gfs2/glops.c | 4 ++-- fs/gfs2/inode.c | 8 ++++---- fs/gfs2/super.c | 4 ++-- fs/gfs2/xattr.c | 8 ++++---- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c index a392aa0f041d..443640e6fb9c 100644 --- a/fs/gfs2/acl.c +++ b/fs/gfs2/acl.c @@ -142,7 +142,7 @@ int gfs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, ret = __gfs2_set_acl(inode, acl, type); if (!ret && mode != inode->i_mode) { - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode->i_mode = mode; mark_inode_dirty(inode); } diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 8d611fbcf0bd..45ea63f7167d 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1386,7 +1386,7 @@ static int trunc_start(struct inode *inode, u64 newsize) ip->i_diskflags |= GFS2_DIF_TRUNC_IN_PROG; i_size_write(inode, newsize); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); gfs2_dinode_out(ip, dibh->b_data); if (journaled) @@ -1583,8 +1583,7 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, struct gfs2_holder *rd_gh, /* Every transaction boundary, we rewrite the dinode to keep its di_blocks current in case of failure. */ - ip->i_inode.i_mtime = ip->i_inode.i_ctime = - current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -1950,7 +1949,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length) gfs2_statfs_change(sdp, 0, +btotal, 0); gfs2_quota_change(ip, -(s64)btotal, ip->i_inode.i_uid, ip->i_inode.i_gid); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); up_write(&ip->i_rw_mutex); @@ -1993,7 +1992,7 @@ static int trunc_end(struct gfs2_inode *ip) gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); gfs2_ordered_del_inode(ip); } - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG; gfs2_trans_add_meta(ip->i_gl, dibh); @@ -2094,7 +2093,7 @@ static int do_grow(struct inode *inode, u64 size) goto do_end_trans; truncate_setsize(inode, size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 54a6d17b8c25..1a2afa88f8be 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -130,7 +130,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf, memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); if (ip->i_inode.i_size < offset + size) i_size_write(&ip->i_inode, offset + size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -227,7 +227,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf, if (ip->i_inode.i_size < offset + copied) i_size_write(&ip->i_inode, offset + copied); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); @@ -1814,7 +1814,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, gfs2_inum_out(nip, dent); dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode)); dent->de_rahead = cpu_to_be16(gfs2_inode_ra_len(nip)); - tv = current_time(&ip->i_inode); + tv = inode_set_ctime_current(&ip->i_inode); if (ip->i_diskflags & GFS2_DIF_EXHASH) { leaf = (struct gfs2_leaf *)bh->b_data; be16_add_cpu(&leaf->lf_entries, 1); @@ -1825,7 +1825,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, da->bh = NULL; brelse(bh); ip->i_entries++; - ip->i_inode.i_mtime = ip->i_inode.i_ctime = tv; + ip->i_inode.i_mtime = tv; if (S_ISDIR(nip->i_inode.i_mode)) inc_nlink(&ip->i_inode); mark_inode_dirty(inode); @@ -1876,7 +1876,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) const struct qstr *name = &dentry->d_name; struct gfs2_dirent *dent, *prev = NULL; struct buffer_head *bh; - struct timespec64 tv = current_time(&dip->i_inode); + struct timespec64 tv; /* Returns _either_ the entry (if its first in block) or the previous entry otherwise */ @@ -1896,6 +1896,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) } dirent_del(dip, bh, prev, dent); + tv = inode_set_ctime_current(&dip->i_inode); if (dip->i_diskflags & GFS2_DIF_EXHASH) { struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data; u16 entries = be16_to_cpu(leaf->lf_entries); @@ -1910,7 +1911,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) if (!dip->i_entries) gfs2_consist_inode(dip); dip->i_entries--; - dip->i_inode.i_mtime = dip->i_inode.i_ctime = tv; + dip->i_inode.i_mtime = tv; if (d_is_dir(dentry)) drop_nlink(&dip->i_inode); mark_inode_dirty(&dip->i_inode); @@ -1951,7 +1952,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, dent->de_type = cpu_to_be16(new_type); brelse(bh); - dip->i_inode.i_mtime = dip->i_inode.i_ctime = current_time(&dip->i_inode); + dip->i_inode.i_mtime = inode_set_ctime_current(&dip->i_inode); mark_inode_dirty_sync(&dip->i_inode); return 0; } diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 1bf3c4453516..ecbfbc6df621 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -260,7 +260,7 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask) error = gfs2_meta_inode_buffer(ip, &bh); if (error) goto out_trans_end; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); gfs2_trans_add_meta(ip->i_gl, bh); ip->i_diskflags = new_flags; gfs2_dinode_out(ip, bh->b_data); diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 54319328b16b..aecdac3cfbe1 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -437,8 +437,8 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) inode->i_atime = atime; inode->i_mtime.tv_sec = be64_to_cpu(str->di_mtime); inode->i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); - inode->i_ctime.tv_sec = be64_to_cpu(str->di_ctime); - inode->i_ctime.tv_nsec = be32_to_cpu(str->di_ctime_nsec); + inode_set_ctime(inode, be64_to_cpu(str->di_ctime), + be32_to_cpu(str->di_ctime_nsec)); ip->i_goal = be64_to_cpu(str->di_goal_meta); ip->i_generation = be64_to_cpu(str->di_generation); diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 17c994a0c0d0..2ded6c813f20 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -690,7 +690,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, set_nlink(inode, S_ISDIR(mode) ? 2 : 1); inode->i_rdev = dev; inode->i_size = size; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); munge_mode_uid_gid(dip, inode); check_and_update_goal(dip); ip->i_goal = dip->i_goal; @@ -1029,7 +1029,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, gfs2_trans_add_meta(ip->i_gl, dibh); inc_nlink(&ip->i_inode); - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_set_ctime_current(&ip->i_inode); ihold(inode); d_instantiate(dentry, inode); mark_inode_dirty(inode); @@ -1114,7 +1114,7 @@ static int gfs2_unlink_inode(struct gfs2_inode *dip, return error; ip->i_entries = 0; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (S_ISDIR(inode->i_mode)) clear_nlink(inode); else @@ -1371,7 +1371,7 @@ static int update_moved_ino(struct gfs2_inode *ip, struct gfs2_inode *ndip, if (dir_rename) return gfs2_dir_mvino(ip, &gfs2_qdotdot, ndip, DT_DIR); - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_set_ctime_current(&ip->i_inode); mark_inode_dirty_sync(&ip->i_inode); return 0; } diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 9f4d5d6549ee..ec0296b35dfe 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -412,7 +412,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(inode)); str->di_atime = cpu_to_be64(inode->i_atime.tv_sec); str->di_mtime = cpu_to_be64(inode->i_mtime.tv_sec); - str->di_ctime = cpu_to_be64(inode->i_ctime.tv_sec); + str->di_ctime = cpu_to_be64(inode_get_ctime(inode).tv_sec); str->di_goal_meta = cpu_to_be64(ip->i_goal); str->di_goal_data = cpu_to_be64(ip->i_goal); @@ -429,7 +429,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str->di_eattr = cpu_to_be64(ip->i_eattr); str->di_atime_nsec = cpu_to_be32(inode->i_atime.tv_nsec); str->di_mtime_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); - str->di_ctime_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); + str->di_ctime_nsec = cpu_to_be32(inode_get_ctime(inode).tv_nsec); } /** diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 93b36d026bb4..4fea70c0fe3d 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -311,7 +311,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, ea->ea_num_ptrs = 0; } - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_set_ctime_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); gfs2_trans_end(sdp); @@ -763,7 +763,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er, if (error) goto out_end_trans; - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_set_ctime_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); out_end_trans: @@ -888,7 +888,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh, if (es->es_el) ea_set_remove_stuffed(ip, es->es_el); - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_set_ctime_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); gfs2_trans_end(GFS2_SB(&ip->i_inode)); @@ -1106,7 +1106,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el) ea->ea_type = GFS2_EATYPE_UNUSED; } - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_set_ctime_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); gfs2_trans_end(GFS2_SB(&ip->i_inode)); From patchwork Wed Jul 5 19:01:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116312 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2087638vqx; Wed, 5 Jul 2023 12:24:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69WFXsyp99AwBHbSV+v3f8z0pjtcWKLi6CL+H+zePAowG33p8dlufhmFeqSHjx7EsjDh/F X-Received: by 2002:a05:6a20:3212:b0:12c:763b:f098 with SMTP id hl18-20020a056a20321200b0012c763bf098mr11614182pzc.11.1688585047027; Wed, 05 Jul 2023 12:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585047; cv=none; d=google.com; s=arc-20160816; b=cMZeH8SiEtivSKsPl1BmFKbw+dUxyEQL29N/oxTAAZ9j4cOoW11iicEkkM9yINdwiG e5OdvK3vTF1G0KFCQNgPZOsHA4/kWnKQVBcpAOuM2POqX6enA6q/zGaAFuN4mi46nZDz XBkXy8YaBunbx2bDKmx6R2+sGwbw2AI2OtXgBB9iJL3tUEP70w/qhoQVV7uppFAk/4VA o/urpBV7Eooi6waFU6RZ4mEtTf06k80odo3FFxQkM8cqQq4QOlvStDDTK29EkEqnNi17 CVO7svoTkDOp35z2cW4OfCmWx6q0QHbsWGi34AwI3yrobzslOh3KhT03RbwWxObxRsLR OPww== 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=nxR9WwejBmTk4GPy+O393zK3dGnFK3Xfez9Rf6q+L6E=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=0wLxTOaHrA9SwufaHo4df+mqfY7wM2E7GvGRmtkQnyoZXIg5dZv9PkNFO5+ho4LEjN vBA6immM679gysg0nHtXbFXNg6QIhLtxMup/te4HWNoNzN/HyR8o4KgpG7xF5FjAnI6x mHqtPzKGAM6pJYNK/k2Yun4lxvcOYjqz9pnpJcgOlFIVNQzxH7QAeazxZGyn3kCplzLw 4zTuuQK5Rkf3yGMBn0rWAYMqZ8eJRAISD9eq7mniPzf5LRt3QPPljFtf2kMjT1gpgfuE FrAOoyTzGRxTWXLJSmnRjWNEj9gxlPMM2el8z+F7Vpmj/TIBgk55xaoRklCi0z2LkDmZ umhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=exaQeWtd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r5-20020a632b05000000b0055ba896ec95si7160700pgr.779.2023.07.05.12.23.52; Wed, 05 Jul 2023 12:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=exaQeWtd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233879AbjGETHf (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233814AbjGETGn (ORCPT ); Wed, 5 Jul 2023 15:06:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC3F1BF9; Wed, 5 Jul 2023 12:04:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5193D61704; Wed, 5 Jul 2023 19:04:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37EF2C433C9; Wed, 5 Jul 2023 19:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583869; bh=fywqEQ5cn0nBZC+81C4lX2F4icKWGKCzmTpyfqbEI3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=exaQeWtd5Q2J4elDK1iAzvk5yuOP9uNBJe1CUBAAwLvJsAknEQroJ8chxO0EyZU8N PfgBukzVIs8ZZ6pw1HJDTq6kInMbC0gt2D8N3fWr33oORUEQaX3ZOia9zcDz6HJujF MynaMZl5/qsApY1vWM5cfQChw6bEsAPKDdaorCW/ww4svUgxIbhHALkQzBhstYCWth 1HHwDwY6XH4h/IWMKhumEFgFsvWHgoAAv4WuCcJ8icf9/AinC8TBNx5X1o0ny+alcV icjaEPU09NmtS0/Km1dOvJjliokDn9plqnx12O0hytjC6Af2QEJkOIEwf2x7XGLbYX 76CVrZF/b1zjQ== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 48/92] hfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:13 -0400 Message-ID: <20230705190309.579783-46-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609753912352025?= X-GMAIL-MSGID: =?utf-8?q?1770609753912352025?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/hfs/catalog.c | 8 ++++---- fs/hfs/dir.c | 2 +- fs/hfs/inode.c | 13 ++++++------- fs/hfs/sysdep.c | 4 +++- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c index d365bf0b8c77..632c226a3972 100644 --- a/fs/hfs/catalog.c +++ b/fs/hfs/catalog.c @@ -133,7 +133,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct i goto err1; dir->i_size++; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); hfs_find_exit(&fd); return 0; @@ -269,7 +269,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str) } dir->i_size--; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); res = 0; out: @@ -337,7 +337,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, if (err) goto out; dst_dir->i_size++; - dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir); + dst_dir->i_mtime = inode_set_ctime_current(dst_dir); mark_inode_dirty(dst_dir); /* finally remove the old entry */ @@ -349,7 +349,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, if (err) goto out; src_dir->i_size--; - src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir); + src_dir->i_mtime = inode_set_ctime_current(src_dir); mark_inode_dirty(src_dir); type = entry.type; diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 3e1e3dcf0b48..b75c26045df4 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -263,7 +263,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry) if (res) return res; clear_nlink(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); hfs_delete_inode(inode); mark_inode_dirty(inode); return 0; diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 441d7fc952e3..ee349b72cfb3 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -200,7 +200,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); set_nlink(inode, 1); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); HFS_I(inode)->flags = 0; HFS_I(inode)->rsrc_inode = NULL; HFS_I(inode)->fs_blocks = 0; @@ -355,8 +355,8 @@ static int hfs_read_inode(struct inode *inode, void *data) inode->i_mode |= S_IWUGO; inode->i_mode &= ~hsb->s_file_umask; inode->i_mode |= S_IFREG; - inode->i_ctime = inode->i_atime = inode->i_mtime = - hfs_m_to_utime(rec->file.MdDat); + inode->i_atime = inode->i_mtime = inode_set_ctime_to_ts(inode, + hfs_m_to_utime(rec->file.MdDat)); inode->i_op = &hfs_file_inode_operations; inode->i_fop = &hfs_file_operations; inode->i_mapping->a_ops = &hfs_aops; @@ -366,8 +366,8 @@ static int hfs_read_inode(struct inode *inode, void *data) inode->i_size = be16_to_cpu(rec->dir.Val) + 2; HFS_I(inode)->fs_blocks = 0; inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask); - inode->i_ctime = inode->i_atime = inode->i_mtime = - hfs_m_to_utime(rec->dir.MdDat); + inode->i_atime = inode->i_mtime = inode_set_ctime_to_ts(inode, + hfs_m_to_utime(rec->dir.MdDat)); inode->i_op = &hfs_dir_inode_operations; inode->i_fop = &hfs_dir_operations; break; @@ -654,8 +654,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, truncate_setsize(inode, attr->ia_size); hfs_file_truncate(inode); - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } setattr_copy(&nop_mnt_idmap, inode, attr); diff --git a/fs/hfs/sysdep.c b/fs/hfs/sysdep.c index 2875961fdc10..dc27d418fbcd 100644 --- a/fs/hfs/sysdep.c +++ b/fs/hfs/sysdep.c @@ -28,7 +28,9 @@ static int hfs_revalidate_dentry(struct dentry *dentry, unsigned int flags) /* fix up inode on a timezone change */ diff = sys_tz.tz_minuteswest * 60 - HFS_I(inode)->tz_secondswest; if (diff) { - inode->i_ctime.tv_sec += diff; + struct timespec64 ctime = inode_get_ctime(inode); + + inode_set_ctime(inode, ctime.tv_sec + diff, ctime.tv_nsec); inode->i_atime.tv_sec += diff; inode->i_mtime.tv_sec += diff; HFS_I(inode)->tz_secondswest += diff; From patchwork Wed Jul 5 19:01:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116379 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097359vqx; Wed, 5 Jul 2023 12:44:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhu1hil0iH55c4hp2gK/ZKaoF4W143etygACdSl8EFwQ8UmGxDkvJF3z+yGTG4TxpZIUl9 X-Received: by 2002:aa7:8ec7:0:b0:64d:5b4b:8429 with SMTP id b7-20020aa78ec7000000b0064d5b4b8429mr16030758pfr.18.1688586274955; Wed, 05 Jul 2023 12:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586274; cv=none; d=google.com; s=arc-20160816; b=jN7RkxLuFEcUBZh/UFkRKfdErtltFNV2+eLKRLdyPv0KZhkXM6zeLBVn5igITSWTLZ rj2ER84GAx1qlmQmpHVMKd3T1VX/iTzANUp7U6bvH5iJnD16+Dql1uHRE2Ymt9oAGrGD kZOZXpoDakN06VXzvhb/9ph9BwiGvjlyf/TNp9E1TxBNvBZZDDx5p4ID6rHSJl6uYpgF W8Fw4vpFxVzVjBUsNzK6DsHjc0avlvrQGAm5ydtFEdWwHikN1YzGlJQSWTVq6/fGC2jw 0EtNbqBK9qGTqQYYzq/vY8SuO0CTdn/2SjouXWwq4rspbxt3JIT4AYmJvL74cUm986U4 tCsA== 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=cQdhU4GUAlBh7/VkQWrCenIc6I6ntzST1sk6/EuGGOY=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=piQFlGFZuSJIoVZgN3lx7vOKYqcKCPmLsfEu/h0nMPUm5VtssOljl2ei30Ar0M8Q1q XYL72xNv7F6cqFMR6t6K0+d4SLWYuRjB2vHXwSw6H9Ox1tiwi7Itz6T28r5EjgOCC3Mf pFFELhbOHDZWh/7JyrORGgYdh+J91r6JUSWmTIZrFu/Zh0/fojSMQUIWVBaV2LKcDD7j 5HwrJV4Bo089dWgsxUAnV3ne29Nm9fAsoY9xORHPzNop40INk2/cW4egaytcX0bt+XEu eagicH1prd2bBN9j+DcvoxfKB20Y9Bi0akNsFzGmajUaGOD+HUzIu0YyC4/OkyPq7swz ZQRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SjgNmrT6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w70-20020a638249000000b0055acc7f8086si20959813pgd.821.2023.07.05.12.44.22; Wed, 05 Jul 2023 12:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SjgNmrT6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233895AbjGETHp (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233816AbjGETGn (ORCPT ); Wed, 5 Jul 2023 15:06:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16FB91BFB; Wed, 5 Jul 2023 12:04:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBE32616EE; Wed, 5 Jul 2023 19:04:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D642CC433C8; Wed, 5 Jul 2023 19:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583871; bh=pAYK4jRtSf2dl/XbNth++d6zVtmL9UNXNT5q53wy680=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SjgNmrT6kfJhbF1rqw26ri9S7MpH8jneiGey1PHyURAePU7V1/RIH0FVvx0K2fwks v54dds3zQzTObuXYFSmfibLNT1hBKD+3/ntCjJyKw5z1h0Aq1VVH7coExp+egUzM/o GhXJVDNWz/aBnsTIj9ljdQYh6XNOLKyYgkQpYGQtebTcCu9TkkvNCbKyU4WON4KFJ6 MugXI0YMogsWOPJCDJfuoO7dygvzl6/t7AKCN5Krb+GCxhKPaNDNF/+EK+SB2kRDeb UR7gl73Ai3qn3R2sLDDNs9pB5lqt4UA/vDQ6TZwIQN3l1MhC54EsuXWmrfE8ecZ86o ply0teg9xRvNQ== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 49/92] hfsplus: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:14 -0400 Message-ID: <20230705190309.579783-47-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611041702839709?= X-GMAIL-MSGID: =?utf-8?q?1770611041702839709?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/hfsplus/catalog.c | 8 ++++---- fs/hfsplus/dir.c | 6 +++--- fs/hfsplus/inode.c | 16 +++++++++------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index 35472cba750e..e71ae2537eaa 100644 --- a/fs/hfsplus/catalog.c +++ b/fs/hfsplus/catalog.c @@ -312,7 +312,7 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir, dir->i_size++; if (S_ISDIR(inode->i_mode)) hfsplus_subfolders_inc(dir); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); hfs_find_exit(&fd); @@ -417,7 +417,7 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str) dir->i_size--; if (type == HFSPLUS_FOLDER) hfsplus_subfolders_dec(dir); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); if (type == HFSPLUS_FILE || type == HFSPLUS_FOLDER) { @@ -494,7 +494,7 @@ int hfsplus_rename_cat(u32 cnid, dst_dir->i_size++; if (type == HFSPLUS_FOLDER) hfsplus_subfolders_inc(dst_dir); - dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir); + dst_dir->i_mtime = inode_set_ctime_current(dst_dir); /* finally remove the old entry */ err = hfsplus_cat_build_key(sb, src_fd.search_key, @@ -511,7 +511,7 @@ int hfsplus_rename_cat(u32 cnid, src_dir->i_size--; if (type == HFSPLUS_FOLDER) hfsplus_subfolders_dec(src_dir); - src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir); + src_dir->i_mtime = inode_set_ctime_current(src_dir); /* remove old thread entry */ hfsplus_cat_build_key_with_cnid(sb, src_fd.search_key, cnid); diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 56fb5f1312e7..f5c4b3e31a1c 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -346,7 +346,7 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir, inc_nlink(inode); hfsplus_instantiate(dst_dentry, inode, cnid); ihold(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); sbi->file_count++; hfsplus_mark_mdb_dirty(dst_dir->i_sb); @@ -405,7 +405,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) hfsplus_delete_inode(inode); } else sbi->file_count--; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); out: mutex_unlock(&sbi->vh_mutex); @@ -426,7 +426,7 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry) if (res) goto out; clear_nlink(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); hfsplus_delete_inode(inode); mark_inode_dirty(inode); out: diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 7d1a675e037d..40c61ab4a918 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -267,7 +267,7 @@ static int hfsplus_setattr(struct mnt_idmap *idmap, } truncate_setsize(inode, attr->ia_size); hfsplus_file_truncate(inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); } setattr_copy(&nop_mnt_idmap, inode, attr); @@ -392,7 +392,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir, inode->i_ino = sbi->next_cnid++; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); set_nlink(inode, 1); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); hip = HFSPLUS_I(inode); INIT_LIST_HEAD(&hip->open_dir_list); @@ -523,7 +523,8 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) inode->i_size = 2 + be32_to_cpu(folder->valence); inode->i_atime = hfsp_mt2ut(folder->access_date); inode->i_mtime = hfsp_mt2ut(folder->content_mod_date); - inode->i_ctime = hfsp_mt2ut(folder->attribute_mod_date); + inode_set_ctime_to_ts(inode, + hfsp_mt2ut(folder->attribute_mod_date)); HFSPLUS_I(inode)->create_date = folder->create_date; HFSPLUS_I(inode)->fs_blocks = 0; if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { @@ -564,7 +565,8 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) } inode->i_atime = hfsp_mt2ut(file->access_date); inode->i_mtime = hfsp_mt2ut(file->content_mod_date); - inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); + inode_set_ctime_to_ts(inode, + hfsp_mt2ut(file->attribute_mod_date)); HFSPLUS_I(inode)->create_date = file->create_date; } else { pr_err("bad catalog entry used to create inode\n"); @@ -609,7 +611,7 @@ int hfsplus_cat_write_inode(struct inode *inode) hfsplus_cat_set_perms(inode, &folder->permissions); folder->access_date = hfsp_ut2mt(inode->i_atime); folder->content_mod_date = hfsp_ut2mt(inode->i_mtime); - folder->attribute_mod_date = hfsp_ut2mt(inode->i_ctime); + folder->attribute_mod_date = hfsp_ut2mt(inode_get_ctime(inode)); folder->valence = cpu_to_be32(inode->i_size - 2); if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { folder->subfolders = @@ -644,7 +646,7 @@ int hfsplus_cat_write_inode(struct inode *inode) file->flags &= cpu_to_be16(~HFSPLUS_FILE_LOCKED); file->access_date = hfsp_ut2mt(inode->i_atime); file->content_mod_date = hfsp_ut2mt(inode->i_mtime); - file->attribute_mod_date = hfsp_ut2mt(inode->i_ctime); + file->attribute_mod_date = hfsp_ut2mt(inode_get_ctime(inode)); hfs_bnode_write(fd.bnode, &entry, fd.entryoffset, sizeof(struct hfsplus_cat_file)); } @@ -700,7 +702,7 @@ int hfsplus_fileattr_set(struct mnt_idmap *idmap, else hip->userflags &= ~HFSPLUS_FLG_NODUMP; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); return 0; From patchwork Wed Jul 5 19:01:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097921vqx; Wed, 5 Jul 2023 12:45:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jGrKWDEbyOkI3CBaP4owm0s51YpoV+gaPX4Hg5aaDCwMlL3dvFGiZbqkWDqWX3JGz7rbS X-Received: by 2002:a05:6a20:1388:b0:114:6993:5a3b with SMTP id hn8-20020a056a20138800b0011469935a3bmr10285362pzc.13.1688586348335; Wed, 05 Jul 2023 12:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586348; cv=none; d=google.com; s=arc-20160816; b=GlI1EuzDSW4iRFRTr6mlHXmZgyIrAuX1zPwAJ9Ac0uYoNefokEcClKvDNIo5aTKZJO YfxgdPFhycpoZ0ARE2bpCx0tVZv6MZQVlMOA7AZqOsNrO1q+04uaSf5AaTLqiFpgqbaW 0QzcvAJtHEogfFQLh25gwspXZ6IynT9gl8+2qKOuK9WZy/VkJ4Z1iOtn3Wb0iPlKZ552 17nDcKgklvkv3aSqBfhikHLKKSfs58DhUV4pgxuFtQzAYIVygYjtXp8IRHkgWcc6/N5E Tx1OCdAp2rIZSSgr81+knxDMe8GmHNCBNYwzRt4dZzaa3U1NFVA2n48x8sw6MWxz0pLP KOhg== 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=dPEvlZwcR7Jt/H4Q7r5BIirCtUKxrr0GEVAyp4Yjbzw=; fh=5DleK0e8Ivq2joyoLCwvGwQnhxUz06pERp7VYRDnmPU=; b=RqHLSaFHAVxa0Sq6Zz19Y54MceeWv35Y4WrkENmU17WIRnPLoBVJJBknMdiKx9efBB u42MHWf4mv7Nz1hLO87YhxFtqQo7jYjt8eL3KqJZy4tanwfmr1auzBDaRwHr4XFRGDCO p0Oflbm3lB+BmSab1FePbTkWpzjRfpODCD2F517X9aNnYxFE0E1gseB0XVFyLwn2Wem+ OJFENWQgIg4GSSy7/umFfMx8jZTgssi0dU/k68QIWvJBGNcE1Jzd4A5MMxASeMdWmh1M SkG7d5qk4Li23I49MyGeoMf0YMyWpi2phjsbkJYeK2xzoSyjXbhcaq125sMQFznV/qZ8 2Ugg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QkIfF+Sd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh7-20020a056a00808700b00674311392f7si21066785pfb.31.2023.07.05.12.45.33; Wed, 05 Jul 2023 12:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QkIfF+Sd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233884AbjGETHi (ORCPT + 99 others); Wed, 5 Jul 2023 15:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233815AbjGETGn (ORCPT ); Wed, 5 Jul 2023 15:06:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9DD81FC6; Wed, 5 Jul 2023 12:04:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89BCA616F4; Wed, 5 Jul 2023 19:04:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2349FC433C7; Wed, 5 Jul 2023 19:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583873; bh=Q07agmN+3+t14XXRG6FKQDnwU5RN+rMKtJn4NHdEWos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QkIfF+SdhLDlA6hyjj0ReVT8TuhVzupOEUrHVW1NoCL0TKXJ6VhiTU4HAAY9HUPxI EIlpEW655H87oQuluOyUe84GuJS3XSH1DmOCPy0l2+r1UCkn2c0Ys6DBxzdeZxF/CE 4zI97zX8fF44I5BUOzZfc7IxAf4k1wTpTy0CfO7rFSdvWIQ+tFpDRxtE57mD0ZPsbM SFRhL8QogFgK4DkrTPfL+fjPJN0squ60mBnqmQ1OspfOoKhnxEdanEUc5C2dgTmX7i yvOMmEzu6ZSg88WKi/2glAMJh/J51GGR3EeFgBaohUXR2oTe0PRe8IfW9NBTioLufs THtBLd8+7Xeqg== From: Jeff Layton To: Christian Brauner , Richard Weinberger , Anton Ivanov , Johannes Berg Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-um@lists.infradead.org Subject: [PATCH v2 50/92] hostfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:15 -0400 Message-ID: <20230705190309.579783-48-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611118845884011?= X-GMAIL-MSGID: =?utf-8?q?1770611118845884011?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/hostfs/hostfs_kern.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 46387090eb76..182af84a9c12 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -517,8 +517,7 @@ static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st) (struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec }; ino->i_mtime = (struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec }; - ino->i_ctime = - (struct timespec64){ st->ctime.tv_sec, st->ctime.tv_nsec }; + inode_set_ctime_to_ts(ino, &st->ctime); ino->i_size = st->size; ino->i_blocks = st->blocks; return 0; From patchwork Wed Jul 5 19:01:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095402vqx; Wed, 5 Jul 2023 12:40:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4cXoTZWAduLCk0xG+Ugz/R1vMhmNU+fFWdyDRgd8dVRqiy5VCDHGAQnc+oG4JTxdvmIkE5 X-Received: by 2002:a9d:6ac7:0:b0:6b7:4e87:8c62 with SMTP id m7-20020a9d6ac7000000b006b74e878c62mr13956646otq.23.1688586017536; Wed, 05 Jul 2023 12:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586017; cv=none; d=google.com; s=arc-20160816; b=djBR0mbuxA5NSbF0smREipCk6cRZTUbu5qwZOPxeHhljHSbBHgYI1R+YeOVgrjAVXH rAktCruM+HEvqMh4vhS7pQiz5/JFQH94+fSEX4/qR+u8h1kZeSsceDWpy8jJ6Xhnctjy 3wG9+pTNWcxBl/GlLcrYNH0/1KafrpMK05WqJKclskSmlgEYzS9YKHXQLKm3sXqRPCcR R3SXfGjL1IrUg1wk6pcJOqINbNIkqPKLB/ZJ9bnR4I1zUfcqQVN7JMWKvoTFU2r1YZff CcyVob8PmftvKckW56mELgDgQ/iQaMQlRH9XXi9llWZsEx77oES3sdArVB+ADGVwvRDV +2hA== 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=CiRWo5+hB/+ybtOl+GMkQ7ZGVSWw9GoX/X+7NUg86Nw=; fh=DoxHs2ZZwTjWG2xzCew4J2kS0sLp67WYVIEgiMFgixM=; b=TZN/IC8k/6oTqtWaUK0wv9lY6qqvyjSFiQ+wxVyckRQu7H/K5m5El0mBiHIYKSktDQ 2nUzLnC5hMXxmaKmXVXynAOG9w1TBUtmcF5ORnN+ERK+2sgdR4tdjXHhdO7oP8VHS5is 84VtPExU40UFbB68qGv8MJaHXEc/Sfcr1wmAh9YjQhSbMCBsdiAtergiLgy+TOKBc3yi eg6UoEAEVE7qZ74V9WpTI4o2mtBg87fr4o+q3+pj+oSdIcMObSVDK9Li0Y7nsooh1uGQ tyOUgmAyT6TmywtHi9CJTOSt8lpNRNxE9lYUbHsJsRjwiCNMsTyH6EjEBl+tQKFh6LhW MI9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sswrxT7Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x124-20020a636382000000b005533750837csi24462019pgb.681.2023.07.05.12.40.03; Wed, 05 Jul 2023 12:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sswrxT7Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233952AbjGETJA (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233757AbjGETGp (ORCPT ); Wed, 5 Jul 2023 15:06:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B31892D53; Wed, 5 Jul 2023 12:04:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 66F95616EF; Wed, 5 Jul 2023 19:04:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38065C433C8; Wed, 5 Jul 2023 19:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583874; bh=X2pGXZ9WnTAlxpicvepJDU/c0P2YuAYLSHDxSOea4yA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sswrxT7QljvYJl/DMZUrW9aVJ2kRxPvvzSjtPkGuZvJRgurmDzsX/Cd0Z92sni7Le JvISGCnw8RRu1eCTKEmaNYUPRvHn/cku7bsK9YM/LZwLa0zcpFeV8dkAQTtVdiP1Ez QTKO0gDdtrojBT7tIQNoxQS/nN+bzyxZ9GG8gJ9/DyDSGVmqwYR8pES4LX/C8QOT0Q sq3KmstcweJXHbBtByO6Hgw/fb4miHcT1Gc6IOsMrHP+dkzQ3JxFyT94B8zfBkkVh8 QIK0nPepFH7MdmoLqOjsVoOuwhgFNb/Fkbdvyrx6MWEvDVkPhwt2UANfR5GcWJmYn3 4AtOKzET38xIA== From: Jeff Layton To: Christian Brauner , Mikulas Patocka Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 51/92] hpfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:16 -0400 Message-ID: <20230705190309.579783-49-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610771710265820?= X-GMAIL-MSGID: =?utf-8?q?1770610771710265820?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton --- fs/hpfs/dir.c | 8 ++++---- fs/hpfs/inode.c | 6 +++--- fs/hpfs/namei.c | 26 +++++++++++++++----------- fs/hpfs/super.c | 5 +++-- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index f32f15669996..f36566d61215 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c @@ -277,10 +277,10 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, unsigned in * inode. */ - if (!result->i_ctime.tv_sec) { - if (!(result->i_ctime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->creation_date)))) - result->i_ctime.tv_sec = 1; - result->i_ctime.tv_nsec = 0; + if (!inode_get_ctime(result).tv_sec) { + time64_t csec = local_to_gmt(dir->i_sb, le32_to_cpu(de->creation_date)); + + inode_set_ctime(result, csec ? csec : 1, 0); result->i_mtime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->write_date)); result->i_mtime.tv_nsec = 0; result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->read_date)); diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index e50e92a42432..479166378bae 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -36,7 +36,7 @@ void hpfs_init_inode(struct inode *i) hpfs_inode->i_rddir_off = NULL; hpfs_inode->i_dirty = 0; - i->i_ctime.tv_sec = i->i_ctime.tv_nsec = 0; + inode_set_ctime(i, 0, 0); i->i_mtime.tv_sec = i->i_mtime.tv_nsec = 0; i->i_atime.tv_sec = i->i_atime.tv_nsec = 0; } @@ -232,7 +232,7 @@ void hpfs_write_inode_nolock(struct inode *i) if (de) { de->write_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_mtime.tv_sec)); de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_atime.tv_sec)); - de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_ctime.tv_sec)); + de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_ctime(i).tv_sec)); de->read_only = !(i->i_mode & 0222); de->ea_size = cpu_to_le32(hpfs_inode->i_ea_size); hpfs_mark_4buffers_dirty(&qbh); @@ -242,7 +242,7 @@ void hpfs_write_inode_nolock(struct inode *i) if ((de = map_dirent(i, hpfs_inode->i_dno, "\001\001", 2, NULL, &qbh))) { de->write_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_mtime.tv_sec)); de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_atime.tv_sec)); - de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_ctime.tv_sec)); + de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_ctime(i).tv_sec)); de->read_only = !(i->i_mode & 0222); de->ea_size = cpu_to_le32(/*hpfs_inode->i_ea_size*/0); de->file_size = cpu_to_le32(0); diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 69fb40b2c99a..36babb78b510 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c @@ -13,10 +13,10 @@ static void hpfs_update_directory_times(struct inode *dir) { time64_t t = local_to_gmt(dir->i_sb, local_get_seconds(dir->i_sb)); if (t == dir->i_mtime.tv_sec && - t == dir->i_ctime.tv_sec) + t == inode_get_ctime(dir).tv_sec) return; - dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t; - dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0; + dir->i_mtime.tv_sec = inode_set_ctime(dir, t, 0).tv_sec; + dir->i_mtime.tv_nsec = 0; hpfs_write_inode_nolock(dir); } @@ -59,8 +59,9 @@ static int hpfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, result->i_ino = fno; hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_i(result)->i_dno = dno; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_set_ctime(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), + 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; @@ -167,8 +168,9 @@ static int hpfs_create(struct mnt_idmap *idmap, struct inode *dir, result->i_fop = &hpfs_file_ops; set_nlink(result, 1); hpfs_i(result)->i_parent_dir = dir->i_ino; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_set_ctime(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), + 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; @@ -250,8 +252,9 @@ static int hpfs_mknod(struct mnt_idmap *idmap, struct inode *dir, hpfs_init_inode(result); result->i_ino = fno; hpfs_i(result)->i_parent_dir = dir->i_ino; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_set_ctime(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), + 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; @@ -326,8 +329,9 @@ static int hpfs_symlink(struct mnt_idmap *idmap, struct inode *dir, result->i_ino = fno; hpfs_init_inode(result); hpfs_i(result)->i_parent_dir = dir->i_ino; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_set_ctime(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), + 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 1cb89595b875..758a51564124 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -729,8 +729,9 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) root->i_atime.tv_nsec = 0; root->i_mtime.tv_sec = local_to_gmt(s, le32_to_cpu(de->write_date)); root->i_mtime.tv_nsec = 0; - root->i_ctime.tv_sec = local_to_gmt(s, le32_to_cpu(de->creation_date)); - root->i_ctime.tv_nsec = 0; + inode_set_ctime(root, + local_to_gmt(s, le32_to_cpu(de->creation_date)), + 0); hpfs_i(root)->i_ea_size = le32_to_cpu(de->ea_size); hpfs_i(root)->i_parent_dir = root->i_ino; if (root->i_size == -1) From patchwork Wed Jul 5 19:01:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097069vqx; Wed, 5 Jul 2023 12:44:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlFpBcNeUkSkaQj/eiV5JACrPy3nALRmhZaVaE43Le4EmTraMeytuGlFIdjx1XJBhLEXdhVI X-Received: by 2002:a17:902:c103:b0:1b8:9e35:2c01 with SMTP id 3-20020a170902c10300b001b89e352c01mr2692pli.4.1688586240239; Wed, 05 Jul 2023 12:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586240; cv=none; d=google.com; s=arc-20160816; b=AQnyvSIWnJNL8noonBDCXHYNdL4UA35+GtpjMeROoGfVGVJSl45Ld1mQ/TPD/dMhjT Ao5i0+wCX9IwBjWskT2pRN6DXLuYvV2o4n9OLB/VKGNb/RC67Dmb5DvsuywI2PWGM7jk IwyyTihd6qopDBzj+BM6qmtcibW0C+t8mcLM2qNDrORD/yVElyOougJgZqxO/BtSxN2A X+Jp+anXulkbpvFI2smUEKmQYUVy+DJTgN9Flz5p/1Rk4E39nFC6RXv6yhTy3ixLrLl1 IA4MSQYukI+1ChuNTIalue4fGKlWIMGnFnLj2Q6zvzLiCc2+YAP+n+y+A4h5b1lOlzHg LFNA== 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=Q0hjCfQouy2HldOFx4lZvIHbaxQxrlWvTefb6aOXcbs=; fh=r8iiQMiiefDcz5o+rDjnxiNXeFZagEsPNXCGT9gXMOQ=; b=Rk6u9Ck9/9+cB8yaHO7UYrAGxxABPNaWhnTHW9IP8LBjESUo35NwGA3K1nIAf67rDP msMKKAinowX8VAbW7HFN7nKBpgLfZVJ5BYMP3azjC0d/TkbEeOaCwcpwWRJnKfc/5K4u UvbGeH5MlQ/75JYfNF5+A7TF5oKNlPLw568Bu7juOVQW5Oyii1GA8dGB7zxoaGcvELdY bFFy706InW2yAy0zRIkCXM5AOET6RO2Q4r8ibvtJP18zUpXhojzI0J6tMaDnkVmsoLnn V4pyVp8I2S8y6WgCQlqFunIlv4MWKCMBMmM/Wvl1uHOdtgOvssXLpt82Z5FG3G976HgJ MAKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cT6gBYHC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m1-20020a170902db0100b001b88e609e56si9562782plx.488.2023.07.05.12.43.44; Wed, 05 Jul 2023 12:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cT6gBYHC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234112AbjGETKe (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233780AbjGETIm (ORCPT ); Wed, 5 Jul 2023 15:08:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AD9019BE; Wed, 5 Jul 2023 12:05:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E9F3061707; Wed, 5 Jul 2023 19:04:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93859C433C8; Wed, 5 Jul 2023 19:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583876; bh=VTN22iDlc64pJ0V7tpQfQ3Y7pWhLYJcjLyC9KHu7DZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cT6gBYHCRs/6tnJ8EKp/GPZRquTdOojJPymszidSu2ZcARD5LhhDsRCtQ6+No8KUO rWhc+OTLxB7j9N3UYTZJn0n6tMjSqrC4/u/HuImKHsYD0G1SJxZvMx5NI2xIzOOwic rErhRbOUiS0DqVGDECpI1QGtTByyDJE6Mwf/oKnBXAozpV1CEFcb5FMAKc11ogfUFx /b/Cc3Xz+DkxbPOaudF4TIdmqE/pndqJs6e6BnoK9UDx/gEO0k1ygvDuk5VBLAY68d Blo/yJZIJajDp0TtVHTaS1MCU5xXSTP+iO8MID38E8as5ZqTXr5/Jti4q6QUzNNl6E i4xIcbxGtrIVw== From: Jeff Layton To: Christian Brauner , Mike Kravetz , Muchun Song Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 52/92] hugetlbfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:17 -0400 Message-ID: <20230705190309.579783-50-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611005585126897?= X-GMAIL-MSGID: =?utf-8?q?1770611005585126897?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Acked-by: Mike Kravetz Reviewed-by: Jan Kara --- fs/hugetlbfs/inode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 7b17ccfa039d..93d3bcfd4fc8 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -887,7 +887,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) i_size_write(inode, offset + len); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); out: inode_unlock(inode); return error; @@ -935,7 +935,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, inode->i_mode = S_IFDIR | ctx->mode; inode->i_uid = ctx->uid; inode->i_gid = ctx->gid; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_op = &hugetlbfs_dir_inode_operations; inode->i_fop = &simple_dir_operations; /* directory inodes start off with i_nlink == 2 (for "." entry) */ @@ -979,7 +979,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, &hugetlbfs_i_mmap_rwsem_key); inode->i_mapping->a_ops = &hugetlbfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_mapping->private_data = resv_map; info->seals = F_SEAL_SEAL; switch (mode & S_IFMT) { @@ -1022,7 +1022,7 @@ static int hugetlbfs_mknod(struct mnt_idmap *idmap, struct inode *dir, inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); if (!inode) return -ENOSPC; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); d_instantiate(dentry, inode); dget(dentry);/* Extra count - pin the dentry in core */ return 0; @@ -1054,7 +1054,7 @@ static int hugetlbfs_tmpfile(struct mnt_idmap *idmap, inode = hugetlbfs_get_inode(dir->i_sb, dir, mode | S_IFREG, 0); if (!inode) return -ENOSPC; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); d_tmpfile(file, inode); return finish_open_simple(file, 0); } @@ -1076,7 +1076,7 @@ static int hugetlbfs_symlink(struct mnt_idmap *idmap, } else iput(inode); } - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); return error; } From patchwork Wed Jul 5 19:01:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097892vqx; Wed, 5 Jul 2023 12:45:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gypZ6aBTniM8iy9znDXh88mhY9p831jtA+CUEvf9vLGh1UUGHv8MpZ4vuFx/bN2/Tj4c1 X-Received: by 2002:a05:6a20:549f:b0:125:4d74:ac77 with SMTP id i31-20020a056a20549f00b001254d74ac77mr17004691pzk.42.1688586345808; Wed, 05 Jul 2023 12:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586345; cv=none; d=google.com; s=arc-20160816; b=aFTKm6GQVGEYW/eoETagWtIFWHZDQ2Vu8Nu241+cPjZGaXBC4seHN5q+zlZo3JlgOU LVGn10G1j9at4dkGBjsysGz8R/C/gMd70U7sNjcNqgOXbBKF9MLOm/pxpdOXQUXoaPJO u/NXdTgR/9voL8rwAI5I5QmnRrALTEcBP1mw4V83VvSulS7RuisZtpit1iUWOa3BvGlx 7FVbNoyfeEKVXUULOjWYrLfPnb3zFTaORv+26IBZji7fmBTnHgpBBvbaij7VIMG/LnnG sbNaV+WsSZxMXTFovkQ7bb0rpcDAY2owBSbzb+FHzdRu/UcRMGjfEw7qmyIhmrWOEZid L/sg== 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=D1vmwSXoGPLckOl0FdX8QnM8FypK7XDOtocmBj8CMcU=; fh=6NzbeM95gdUP/oYf3zuFWtCIK7mdUca4ONGzuYXrkwk=; b=vyQ8fNUxmOwlyRaRs/PQ+Jxl5Hj3t3fppD3L8/c0YgOMNpY7wIl2hPkUzSWwtkJl5K HNZYYpNiGw5lmAC2lj+ExppQpy0JHvgdN/b2zWjaAcyfR6q7wqrMn9dgG6/WADSpRcbN +e24Fqb6cL7YP7Bh9noojAsC8CBnZb22m8TxbgXMqnRiV01xkbxOkhsBz9WPRkU+TUn6 huPkprHFysQGLlZzrDhrQuTvEb07WzK+eiX5RVLxGqfiEIq/lJwyLDTPYZ5yv17d3wsp HoG0ChGZf6WVLmdH8TlFLZ0OroMz+IWsku/Z1WgKfsFcqguvGv9z87B3Rn57rnwttfdL U0Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p6GfcEdL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q23-20020a631f57000000b0055070c6da5bsi22444499pgm.670.2023.07.05.12.45.30; Wed, 05 Jul 2023 12:45:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p6GfcEdL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233854AbjGETIq (ORCPT + 99 others); Wed, 5 Jul 2023 15:08:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233406AbjGETHR (ORCPT ); Wed, 5 Jul 2023 15:07:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C729C2D68; Wed, 5 Jul 2023 12:04:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5F3FC61659; Wed, 5 Jul 2023 19:04:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4590DC433C9; Wed, 5 Jul 2023 19:04:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583877; bh=ofpnt9iWvlkIrsKtA3+qgnbIz58dJxWLWNpVQKqe8PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6GfcEdLHYJY5whbHXDiSGJqn+cA/VhCeZ6v4zmqCx+qe73OBtCW36mnIWI5ok6v/ B6YCts2KOeq1M3DTDLt5IF9yHYbo38caOQ97+DVNmDsB+NfqvzqW+K1sOJWHNuSzhm 50oJ+3ZTHt8+u6n6LxYf0XmIcn64NW1rTgBjLKNfOgEvrqwB8g5Stf6CwBXfvTF+jO hX5P4qRNSbzbvTbmj2lnP2wt4B+cM6n/DZDK8ab+C8SZi/H53X5iDB4em8/FHVi6EC 6Mejz+qv9jgI0neEr19yMJXzHnygMqbz+EoF++Bmb/Ijq+UGt13Ih72I9F0ppcizEf czEgy1uJwXkvA== From: Jeff Layton To: Christian Brauner , Jan Kara Cc: Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 53/92] isofs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:18 -0400 Message-ID: <20230705190309.579783-51-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611116070944091?= X-GMAIL-MSGID: =?utf-8?q?1770611116070944091?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton --- fs/isofs/inode.c | 8 ++++---- fs/isofs/rock.c | 16 +++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index df9d70588b60..98a78200cff1 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -1424,11 +1424,11 @@ static int isofs_read_inode(struct inode *inode, int relocated) #endif inode->i_mtime.tv_sec = - inode->i_atime.tv_sec = - inode->i_ctime.tv_sec = iso_date(de->date, high_sierra); + inode->i_atime.tv_sec = inode_set_ctime(inode, + iso_date(de->date, high_sierra), + 0).tv_sec; inode->i_mtime.tv_nsec = - inode->i_atime.tv_nsec = - inode->i_ctime.tv_nsec = 0; + inode->i_atime.tv_nsec = 0; ei->i_first_extent = (isonum_733(de->extent) + isonum_711(de->ext_attr_length)); diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c index 48f58c6c9e69..348783a70f57 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c @@ -421,10 +421,9 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, /* Rock ridge never appears on a High Sierra disk */ cnt = 0; if (rr->u.TF.flags & TF_CREATE) { - inode->i_ctime.tv_sec = - iso_date(rr->u.TF.times[cnt++].time, - 0); - inode->i_ctime.tv_nsec = 0; + inode_set_ctime(inode, + iso_date(rr->u.TF.times[cnt++].time, 0), + 0); } if (rr->u.TF.flags & TF_MODIFY) { inode->i_mtime.tv_sec = @@ -439,10 +438,9 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, inode->i_atime.tv_nsec = 0; } if (rr->u.TF.flags & TF_ATTRIBUTES) { - inode->i_ctime.tv_sec = - iso_date(rr->u.TF.times[cnt++].time, - 0); - inode->i_ctime.tv_nsec = 0; + inode_set_ctime(inode, + iso_date(rr->u.TF.times[cnt++].time, 0), + 0); } break; case SIG('S', 'L'): @@ -534,7 +532,7 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, inode->i_size = reloc->i_size; inode->i_blocks = reloc->i_blocks; inode->i_atime = reloc->i_atime; - inode->i_ctime = reloc->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(reloc)); inode->i_mtime = reloc->i_mtime; iput(reloc); break; From patchwork Wed Jul 5 19:01:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116332 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2092774vqx; Wed, 5 Jul 2023 12:34:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bJmFxABgrKO9NkndVHC6IJweCTrVMuuI/745EObL2atIfhbwNzOyQJmQDG6Ea6WjGEnmP X-Received: by 2002:a05:6870:fd99:b0:1ac:f3d5:13f9 with SMTP id ma25-20020a056870fd9900b001acf3d513f9mr20978066oab.19.1688585668956; Wed, 05 Jul 2023 12:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585668; cv=none; d=google.com; s=arc-20160816; b=ychTx5s7qW6e5aoy/KOWewNsONybvZMPhN0d5x8gbjMAnJEnwOUJS6R15/5x77UwEV yPG+hxn9yJTpZlmeelyMmqti0FaGI3HHdEPprZNH5POch8GeL0InXwWOaq3uhpBaqmQJ yE2fNCH9tHi/w8vNgVNOp0rzBAbwXfkUMbTDiijqwps6ugcZy6imgV2NX2lWEnmSqTr+ 7tWXn1ewKj1DkOcO5phITFWU2bHDvAs34YNdkGt7uXxuLamtNO00RtYXuvWJfgdl9T0+ dwBAkxodKOz1mXYHjcApDCBvJ2xep371u42hEV+lQ6fk/2QAv158+EEFPaullAJxpiZ3 HJjQ== 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=IUVHdRhFgG8vxSkIwnhqhT6PkPFT35AYqOK9VFw9EJc=; fh=PQP58oA/3s/NbiwzO7U842yjf8/tWYTUOsDcpGTtz2Y=; b=cg+SXxxnC3OC7viG/VNJR6d3SoyQhHr/tlB+7AOYAOxz51rTwxhzB8+d9rGHPerADf fIKqJU9+HOdVFvqdfxpEyYvjeRaLVInT7V7WuIBgDssX1JoQoqqI6cEtY/bYz2TYjx2A qGwRATk3F08XNHWKbtG9nCDffTd56IC4cluImvaMrwlhQd67DuZD8uziCgwQA1aaR7pF CuuJ38TKzGrzEYpt00Y9GD0ly1EDvOdgHsPasp+5VQmJbrqHJ4Osozxvn6Md3n9hHP55 QPP5Z3KPlwmazq0BbYsSdVvCtv1mR2tgdC1E2uLECvwnQcXN+fPglwejn2WgI8n0IXEz iKfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jxqj2wZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb7-20020a17090b4a4700b00263f6368c25si2113996pjb.146.2023.07.05.12.34.15; Wed, 05 Jul 2023 12:34:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jxqj2wZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233984AbjGETJS (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbjGETHY (ORCPT ); Wed, 5 Jul 2023 15:07:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B1D62D7D; Wed, 5 Jul 2023 12:04:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 66C45616F0; Wed, 5 Jul 2023 19:04:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 127C8C433C8; Wed, 5 Jul 2023 19:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583879; bh=HMc0jNblEpTL0q66n2SmSXQDQ5qyWhGAaTZI7OU1vek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jxqj2wZ4nW3tOavyswpioRQkyYxJkqDGHI21QHG1MKFfRiCciQJV30aV5X2QTuksP zzZzSxlGIA5/7O5BK64IiICsHPMBRILLMgZ+ysWEtJO2oxRNXKdJD6/QSuraCGIGUh cmh1OzuL0YNktry/dDym/eXSaQ84jc5TB2qXvWP4jz8NjUJaD4l5EkX8LsFWSVEpsg 6gZPIt8aAA34bPISMZ8fWG2Tq3bISVHXWrxHryhhHvOp8+VEtEAtPxDjogAWRWkCGn q03f2us3/1a561OAkL4cztGSD6w2/jwlTpj1NB//0DOjS9mkgaOl/oVW0WVcP1SEjK 8VArq6CiR4buw== From: Jeff Layton To: Christian Brauner , David Woodhouse , Richard Weinberger Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH v2 54/92] jffs2: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:19 -0400 Message-ID: <20230705190309.579783-52-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610406414650252?= X-GMAIL-MSGID: =?utf-8?q?1770610406414650252?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/jffs2/dir.c | 24 +++++++++++++++--------- fs/jffs2/file.c | 3 ++- fs/jffs2/fs.c | 10 +++++----- fs/jffs2/os-linux.h | 2 +- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 5075a0a6d594..091ab0eaabbe 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c @@ -204,7 +204,8 @@ static int jffs2_create(struct mnt_idmap *idmap, struct inode *dir_i, if (ret) goto fail; - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(ri->ctime)); + dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, + ITIME(je32_to_cpu(ri->ctime))); jffs2_free_raw_inode(ri); @@ -237,7 +238,7 @@ static int jffs2_unlink(struct inode *dir_i, struct dentry *dentry) if (dead_f->inocache) set_nlink(d_inode(dentry), dead_f->inocache->pino_nlink); if (!ret) - dir_i->i_mtime = dir_i->i_ctime = ITIME(now); + dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, ITIME(now)); return ret; } /***********************************************************************/ @@ -271,7 +272,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink); mutex_unlock(&f->sem); d_instantiate(dentry, d_inode(old_dentry)); - dir_i->i_mtime = dir_i->i_ctime = ITIME(now); + dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, ITIME(now)); ihold(d_inode(old_dentry)); } return ret; @@ -422,7 +423,8 @@ static int jffs2_symlink (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); + dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, + ITIME(je32_to_cpu(rd->mctime))); jffs2_free_raw_dirent(rd); @@ -566,7 +568,8 @@ static int jffs2_mkdir (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); + dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, + ITIME(je32_to_cpu(rd->mctime))); inc_nlink(dir_i); jffs2_free_raw_dirent(rd); @@ -607,7 +610,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry) ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, dentry->d_name.len, f, now); if (!ret) { - dir_i->i_mtime = dir_i->i_ctime = ITIME(now); + dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, ITIME(now)); clear_nlink(d_inode(dentry)); drop_nlink(dir_i); } @@ -743,7 +746,8 @@ static int jffs2_mknod (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); + dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, + ITIME(je32_to_cpu(rd->mctime))); jffs2_free_raw_dirent(rd); @@ -864,14 +868,16 @@ static int jffs2_rename (struct mnt_idmap *idmap, * caller won't do it on its own since we are returning an error. */ d_invalidate(new_dentry); - new_dir_i->i_mtime = new_dir_i->i_ctime = ITIME(now); + new_dir_i->i_mtime = inode_set_ctime_to_ts(new_dir_i, + ITIME(now)); return ret; } if (d_is_dir(old_dentry)) drop_nlink(old_dir_i); - new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); + old_dir_i->i_mtime = inode_set_ctime_to_ts(old_dir_i, ITIME(now)); + new_dir_i->i_mtime = inode_set_ctime_to_ts(new_dir_i, ITIME(now)); return 0; } diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 2345ca3f09ee..11c66793960e 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -317,7 +317,8 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, inode->i_size = pos + writtenlen; inode->i_blocks = (inode->i_size + 511) >> 9; - inode->i_ctime = inode->i_mtime = ITIME(je32_to_cpu(ri->ctime)); + inode->i_mtime = inode_set_ctime_to_ts(inode, + ITIME(je32_to_cpu(ri->ctime))); } } diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 038516bee1ab..0403efab4089 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -115,7 +115,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) ri->isize = cpu_to_je32((ivalid & ATTR_SIZE)?iattr->ia_size:inode->i_size); ri->atime = cpu_to_je32(I_SEC((ivalid & ATTR_ATIME)?iattr->ia_atime:inode->i_atime)); ri->mtime = cpu_to_je32(I_SEC((ivalid & ATTR_MTIME)?iattr->ia_mtime:inode->i_mtime)); - ri->ctime = cpu_to_je32(I_SEC((ivalid & ATTR_CTIME)?iattr->ia_ctime:inode->i_ctime)); + ri->ctime = cpu_to_je32(I_SEC((ivalid & ATTR_CTIME)?iattr->ia_ctime:inode_get_ctime(inode))); ri->offset = cpu_to_je32(0); ri->csize = ri->dsize = cpu_to_je32(mdatalen); @@ -148,7 +148,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) } /* It worked. Update the inode */ inode->i_atime = ITIME(je32_to_cpu(ri->atime)); - inode->i_ctime = ITIME(je32_to_cpu(ri->ctime)); + inode_set_ctime_to_ts(inode, ITIME(je32_to_cpu(ri->ctime))); inode->i_mtime = ITIME(je32_to_cpu(ri->mtime)); inode->i_mode = jemode_to_cpu(ri->mode); i_uid_write(inode, je16_to_cpu(ri->uid)); @@ -284,7 +284,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) inode->i_size = je32_to_cpu(latest_node.isize); inode->i_atime = ITIME(je32_to_cpu(latest_node.atime)); inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime)); - inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime)); + inode_set_ctime_to_ts(inode, ITIME(je32_to_cpu(latest_node.ctime))); set_nlink(inode, f->inocache->pino_nlink); @@ -388,7 +388,7 @@ void jffs2_dirty_inode(struct inode *inode, int flags) iattr.ia_gid = inode->i_gid; iattr.ia_atime = inode->i_atime; iattr.ia_mtime = inode->i_mtime; - iattr.ia_ctime = inode->i_ctime; + iattr.ia_ctime = inode_get_ctime(inode); jffs2_do_setattr(inode, &iattr); } @@ -475,7 +475,7 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r inode->i_mode = jemode_to_cpu(ri->mode); i_gid_write(inode, je16_to_cpu(ri->gid)); i_uid_write(inode, je16_to_cpu(ri->uid)); - inode->i_atime = inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); ri->atime = ri->mtime = ri->ctime = cpu_to_je32(I_SEC(inode->i_mtime)); inode->i_blocks = 0; diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 8da19766c101..50727a1ff931 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -35,7 +35,7 @@ struct kvec; #define ITIME(sec) ((struct timespec64){sec, 0}) #define JFFS2_NOW() JFFS2_CLAMP_TIME(ktime_get_real_seconds()) #define I_SEC(tv) JFFS2_CLAMP_TIME((tv).tv_sec) -#define JFFS2_F_I_CTIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_ctime) +#define JFFS2_F_I_CTIME(f) I_SEC(inode_get_ctime(OFNI_EDONI_2SFFJ(f))) #define JFFS2_F_I_MTIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_mtime) #define JFFS2_F_I_ATIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_atime) #define sleep_on_spinunlock(wq, s) \ From patchwork Wed Jul 5 19:01:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116368 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096884vqx; Wed, 5 Jul 2023 12:43:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGRsUkDxc+CSdjMctJVJacLAg1S9wd/Uvm4zHVGbT4PSQsi2OCUzvWely0SU29lm02DWYS4 X-Received: by 2002:a05:6a00:1250:b0:668:74e9:8efb with SMTP id u16-20020a056a00125000b0066874e98efbmr16733271pfi.8.1688586217227; Wed, 05 Jul 2023 12:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586217; cv=none; d=google.com; s=arc-20160816; b=GdEjSmZ7fQR32vqmNxG/I4B2eDz42eiI9TUu+9Xk971nUIJ5QvYIWaI+lezoqXMlun 6dUrtvMstqx0CdJHLpxterz9xzE6anr+m+TaxHtAViXBI6B9HkVGI2uBC+wr5wPzPBz6 hFQoyjLdKkNFROXQTH8mzg9s1ga3Zk7+dpX0Z/W4AMgofx+Pggst/MiY461Qpb4Oo+64 NH+TrCorDG6IL2aNJPYkP+hlq1TSFLzxh2T661CY6v+9XwjP8mmqKQjHmYOceLQgvV0h qSMeYRjy62a7Ndz44cA7z1ryqZYwAlMIifDmTNsi/HIoMw6fz0toIvOv2QhYJXzkAsId wbBg== 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=n1ZSNKxMV+Fb/Zmy+towVQP2dhtBCK09XwZklmVgrLc=; fh=AKLCOasY3plR8waSWN8nqvgiB8EatP/ll1kNN3UfTmM=; b=XSTI2IEIP+B5Daqjiqpea6BESsrlVHk1UmgPEIXYLGHJE2cEVchnDPFVbIB49DFdz6 oHikqEYS2FweKHL6w3LbAHOygMQhno08Mhds2oHfezwLG9GlUwUSxfN4HfxkFcW+QB4/ rxX3BAbcuP+EBDBm+oqhK6rUE/1FYbYrmnASDQnxp7swrcEls6tMdUOjMvwx09hwSDK5 N9giRem4hjV3tmIhHLc/PFGEfXeEw1t0GB3IxL9MUe6QYfO5a1ogpUmw8h22S2Wudk8b T9jUaKaxsG1sqJyqVCYUpr0zUd2EbxdIJD3CvMFXpNNcoCwpB+nz8UI90a+Ffq+ughVA jbHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NXY9G9vy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t28-20020a056a00139c00b0068211339158si16006838pfg.129.2023.07.05.12.43.23; Wed, 05 Jul 2023 12:43:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NXY9G9vy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234018AbjGETJc (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233862AbjGETHa (ORCPT ); Wed, 5 Jul 2023 15:07:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 322A430C8; Wed, 5 Jul 2023 12:04:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 11D2A616E4; Wed, 5 Jul 2023 19:04:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B07DBC433C8; Wed, 5 Jul 2023 19:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583882; bh=TD9GkLzDkOcDiFx1eJWC4LXqiy+RzWR/SaTh92hyksw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NXY9G9vygbRkYbdWqM3+0nBYtzWPxm2QtDhw6ZpxZz+VaSI/TKA71Wwz0SwGCNSXF 4Vu6GAe1SfSYm/fBbfDQbeR/QS2cyZoiPr5QZIobGG5n8m6ipSEmOCNJCZZE1Y/49e jC4D08Ee5TyAtbsSXu1plD5Qtcxp+J8GBCWJtDEP8uZ63zpOrK91XLaXYKA5umWnIZ n7ayKVk3tVgj14DWwCJ556ficgAKzUN4rd84iNvu80A+2JZm7NkVMpHK9PS0v2dyzj tb6HVAXhJBUIVSOXnKxDpKntm5TV7PpjtbaLP7c/gpihQfU+Wqcez/pEufYKl4mKNs Ay4t0frzUXPfw== From: Jeff Layton To: Christian Brauner , Dave Kleikamp Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Kleikamp , jfs-discussion@lists.sourceforge.net Subject: [PATCH v2 55/92] jfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:20 -0400 Message-ID: <20230705190309.579783-53-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610981434270119?= X-GMAIL-MSGID: =?utf-8?q?1770610981434270119?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Dave Kleikamp Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/jfs/acl.c | 2 +- fs/jfs/inode.c | 2 +- fs/jfs/ioctl.c | 2 +- fs/jfs/jfs_imap.c | 8 ++++---- fs/jfs/jfs_inode.c | 4 ++-- fs/jfs/namei.c | 24 ++++++++++++------------ fs/jfs/super.c | 2 +- fs/jfs/xattr.c | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index fb96f872d207..1de3602c98de 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c @@ -116,7 +116,7 @@ int jfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, if (!rc) { if (update_mode) { inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); } rc = txCommit(tid, 1, &inode, 0); diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 8ac10e396050..920d58a1566b 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c @@ -393,7 +393,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length) break; } - ip->i_mtime = ip->i_ctime = current_time(ip); + ip->i_mtime = inode_set_ctime_current(ip); mark_inode_dirty(ip); txCommit(tid, 1, &ip, 0); diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index ed7989bc2db1..f7bd7e8f5be4 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c @@ -96,7 +96,7 @@ int jfs_fileattr_set(struct mnt_idmap *idmap, jfs_inode->mode2 = flags; jfs_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); return 0; diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 390cbfce391f..a40383aa6c84 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -3064,8 +3064,8 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip) ip->i_atime.tv_nsec = le32_to_cpu(dip->di_atime.tv_nsec); ip->i_mtime.tv_sec = le32_to_cpu(dip->di_mtime.tv_sec); ip->i_mtime.tv_nsec = le32_to_cpu(dip->di_mtime.tv_nsec); - ip->i_ctime.tv_sec = le32_to_cpu(dip->di_ctime.tv_sec); - ip->i_ctime.tv_nsec = le32_to_cpu(dip->di_ctime.tv_nsec); + inode_set_ctime(ip, le32_to_cpu(dip->di_ctime.tv_sec), + le32_to_cpu(dip->di_ctime.tv_nsec)); ip->i_blocks = LBLK2PBLK(ip->i_sb, le64_to_cpu(dip->di_nblocks)); ip->i_generation = le32_to_cpu(dip->di_gen); @@ -3139,8 +3139,8 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip) dip->di_atime.tv_sec = cpu_to_le32(ip->i_atime.tv_sec); dip->di_atime.tv_nsec = cpu_to_le32(ip->i_atime.tv_nsec); - dip->di_ctime.tv_sec = cpu_to_le32(ip->i_ctime.tv_sec); - dip->di_ctime.tv_nsec = cpu_to_le32(ip->i_ctime.tv_nsec); + dip->di_ctime.tv_sec = cpu_to_le32(inode_get_ctime(ip).tv_sec); + dip->di_ctime.tv_nsec = cpu_to_le32(inode_get_ctime(ip).tv_nsec); dip->di_mtime.tv_sec = cpu_to_le32(ip->i_mtime.tv_sec); dip->di_mtime.tv_nsec = cpu_to_le32(ip->i_mtime.tv_nsec); dip->di_ixpxd = jfs_ip->ixpxd; /* in-memory pxd's are little-endian */ diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c index 9e1f02767201..87594efa7f7c 100644 --- a/fs/jfs/jfs_inode.c +++ b/fs/jfs/jfs_inode.c @@ -97,8 +97,8 @@ struct inode *ialloc(struct inode *parent, umode_t mode) jfs_inode->mode2 |= inode->i_mode; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); - jfs_inode->otime = inode->i_ctime.tv_sec; + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); + jfs_inode->otime = inode_get_ctime(inode).tv_sec; inode->i_generation = JFS_SBI(sb)->gengen++; jfs_inode->cflag = 0; diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 9b030297aa64..541578126b1a 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c @@ -149,7 +149,7 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip, mark_inode_dirty(ip); - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_set_ctime_current(dip); mark_inode_dirty(dip); @@ -284,7 +284,7 @@ static int jfs_mkdir(struct mnt_idmap *idmap, struct inode *dip, /* update parent directory inode */ inc_nlink(dip); /* for '..' from child directory */ - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_set_ctime_current(dip); mark_inode_dirty(dip); rc = txCommit(tid, 2, &iplist[0], 0); @@ -390,7 +390,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) /* update parent directory's link count corresponding * to ".." entry of the target directory deleted */ - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_set_ctime_current(dip); inode_dec_link_count(dip); /* @@ -512,7 +512,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) ASSERT(ip->i_nlink); - ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip); + dip->i_mtime = inode_set_ctime_to_ts(dip, inode_set_ctime_current(ip)); mark_inode_dirty(dip); /* update target's inode */ @@ -827,8 +827,8 @@ static int jfs_link(struct dentry *old_dentry, /* update object inode */ inc_nlink(ip); /* for new link */ - ip->i_ctime = current_time(ip); - dir->i_ctime = dir->i_mtime = current_time(dir); + inode_set_ctime_current(ip); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); ihold(ip); @@ -1028,7 +1028,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip, mark_inode_dirty(ip); - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_set_ctime_current(dip); mark_inode_dirty(dip); /* * commit update of parent directory and link object @@ -1205,7 +1205,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, tblk->xflag |= COMMIT_DELETE; tblk->u.ip = new_ip; } else { - new_ip->i_ctime = current_time(new_ip); + inode_set_ctime_current(new_ip); mark_inode_dirty(new_ip); } } else { @@ -1268,10 +1268,10 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, /* * Update ctime on changed/moved inodes & mark dirty */ - old_ip->i_ctime = current_time(old_ip); + inode_set_ctime_current(old_ip); mark_inode_dirty(old_ip); - new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); + new_dir->i_mtime = inode_set_ctime_current(new_dir); mark_inode_dirty(new_dir); /* Build list of inodes modified by this transaction */ @@ -1283,7 +1283,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (old_dir != new_dir) { iplist[ipcount++] = new_dir; - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + old_dir->i_mtime = inode_set_ctime_current(old_dir); mark_inode_dirty(old_dir); } @@ -1416,7 +1416,7 @@ static int jfs_mknod(struct mnt_idmap *idmap, struct inode *dir, mark_inode_dirty(ip); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); diff --git a/fs/jfs/super.c b/fs/jfs/super.c index d2f82cb7db1b..2e2f7f6d36a0 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -818,7 +818,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type, } if (inode->i_size < off+len-towrite) i_size_write(inode, off+len-towrite); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); inode_unlock(inode); return len - towrite; diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 931e50018f88..8577ad494e05 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -647,7 +647,7 @@ static int ea_put(tid_t tid, struct inode *inode, struct ea_buffer *ea_buf, if (old_blocks) dquot_free_block(inode, old_blocks); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); return 0; } From patchwork Wed Jul 5 19:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116314 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2088341vqx; Wed, 5 Jul 2023 12:25:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlHercHMcLLf90fNygHsTmfnj9D5xisGS0ZdbqEYFia4AQE2jxYedHDSjJZ+rfMxr/Aydjfy X-Received: by 2002:a05:6a20:938e:b0:12f:1f1f:db22 with SMTP id x14-20020a056a20938e00b0012f1f1fdb22mr5460477pzh.52.1688585142921; Wed, 05 Jul 2023 12:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585142; cv=none; d=google.com; s=arc-20160816; b=SZswAFeBdQzny3bWr9jmQBV6RXUlot+XspcrIuCT3TBMkSCmknDWYQ9vxqgiPy6/Ev fbFJ9QNBswofKAV7v7kvu/YRRsDss37Bksd0muLqq6kf1CBU76B6yuiFxcK+SY2jZiti rz7AaRg9DDalNh4VVrIpkPUxESprQeQBqD2Uaos4Qn2bCKUnxFCbIhRsT/S/kXSVgs5g UY9++E2sg8LfnwHqNLsOI9HHrLUKeymOzepeJxJzjwLnkfRnOesGohOcyXQv2q6bayBl BogbZgJfe/AnSmtXHblCSSKoZ9dskZRVJ9w2sTwXKTo8HeND9d163vBPZriThjiL9+su q5og== 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=VISUPDLb+SkBotXlzlKjfopD3t3EFMIFgSdxyJZf8ZM=; fh=VGb5EDjlTgw3aaxNy/QgG9y10OJDdMUkweoPL84i+ec=; b=xeMKiR71fFHg1c7KNXFWb+oLDxxX91fYzbVzg2iVw6f1ABHlMidUV9u2TZLnZjX6s9 pmH1f39Iagx9ccZqEtjtT/iHa3WMSR+ZuE/CDZm9HqvODfxrOnxZ7jGuRHYQwBiVpo9x jc4IRxHYK72lr6GRhwopdJ60L2CWSVFfV36bz0TSi8zyMme7rKk+TkJIFgljtoU90b4i ZXGV4dm1LgYiVs4DxseJjwBLNM8DP7voHeN7mfvePaXp3akQKj99TmVVr4bwC3acgxTj G2zav+aR2zOm9gSHpnwwpF5qWPymb1MEVF7xs/VcPtXzpudIInt1O1LzOP/iVCkW2Ywm HTnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FvsH4gOW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r5-20020a632b05000000b0055ba896ec95si7160700pgr.779.2023.07.05.12.25.27; Wed, 05 Jul 2023 12:25:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FvsH4gOW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233963AbjGETJI (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234119AbjGETIZ (ORCPT ); Wed, 5 Jul 2023 15:08:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DA3135A9; Wed, 5 Jul 2023 12:05:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89013616FC; Wed, 5 Jul 2023 19:04:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42780C433C7; Wed, 5 Jul 2023 19:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583885; bh=S76cug60RSzGP9ZVr2iEwZrNFye2aOZN8lxss1+Dkoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FvsH4gOWdStSRHxVaSQJqprl+vsEsLzdC13oQAQVuksSmu/v961cl9Dd70sDLKMMd 8fVcZp1Lykja6g8L1JqaqVeAb+HhsyPoTBxB2gg19QcXCj5KwEii0ySQ5LcpOw7RX4 +vGjEv4aM6CNLGCm1Z9H+7POs//4ULLtTnWpWfxc1iD7nlbAWoY/v+oAVBdCRsULug MspXmT+X3PpAPpwFeymV2pU3FF1pYAdWviW5ZUPyu1T2/RJGa/gg7Vg7CCGg4kamLG GNnAVnPqk9CsXHIk7GxJbCFvKGraTvvW5ChMdfbNl89u0xLKC2NyvFeEbUAntEuiMd xlzPCSHztkfHg== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman , Tejun Heo , Alexander Viro Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 56/92] kernfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:21 -0400 Message-ID: <20230705190309.579783-54-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609854809636990?= X-GMAIL-MSGID: =?utf-8?q?1770609854809636990?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Greg Kroah-Hartman Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/kernfs/inode.c | 5 ++--- fs/libfs.c | 19 ++++++++++--------- fs/minix/bitmap.c | 2 +- fs/minix/dir.c | 6 +++--- fs/minix/inode.c | 10 +++++----- fs/minix/itree_common.c | 4 ++-- fs/minix/namei.c | 6 +++--- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index b22b74d1a115..89a9b4dcf109 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c @@ -151,8 +151,7 @@ ssize_t kernfs_iop_listxattr(struct dentry *dentry, char *buf, size_t size) static inline void set_default_inode_attr(struct inode *inode, umode_t mode) { inode->i_mode = mode; - inode->i_atime = inode->i_mtime = - inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } static inline void set_inode_attr(struct inode *inode, @@ -162,7 +161,7 @@ static inline void set_inode_attr(struct inode *inode, inode->i_gid = attrs->ia_gid; inode->i_atime = attrs->ia_atime; inode->i_mtime = attrs->ia_mtime; - inode->i_ctime = attrs->ia_ctime; + inode_set_ctime_to_ts(inode, attrs->ia_ctime); } static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode) diff --git a/fs/libfs.c b/fs/libfs.c index 9ee79668c909..befbef1b4b46 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -523,7 +523,7 @@ void simple_recursive_removal(struct dentry *dentry, while ((child = find_next_child(this, victim)) == NULL) { // kill and ascend // update metadata while it's still locked - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); clear_nlink(inode); inode_unlock(inode); victim = this; @@ -541,8 +541,7 @@ void simple_recursive_removal(struct dentry *dentry, dput(victim); // unpin it } if (victim == dentry) { - inode->i_ctime = inode->i_mtime = - current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); if (d_is_dir(dentry)) drop_nlink(inode); inode_unlock(inode); @@ -583,7 +582,7 @@ static int pseudo_fs_fill_super(struct super_block *s, struct fs_context *fc) */ root->i_ino = 1; root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; - root->i_atime = root->i_mtime = root->i_ctime = current_time(root); + root->i_atime = root->i_mtime = inode_set_ctime_current(root); s->s_root = d_make_root(root); if (!s->s_root) return -ENOMEM; @@ -639,7 +638,8 @@ int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *den { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + dir->i_mtime = inode_set_ctime_to_ts(dir, + inode_set_ctime_current(inode)); inc_nlink(inode); ihold(inode); dget(dentry); @@ -673,7 +673,8 @@ int simple_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + dir->i_mtime = inode_set_ctime_to_ts(dir, + inode_set_ctime_current(inode)); drop_nlink(inode); dput(dentry); return 0; @@ -925,7 +926,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic, */ inode->i_ino = 1; inode->i_mode = S_IFDIR | 0755; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; set_nlink(inode, 2); @@ -951,7 +952,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic, goto out; } inode->i_mode = S_IFREG | files->mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_fop = files->ops; inode->i_ino = i; d_add(dentry, inode); @@ -1519,7 +1520,7 @@ struct inode *alloc_anon_inode(struct super_block *s) inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); inode->i_flags |= S_PRIVATE; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); return inode; } EXPORT_SYMBOL(alloc_anon_inode); diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c index 870207ba23f1..25c08fbfcb9d 100644 --- a/fs/minix/bitmap.c +++ b/fs/minix/bitmap.c @@ -251,7 +251,7 @@ struct inode *minix_new_inode(const struct inode *dir, umode_t mode) } inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_ino = j; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_blocks = 0; memset(&minix_i(inode)->u, 0, sizeof(minix_i(inode)->u)); insert_inode_hash(inode); diff --git a/fs/minix/dir.c b/fs/minix/dir.c index bf9858f76b6a..20f23e6e58ad 100644 --- a/fs/minix/dir.c +++ b/fs/minix/dir.c @@ -281,7 +281,7 @@ int minix_add_link(struct dentry *dentry, struct inode *inode) de->inode = inode->i_ino; } dir_commit_chunk(page, pos, sbi->s_dirsize); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); err = minix_handle_dirsync(dir); out_put: @@ -313,7 +313,7 @@ int minix_delete_entry(struct minix_dir_entry *de, struct page *page) else de->inode = 0; dir_commit_chunk(page, pos, len); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); return minix_handle_dirsync(inode); } @@ -436,7 +436,7 @@ int minix_set_link(struct minix_dir_entry *de, struct page *page, else de->inode = inode->i_ino; dir_commit_chunk(page, pos, sbi->s_dirsize); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); return minix_handle_dirsync(dir); } diff --git a/fs/minix/inode.c b/fs/minix/inode.c index e9fbb5303a22..3715a3940bd4 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -501,10 +501,11 @@ static struct inode *V1_minix_iget(struct inode *inode) i_gid_write(inode, raw_inode->i_gid); set_nlink(inode, raw_inode->i_nlinks); inode->i_size = raw_inode->i_size; - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = raw_inode->i_time; + inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode_set_ctime(inode, + raw_inode->i_time, + 0).tv_sec; inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; inode->i_blocks = 0; for (i = 0; i < 9; i++) minix_inode->u.i1_data[i] = raw_inode->i_zone[i]; @@ -543,10 +544,9 @@ static struct inode *V2_minix_iget(struct inode *inode) inode->i_size = raw_inode->i_size; inode->i_mtime.tv_sec = raw_inode->i_mtime; inode->i_atime.tv_sec = raw_inode->i_atime; - inode->i_ctime.tv_sec = raw_inode->i_ctime; + inode_set_ctime(inode, raw_inode->i_ctime, 0); inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; inode->i_blocks = 0; for (i = 0; i < 10; i++) minix_inode->u.i2_data[i] = raw_inode->i_zone[i]; @@ -622,7 +622,7 @@ static struct buffer_head * V2_minix_update_inode(struct inode * inode) raw_inode->i_size = inode->i_size; raw_inode->i_mtime = inode->i_mtime.tv_sec; raw_inode->i_atime = inode->i_atime.tv_sec; - raw_inode->i_ctime = inode->i_ctime.tv_sec; + raw_inode->i_ctime = inode_get_ctime(inode).tv_sec; if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) raw_inode->i_zone[0] = old_encode_dev(inode->i_rdev); else for (i = 0; i < 10; i++) diff --git a/fs/minix/itree_common.c b/fs/minix/itree_common.c index 446148792f41..ce18ae37c29d 100644 --- a/fs/minix/itree_common.c +++ b/fs/minix/itree_common.c @@ -131,7 +131,7 @@ static inline int splice_branch(struct inode *inode, /* We are done with atomic stuff, now do the rest of housekeeping */ - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); /* had we spliced it onto indirect block? */ if (where->bh) @@ -350,7 +350,7 @@ static inline void truncate (struct inode * inode) } first_whole++; } - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); } diff --git a/fs/minix/namei.c b/fs/minix/namei.c index 956d5183828d..114084d5636a 100644 --- a/fs/minix/namei.c +++ b/fs/minix/namei.c @@ -98,7 +98,7 @@ static int minix_link(struct dentry * old_dentry, struct inode * dir, { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_link_count(inode); ihold(inode); return add_nondir(dentry, inode); @@ -154,7 +154,7 @@ static int minix_unlink(struct inode * dir, struct dentry *dentry) if (err) return err; - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); inode_dec_link_count(inode); return 0; } @@ -218,7 +218,7 @@ static int minix_rename(struct mnt_idmap *idmap, put_page(new_page); if (err) goto out_dir; - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); From patchwork Wed Jul 5 19:01:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116310 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2086113vqx; Wed, 5 Jul 2023 12:21:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlEKQHh4Ar3lcBvpv+hjnp+yeWZQ0Vy71byAUk9kkNlzqTZcLSe7sQTSXNqVbh53msa83Mpv X-Received: by 2002:a05:6a00:1355:b0:644:d775:60bb with SMTP id k21-20020a056a00135500b00644d77560bbmr17196810pfu.20.1688584868594; Wed, 05 Jul 2023 12:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688584868; cv=none; d=google.com; s=arc-20160816; b=BneMcSmU4PvwtorQaeEBo/zEGm+ObjcFtSJfD+QGA4oX4i5N48tCp56Pt65A42MkoI ypZn5TDrm9NazG3icF+wmsILglIMe0MVLYPugNiNnQ5Lhd6CQqvqH72uU8rt8NFkrd54 po+XR3/GFggUF/FDOI7jJJZiwpUyij8FJuF5J6es8hcdFvDhzRZBFDwrsM5DKkhHpaLV AnIcK51j4XO1hmCkrv34Merz/xKlhRfKAkM3ERIlfkTv6udN8t6ZmRTriPJT/Uefyb/9 RZRTWSIvGurGhVotK8QFRSh/LaapjRmT52PjdcOA17yX2qjrclzC1oLwpDbS/WqWZRFk RhAQ== 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=FwIvcWBy05rNBDRDTACEKYHTyZ317o/88x6rG6KwnKM=; fh=Rhp23PdKvMHQh/K8gKrxxDMNfswWG9gYPyOylTQdmZQ=; b=ul8P1Xe9/QduawqlB/0mIeSbhyXypUgrX+9YmhXkmtJvS63P7vaHrauN0oJlRjoHZ8 KLdG8Em/ECO479emcKXk0SUddIcV3kPcaHRzN5/w/z6Vyv0EJIrsiTpdR6lz6JANFEEO a90PaUhd0LqNRhSPiPXEZPjfUywRTNpRGwrNp4llU5b9NwXqHNHe5mf814WKgYhFOOk+ XKbp6c3Uhny6gvPTjvIwyESnfA8xcCXDRHycCpNBZnX1tYVuspbgZY46It6354C/I55o B1dpXUtsgrP8ARr5nn/SKYEuQJO1ZY/8y4JcUk4V7cUpU1LRVIjR9TG2iIdmkKSGReMz RFgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ti5fV8z4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh13-20020a056a00808d00b0067a4d4dfde4si19140082pfb.104.2023.07.05.12.20.55; Wed, 05 Jul 2023 12:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ti5fV8z4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233925AbjGETJN (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233945AbjGETII (ORCPT ); Wed, 5 Jul 2023 15:08:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4C8B1FE0; Wed, 5 Jul 2023 12:04:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 658AD616FB; Wed, 5 Jul 2023 19:04:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F714C433C7; Wed, 5 Jul 2023 19:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583886; bh=Jw3LMAKGkOFsBOZVpJySAYN8+fhYTz3ENhYo/GQ/OLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ti5fV8z4pDl8/2IziWx/TrQmtZnwPXVBjS0Nqs2h1e5ESQhKVX5J34spB7hE8+4Ju DPEYYAkhkfvsMX3OCi+LK5WC1fCA75kaHHNC/Xd11yEOCPOTaJKWJKsc6gF2qtyqBJ 2cNYS+YBiaIqzYUZztNFNLesPP0aji0L8Cr8RvHuR22r9LCshRNEZIipbr89dx+Nyk +GIzLLb4lFBY2ukzmGRfzrguAxD0RkZxUK+dNenFnx6FQBtVza2ikKY9tjIbem/Kn8 fTMsjPbO+XrUFKnV9kefmeSFJFysW+0UyWeJcjIHnqh8tQbLjX8Nm8xUp6cMi6znD7 JSOM6b0XqIS+g== From: Jeff Layton To: Christian Brauner , Trond Myklebust , Anna Schumaker Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH v2 57/92] nfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:22 -0400 Message-ID: <20230705190309.579783-55-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609567388855660?= X-GMAIL-MSGID: =?utf-8?q?1770609567388855660?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/nfs/callback_proc.c | 2 +- fs/nfs/fscache.h | 4 ++-- fs/nfs/inode.c | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index c1eda73254e1..6bed1394d748 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -59,7 +59,7 @@ __be32 nfs4_callback_getattr(void *argp, void *resp, res->change_attr = delegation->change_attr; if (nfs_have_writebacks(inode)) res->change_attr++; - res->ctime = inode->i_ctime; + res->ctime = inode_get_ctime(inode); res->mtime = inode->i_mtime; res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & args->bitmap[0]; diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h index e1706e736c64..2dc64454492b 100644 --- a/fs/nfs/fscache.h +++ b/fs/nfs/fscache.h @@ -116,8 +116,8 @@ static inline void nfs_fscache_update_auxdata(struct nfs_fscache_inode_auxdata * memset(auxdata, 0, sizeof(*auxdata)); auxdata->mtime_sec = inode->i_mtime.tv_sec; auxdata->mtime_nsec = inode->i_mtime.tv_nsec; - auxdata->ctime_sec = inode->i_ctime.tv_sec; - auxdata->ctime_nsec = inode->i_ctime.tv_nsec; + auxdata->ctime_sec = inode_get_ctime(inode).tv_sec; + auxdata->ctime_nsec = inode_get_ctime(inode).tv_nsec; if (NFS_SERVER(inode)->nfs_client->rpc_ops->version == 4) auxdata->change_attr = inode_peek_iversion_raw(inode); diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 8172dd4135a1..1283fdfa4b0a 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -514,7 +514,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) memset(&inode->i_atime, 0, sizeof(inode->i_atime)); memset(&inode->i_mtime, 0, sizeof(inode->i_mtime)); - memset(&inode->i_ctime, 0, sizeof(inode->i_ctime)); + inode_set_ctime(inode, 0, 0); inode_set_iversion_raw(inode, 0); inode->i_size = 0; clear_nlink(inode); @@ -535,7 +535,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) else if (fattr_supported & NFS_ATTR_FATTR_MTIME) nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_set_ctime_to_ts(inode, fattr->ctime); else if (fattr_supported & NFS_ATTR_FATTR_CTIME) nfs_set_cache_invalid(inode, NFS_INO_INVALID_CTIME); if (fattr->valid & NFS_ATTR_FATTR_CHANGE) @@ -731,7 +731,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, if ((attr->ia_valid & ATTR_GID) != 0) inode->i_gid = attr->ia_gid; if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_set_ctime_to_ts(inode, fattr->ctime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME); @@ -749,7 +749,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_set_ctime_to_ts(inode, fattr->ctime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME); @@ -765,7 +765,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_set_ctime_to_ts(inode, fattr->ctime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME); @@ -1444,11 +1444,11 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) nfs_set_cache_invalid(inode, NFS_INO_INVALID_XATTR); } /* If we have atomic WCC data, we may update some attributes */ - ts = inode->i_ctime; + ts = inode_get_ctime(inode); if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME) && (fattr->valid & NFS_ATTR_FATTR_CTIME) && timespec64_equal(&ts, &fattr->pre_ctime)) { - inode->i_ctime = fattr->ctime; + inode_set_ctime_to_ts(inode, fattr->ctime); } ts = inode->i_mtime; @@ -1510,7 +1510,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec64_equal(&ts, &fattr->mtime)) invalid |= NFS_INO_INVALID_MTIME; - ts = inode->i_ctime; + ts = inode_get_ctime(inode); if ((fattr->valid & NFS_ATTR_FATTR_CTIME) && !timespec64_equal(&ts, &fattr->ctime)) invalid |= NFS_INO_INVALID_CTIME; @@ -1997,7 +1997,7 @@ int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fa } if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 && (fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) { - fattr->pre_ctime = inode->i_ctime; + fattr->pre_ctime = inode_get_ctime(inode); fattr->valid |= NFS_ATTR_FATTR_PRECTIME; } if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && @@ -2190,7 +2190,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) save_cache_validity & NFS_INO_INVALID_MTIME; if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_set_ctime_to_ts(inode, fattr->ctime); else if (fattr_supported & NFS_ATTR_FATTR_CTIME) nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_CTIME; From patchwork Wed Jul 5 19:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090614vqx; Wed, 5 Jul 2023 12:30:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlGCZZYsgkUb/r3IlPH8z7UmOpUJhs0QL7/Yay51azZQRLqZxNAJuutWEhR5NPFonglGVgLY X-Received: by 2002:a17:902:b714:b0:1b7:fd82:973c with SMTP id d20-20020a170902b71400b001b7fd82973cmr15956788pls.39.1688585421827; Wed, 05 Jul 2023 12:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585421; cv=none; d=google.com; s=arc-20160816; b=UlbjSCg0XSskZl6X2YNHSWFibpoZBVhPe9NvF0SaS/dPJqBkMMd7NYJRKJwby/k3PK mDLng4icDGPeRe1Iexnc11c6P9J0ze39EJmsF2nZv9MVDCGrvvayUaLbPXH2U/azcM0z YOxqlSprUlAj4CR42WZxz6s//U6tRQDbuq7suB8Hr/VkrF0Z0cvLjWPuvA90SIIkRr6N CSgxvQUvR/JXyfuT8tFghDv8rijzU6DKmoIaPRYejUutDDTYW+fPBPDjQ4KIA/h7fOkf d3e5ZEJZ8mhsFLyQPAnO8H8Q9ea8AQSndRhRCMiud3ROXC03YP74mz6AVtwTaBItNnry ulpw== 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=nTdTaIbmvSh8SsRtk1XTCyYftNObtDUPIRBPgePnYDE=; fh=RRVy51jN+A1SuyAuypdIEAgta+T/OkWqV5o26C13jt8=; b=G6pAoOKXffYgzzxAdxH773rqvw5YGpizb3EVLwhoLHVH/uRrEGo68XflO1kdFBtEkI NV3zNjIXKWLOLLP1CYRUsykXK9cbTgL6yuO5PGeYw0xHf3WQT1Hry9O4TV4BWo8JrQzy qQiNz6aZllC0jF6PuSNdUoJS2jbwpN1ZONMipo37/n3s43bJFLMIsDLCjW8MInHJ5W1g pBvkgt8b1hv0k1vS224WG1HPWHLQ/9+IoRwrlyDilpUBiJvvMNq23AgQzcKe9hAgK7h7 NHGwdHeNrchy6j6gRsjpJwy+9cObhylKNG2p6CWSbGL23PtDB0PQ4MPv0MBwookae4xD IhcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kan5Cvx9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902dad100b001b873d057afsi12845614plx.596.2023.07.05.12.30.06; Wed, 05 Jul 2023 12:30:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kan5Cvx9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234001AbjGETJ0 (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233964AbjGETIK (ORCPT ); Wed, 5 Jul 2023 15:08:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7323F30E9; Wed, 5 Jul 2023 12:04:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 504B7616C4; Wed, 5 Jul 2023 19:04:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B789BC433C9; Wed, 5 Jul 2023 19:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583888; bh=nz4OgBYlsMOKdpSoA1HyBKv/O9jg4R14AE4cRb0Uh3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kan5Cvx9lHLoy6XyRcibzCs0nKOnNBUGlFOzV8oieR+t/dvFwzCsGh20hoDsdk4uG 5nj1fIEwdvRV/XExVDTHN+tgIYw5xjbi3FNdnAXTzAidMKBG5gb3ZSOlqcAG5ynWW8 6DsZ2QUSoqTrENweGMCX5O6lnAQ3s7MO2oIJbJzXHMDzQe8P9H/NWaX8AFUX0dL7Im vLaSjakV661euyKtWFPx4JWUfFKDcykpk30buOIZmPKjnjPC8FfxMbx4EZm0RdgEM/ xVkXZS9LEUeNTNDr/tEOQSa0Rehaw3Yci6yxUulcbc52vKrvjp9JKzVxpRc7+knZd1 jidF2E09cGkYw== From: Jeff Layton To: Christian Brauner , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH v2 58/92] nfsd: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:23 -0400 Message-ID: <20230705190309.579783-56-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610147035846669?= X-GMAIL-MSGID: =?utf-8?q?1770610147035846669?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Chuck Lever Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/nfsd/nfsctl.c | 2 +- fs/nfsd/vfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 1b8b1aab9a15..a53c5660a8c4 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1131,7 +1131,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode) /* Following advice from simple_fill_super documentation: */ inode->i_ino = iunique(sb, NFSD_MaxReserved); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_fop = &simple_dir_operations; diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 8a2321d19194..40a68bae88fc 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -520,7 +520,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, nfsd_sanitize_attrs(inode, iap); - if (check_guard && guardtime != inode->i_ctime.tv_sec) + if (check_guard && guardtime != inode_get_ctime(inode).tv_sec) return nfserr_notsync; /* From patchwork Wed Jul 5 19:01:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116338 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2093519vqx; Wed, 5 Jul 2023 12:36:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/q9kpLu6g8LZY47qP9u5aB/iGeIhYSJMpyDaEjfVPHg6eh4vJhJqqfzSD8HkeJ9sygpWu X-Received: by 2002:aca:f08:0:b0:3a1:f0dc:def7 with SMTP id 8-20020aca0f08000000b003a1f0dcdef7mr16988257oip.56.1688585770961; Wed, 05 Jul 2023 12:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585770; cv=none; d=google.com; s=arc-20160816; b=U2nJm6x1xptTc4lW8dC6jkAo91O849JY+g5QrlPSh6nybY+ZJ9QKIWd0zR9uvgSes8 6y6zqAqCOJBRlOFKEYBR+pv8zNAIHk1Vv6YuwWaZjRECR6H6WwvBzhFfejgKZ1xWqpwa 8Bc5iFqPpt7VBhAX84TYtGgVlNfp1f1ajjIcIxX8nBeipFWwqMzmxJkxZjYyxjnf0CkW 80A2GhZfg4BfXAOrpV7tOrB6WSHM2fNDzY407diWQBVMp6tSAtwMvs5h/Q+l5UwUOOCr GEo/acXOHIvggkUkNvc22Z14MuRkz9BGHlhMml/gxUy33IwzdfFsGAp4syWj9wJT7/OE cB1Q== 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=VNYYDQZyn3mK2dU8QnaumTHp9gjXxJK2fDDVlngSibg=; fh=5PAqVmmufMQH+5IYbPPxfInCvNTG92Qt5smbl9jMkfc=; b=ENG+gBEFFou8dl/r8vTQi6WTKbzfoTVTvprAglQcy114T8hzAhrEaBYSj+bWRHD0F+ BkUM/uKOZ8Q4pXL1l6c+9MCH/i8MMZ8x3NgCZe4NVy68yNNWIdRWqA3LmcxVfbdk6OYW ZDHJ83ku9qRM9vo8bj7nNR3SiD2DBv1H8A0jRxx1SZ9CeY4UIUG7rf66ZO35puURaUtA T8MR7VNcxZ/hu2IZUARRgNss5jY04ikLzsYMS+GyKvoBUd4eBMsEmdBuxkIN3+bXIHL+ 4pNQtln/jkxP44uJpwSJE2roamVHQ11zkQYwf1y8SHqZOdH8wEAzBvDtdD7740v7bRvV iSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j3orGEaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j62-20020a638041000000b0055337ca9cefsi24680167pgd.857.2023.07.05.12.35.56; Wed, 05 Jul 2023 12:36:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j3orGEaO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233941AbjGETJF (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233990AbjGETIM (ORCPT ); Wed, 5 Jul 2023 15:08:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBA81FED; Wed, 5 Jul 2023 12:04:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4805D616EE; Wed, 5 Jul 2023 19:04:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05F91C433C7; Wed, 5 Jul 2023 19:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583890; bh=E7KAJORRcCNXt1YrJFvd8B4M9LhppUh4YeCIy/iI+nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j3orGEaOx2fRwNShOb7ALICoaGh+vRYkd3YyYRt7eoP1/phRgn7gPW8lq0bK34IWQ LjCnMulH1Vk78laTtJmer3+eZr2neFxAJtIB2Og7ospx32MKqzlJNlkwuazXG5i6kQ 6qXMZa6uqAyiNpWvEek3HXKP9RkfWFYDrr53RjNXIWS/VAV1LqOze0oACktBn5KHRV oU7vXqOU6GZL0MstaI8IHe4sLMzVro62nn6NSj56YABIcO+w1rapsUMwgUSKq3HqiD dGUnZ6uKT3bnOsvsN4iVwB+nzMCH2iIuW9w3tr2hgO3fCc6yl4IyGxjlF9VrqxVa3s 4sCoaQKe5vZig== From: Jeff Layton To: Christian Brauner , Ryusuke Konishi Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nilfs@vger.kernel.org Subject: [PATCH v2 59/92] nilfs2: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:24 -0400 Message-ID: <20230705190309.579783-57-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610513218680156?= X-GMAIL-MSGID: =?utf-8?q?1770610513218680156?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Ryusuke Konishi Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 12 ++++++------ fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/namei.c | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index decd6471300b..bce734b68f08 100644 --- a/fs/nilfs2/dir.c +++ b/fs/nilfs2/dir.c @@ -429,7 +429,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de, nilfs_set_de_type(de, inode); nilfs_commit_chunk(page, mapping, from, to); nilfs_put_page(page); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); } /* @@ -519,7 +519,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode) de->inode = cpu_to_le64(inode->i_ino); nilfs_set_de_type(de, inode); nilfs_commit_chunk(page, page->mapping, from, to); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); nilfs_mark_inode_dirty(dir); /* OFFSET_CACHE */ out_put: @@ -567,7 +567,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) pde->rec_len = nilfs_rec_len_to_disk(to - from); dir->inode = 0; nilfs_commit_chunk(page, mapping, from, to); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); out: nilfs_put_page(page); return err; diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index a8ce522ac747..5259b94ca1dc 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c @@ -366,7 +366,7 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode) atomic64_inc(&root->inodes_count); inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_ino = ino; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) { err = nilfs_bmap_read(ii->i_bmap, NULL); @@ -450,10 +450,10 @@ int nilfs_read_inode_common(struct inode *inode, set_nlink(inode, le16_to_cpu(raw_inode->i_links_count)); inode->i_size = le64_to_cpu(raw_inode->i_size); inode->i_atime.tv_sec = le64_to_cpu(raw_inode->i_mtime); - inode->i_ctime.tv_sec = le64_to_cpu(raw_inode->i_ctime); + inode_set_ctime(inode, le64_to_cpu(raw_inode->i_ctime), + le32_to_cpu(raw_inode->i_ctime_nsec)); inode->i_mtime.tv_sec = le64_to_cpu(raw_inode->i_mtime); inode->i_atime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); - inode->i_ctime.tv_nsec = le32_to_cpu(raw_inode->i_ctime_nsec); inode->i_mtime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); if (nilfs_is_metadata_file_inode(inode) && !S_ISREG(inode->i_mode)) return -EIO; /* this inode is for metadata and corrupted */ @@ -768,9 +768,9 @@ void nilfs_write_inode_common(struct inode *inode, raw_inode->i_gid = cpu_to_le32(i_gid_read(inode)); raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); raw_inode->i_size = cpu_to_le64(inode->i_size); - raw_inode->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); + raw_inode->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); raw_inode->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); - raw_inode->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + raw_inode->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); raw_inode->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); raw_inode->i_blocks = cpu_to_le64(inode->i_blocks); @@ -875,7 +875,7 @@ void nilfs_truncate(struct inode *inode) nilfs_truncate_bmap(ii, blkoff); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index 1dfbc0c34513..40ffade49f38 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c @@ -149,7 +149,7 @@ int nilfs_fileattr_set(struct mnt_idmap *idmap, NILFS_I(inode)->i_flags = oldflags | (flags & FS_FL_USER_MODIFIABLE); nilfs_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c index c7024da8f1e2..2a4e7f4a8102 100644 --- a/fs/nilfs2/namei.c +++ b/fs/nilfs2/namei.c @@ -185,7 +185,7 @@ static int nilfs_link(struct dentry *old_dentry, struct inode *dir, if (err) return err; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -283,7 +283,7 @@ static int nilfs_do_unlink(struct inode *dir, struct dentry *dentry) if (err) goto out; - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); drop_nlink(inode); err = 0; out: @@ -387,7 +387,7 @@ static int nilfs_rename(struct mnt_idmap *idmap, goto out_dir; nilfs_set_link(new_dir, new_de, new_page, old_inode); nilfs_mark_inode_dirty(new_dir); - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); if (dir_de) drop_nlink(new_inode); drop_nlink(new_inode); @@ -406,7 +406,7 @@ static int nilfs_rename(struct mnt_idmap *idmap, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); nilfs_delete_entry(old_de, old_page); From patchwork Wed Jul 5 19:01:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2094548vqx; Wed, 5 Jul 2023 12:38:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49gZL6gEYhQ+pzYhL0TegUAdvtPm1ADkDSpKWSK+ueYRA7b3wlH+u11MhlwYoksNBP4dd6 X-Received: by 2002:a05:6830:138a:b0:6b8:7d21:3721 with SMTP id d10-20020a056830138a00b006b87d213721mr15064287otq.33.1688585906231; Wed, 05 Jul 2023 12:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585906; cv=none; d=google.com; s=arc-20160816; b=MPrkMRSX8Ywz+dijhxJFXZaratgFqlGqliGFK0Qb60/sdmGIWwdvIrT1HMU9WeUTDv 8SRAE7DUY6yd8TLgLSW7DOtZRRp3l++q2ZnoFYM+s/iqh8n9fpS+EOlwlylt8d9VTa+v pqF5k6K8U0nzE7ecT37gquA0RaElINiSQATMw7ENGrCHm5VudMBzO4mG3mFgFflPqK4a fCC+6SSL+yY0QKQpN1OfILgf9d91Bggn4O8ih1tk5kyiqTEM1C72oC1xcEzZQbPbl2A5 4+ySUCgGm7eNU6oK/n76NKSXhRVbL+P8Pj73oL+yj6HR33WtprIFgaCW8wgg/Xr3iz5d euKw== 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=6p/jD2qgu3Ta8+OfCkVGYmt0yytFObZ0xAYF5VRvddo=; fh=m1GEco3WzxljGGiRBVBES01Us7aWsb1sAN0xHUrBisQ=; b=gRU3q8VU+J9Vnep7Scik83FVqtCsUWKtXfJMz6S4Jp+CfX3JcHlxqKsOTadGy9WZ7+ C0JivqoQMF8n31rK67z1CnueLW4jdTsrZvj5UZnjJmYD5Aac1FIM9KAW8iWyRrnNU623 tAWWXRgpBLSmI7AsE+0whcDAPyl78R/3TeN9/3AIBZaSXvMPHYHvAKFSx0vAuabhFyqo MqSarfvP42tFDf/c7jHv+V8YnaG12YUklQWQRwEzsYwUIg3lxG8zsTtJrFZstFnN1eup 45mIjvHBHGhfm5WhRRoK78OarjZZ1LUaBG9ziDTxMIbs56fAzk8mcHv0s5oRjYpqlTxF SiTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g1xtWtER; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y64-20020a638a43000000b0054fd4d7d642si22995043pgd.4.2023.07.05.12.38.13; Wed, 05 Jul 2023 12:38:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g1xtWtER; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233918AbjGETIx (ORCPT + 99 others); Wed, 5 Jul 2023 15:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234006AbjGETIP (ORCPT ); Wed, 5 Jul 2023 15:08:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 329C930FD; Wed, 5 Jul 2023 12:04:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA967616D1; Wed, 5 Jul 2023 19:04:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99645C433C7; Wed, 5 Jul 2023 19:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583892; bh=jvaW2KRmybks7mvs3yOwXVr/qAGA1M2OOs0qv92r5E8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g1xtWtERR9DQpMMBKqDExHVrFEjpaDxc4hzZ3Y7fdDV2lCxsUP6+Ed5TSxXK4taET ttP2JTp9wZ6FOXip1TYDrYEdcSq0M8GJ+UqIiDUZLN3UMqVZUEMn0SU+ifk7M3GR4f Ehvrkqw8+sKz+uxAFmV+9Isjs7Y1SiYrqcNfxVFKiFT1h9hc8J6Utbpl/CCrewFVgX tV7x2ReErdrhiIKM+VucEI9tsu4Gf1oIxbCnkoOt9BMmGg4cQR42vmDeBoweJwAuBr u/VeLLD9+TEUqc8/gefyIln5ueL8vAh3LcJ/cgYls9OG9Duts/iqGX4a+7ZUUhrppQ OfJ5s89rA1viw== From: Jeff Layton To: Christian Brauner , Anton Altaparmakov , Namjae Jeon Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net Subject: [PATCH v2 60/92] ntfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:25 -0400 Message-ID: <20230705190309.579783-58-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610655456143094?= X-GMAIL-MSGID: =?utf-8?q?1770610655456143094?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ntfs/inode.c | 15 ++++++++------- fs/ntfs/mft.c | 3 +-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 6c3f38d66579..99ac6ea277c4 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -654,7 +654,7 @@ static int ntfs_read_locked_inode(struct inode *vi) * always changes, when mtime is changed. ctime can be changed on its * own, mtime is then not changed, e.g. when a file is renamed. */ - vi->i_ctime = ntfs2utc(si->last_mft_change_time); + inode_set_ctime_to_ts(vi, ntfs2utc(si->last_mft_change_time)); /* * Last access to the data within the file. Not changed during a rename * for example but changed whenever the file is written to. @@ -1218,7 +1218,7 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi) vi->i_gid = base_vi->i_gid; set_nlink(vi, base_vi->i_nlink); vi->i_mtime = base_vi->i_mtime; - vi->i_ctime = base_vi->i_ctime; + inode_set_ctime_to_ts(vi, inode_get_ctime(base_vi)); vi->i_atime = base_vi->i_atime; vi->i_generation = ni->seq_no = base_ni->seq_no; @@ -1484,7 +1484,7 @@ static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi) vi->i_gid = base_vi->i_gid; set_nlink(vi, base_vi->i_nlink); vi->i_mtime = base_vi->i_mtime; - vi->i_ctime = base_vi->i_ctime; + inode_set_ctime_to_ts(vi, inode_get_ctime(base_vi)); vi->i_atime = base_vi->i_atime; vi->i_generation = ni->seq_no = base_ni->seq_no; /* Set inode type to zero but preserve permissions. */ @@ -2804,13 +2804,14 @@ int ntfs_truncate(struct inode *vi) */ if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { struct timespec64 now = current_time(VFS_I(base_ni)); + struct timespec64 ctime = inode_get_ctime(VFS_I(base_ni)); int sync_it = 0; if (!timespec64_equal(&VFS_I(base_ni)->i_mtime, &now) || - !timespec64_equal(&VFS_I(base_ni)->i_ctime, &now)) + !timespec64_equal(&ctime, &now)) sync_it = 1; + inode_set_ctime_to_ts(VFS_I(base_ni), now); VFS_I(base_ni)->i_mtime = now; - VFS_I(base_ni)->i_ctime = now; if (sync_it) mark_inode_dirty_sync(VFS_I(base_ni)); @@ -2928,7 +2929,7 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, if (ia_valid & ATTR_MTIME) vi->i_mtime = attr->ia_mtime; if (ia_valid & ATTR_CTIME) - vi->i_ctime = attr->ia_ctime; + inode_set_ctime_to_ts(vi, attr->ia_ctime); mark_inode_dirty(vi); out: return err; @@ -3004,7 +3005,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) si->last_data_change_time = nt; modified = true; } - nt = utc2ntfs(vi->i_ctime); + nt = utc2ntfs(inode_get_ctime(vi)); if (si->last_mft_change_time != nt) { ntfs_debug("Updating ctime for inode 0x%lx: old = 0x%llx, " "new = 0x%llx", vi->i_ino, (long long) diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 0155f106ec34..ad1a8f72da22 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -2682,8 +2682,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode, vi->i_mode &= ~S_IWUGO; /* Set the inode times to the current time. */ - vi->i_atime = vi->i_mtime = vi->i_ctime = - current_time(vi); + vi->i_atime = vi->i_mtime = inode_set_ctime_current(vi); /* * Set the file size to 0, the ntfs inode sizes are set to 0 by * the call to ntfs_init_big_inode() below. From patchwork Wed Jul 5 19:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097703vqx; Wed, 5 Jul 2023 12:45:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEBytESlQkSq/Kmzp+YmaQc1wDNWtYNgAUa9/kxj2QcyJVtJi8AKzQT0dgRI8P826dJ2DG4 X-Received: by 2002:a05:6a20:7d82:b0:12e:49f3:88d4 with SMTP id v2-20020a056a207d8200b0012e49f388d4mr11514006pzj.1.1688586325025; Wed, 05 Jul 2023 12:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586325; cv=none; d=google.com; s=arc-20160816; b=dk4JwrnA2JS74xnpobiDMEoTU4b460oomvsFSka35fO69umvCRyGxsGe+s4bMZhCFu 5kVwAOgaVZnpcm68GoLmyReCZWoUnF2ni7kQhplbe+TwAdERXXhNsgeXSl/WzoOq37pF 2MF1lnhA4Ut5gvM+1WbwVAR5NFYZfk96I/bK8gPaWzX3oPhthTqo0+050DoQIf/M7Fv3 de6T9vXkoA1s9wyZLaV7HB7PPFlqt+308AaXZnAYnuaEDg8UbWRutuVu/CkY6OVSXAa/ yhAA7IMZwKCrOK823LxzPWPbzuQp1MSYajn3tKedd9le89dciaGJq8LNxvuBmODqT1Dv qaBw== 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=3ie69YjP6CvMrMcnVk4+/l7cCV4dGZe/ZWxOP+pNbcw=; fh=hshfxaSiAdJ0QSS5OAKXCySBOTIA9NmCMCDMDlwHCkU=; b=d5KE3RkIjiqX4f8DBW0X7bIf27GaW7hi59DMmNKJkwxboF/gDJs/IeiwJEZESui1i6 JYXMReoP/hgjTJAFmYY6RMOkpKB/CW5W6HdS2pu6TN5OTAitVu3ILO6CP1/j093eiHA5 ttVPWxOkluHw+TXbmHeghhmCB+v1wTh+B2PUM4qlIh9SWTeaPQOcSOYVEHMaDRxRn4FA pfp+DKlCWhNXa3BahBwJlJa9lKexMQcEy36601D0SVtoCoB+P5snKh3zveK9URtzOkKs seCeMP42tYY+DZuROC4RwZyHEkMO4QHbGcKSTksu81AA7PS2CCK4SE6eGzdCw2PZReUu ZLyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VeFPZUU6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh7-20020a056a00808700b00674311392f7si21066785pfb.31.2023.07.05.12.45.10; Wed, 05 Jul 2023 12:45:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VeFPZUU6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233809AbjGETLC (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234074AbjGETKY (ORCPT ); Wed, 5 Jul 2023 15:10:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C6D526A2; Wed, 5 Jul 2023 12:05:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1E0F3616CF; Wed, 5 Jul 2023 19:04:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD37CC433C8; Wed, 5 Jul 2023 19:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583894; bh=iMboyqv556mmxUksE6b3nkPMjDImUK/A5hN0uNBWq4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VeFPZUU64bjVKsbQI1vaGA5z3HYa665P9Mc/BStdxQuL6nYt5pXFTtfhV9zu+nbkk SWIf8TZNXuKMLPUwk3p0j8PK3mEuP8Dgwwn9XYRQahJJ/8VYC3b2kb4uF+QNPXcTNZ D9wBLvUmUaJ1W1zfTbtcz+fcOUCQN6oJyxLIj6Yzv4bJHFNvl5BrBN8c9r911yEhPE FP8kaXkvUTkFwEVALdYfP/Tqv+Dmz+SdyYcuB+zla/bhus4E3CYRiRqKlimFaLnJUo KK5zetjjgqnw56EnfYHXm8g5qflQQQSWL7ENqEvWnjgLEoP1Zt7MLo31GEdTeBvmWT Kcimm5xXwKDmA== From: Jeff Layton To: Christian Brauner , Konstantin Komarov Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev Subject: [PATCH v2 61/92] ntfs3: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:26 -0400 Message-ID: <20230705190309.579783-59-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611094617149380?= X-GMAIL-MSGID: =?utf-8?q?1770611094617149380?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ntfs3/file.c | 6 +++--- fs/ntfs3/frecord.c | 3 ++- fs/ntfs3/inode.c | 14 ++++++++------ fs/ntfs3/namei.c | 4 ++-- fs/ntfs3/xattr.c | 4 ++-- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 1d6c824246c4..12788601dc84 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -342,7 +342,7 @@ static int ntfs_extend(struct inode *inode, loff_t pos, size_t count, err = 0; } - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); if (IS_SYNC(inode)) { @@ -400,7 +400,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size) ni_unlock(ni); ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE; - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); if (!IS_DIRSYNC(inode)) { dirty = 1; } else { @@ -642,7 +642,7 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len) filemap_invalidate_unlock(mapping); if (!err) { - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); } diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 16bd9faa2d28..2b85cb10f0be 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -3265,6 +3265,7 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint) if (is_rec_inuse(ni->mi.mrec) && !(sbi->flags & NTFS_FLAGS_LOG_REPLAYING) && inode->i_nlink) { bool modified = false; + struct timespec64 ctime = inode_get_ctime(inode); /* Update times in standard attribute. */ std = ni_std(ni); @@ -3280,7 +3281,7 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint) modified = true; } - dup.c_time = kernel2nt(&inode->i_ctime); + dup.c_time = kernel2nt(&ctime); if (std->c_time != dup.c_time) { std->c_time = dup.c_time; modified = true; diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index dc7e7ab701c6..4123e126c4d0 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -44,6 +44,7 @@ static struct inode *ntfs_read_mft(struct inode *inode, u64 t64; struct MFT_REC *rec; struct runs_tree *run; + struct timespec64 ctime; inode->i_op = NULL; /* Setup 'uid' and 'gid' */ @@ -169,7 +170,8 @@ static struct inode *ntfs_read_mft(struct inode *inode, nt2kernel(std5->cr_time, &ni->i_crtime); #endif nt2kernel(std5->a_time, &inode->i_atime); - nt2kernel(std5->c_time, &inode->i_ctime); + ctime = inode_get_ctime(inode); + nt2kernel(std5->c_time, &ctime); nt2kernel(std5->m_time, &inode->i_mtime); ni->std_fa = std5->fa; @@ -958,7 +960,7 @@ int ntfs_write_end(struct file *file, struct address_space *mapping, loff_t pos, if (err >= 0) { if (!(ni->std_fa & FILE_ATTRIBUTE_ARCHIVE)) { - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE; dirty = true; } @@ -1658,8 +1660,8 @@ struct inode *ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir, d_instantiate(dentry, inode); /* Set original time. inode times (i_ctime) may be changed in ntfs_init_acl. */ - inode->i_atime = inode->i_mtime = inode->i_ctime = dir->i_mtime = - dir->i_ctime = ni->i_crtime; + inode->i_atime = inode->i_mtime = inode_set_ctime_to_ts(inode, ni->i_crtime); + dir->i_mtime = inode_set_ctime_to_ts(dir, ni->i_crtime); mark_inode_dirty(dir); mark_inode_dirty(inode); @@ -1765,9 +1767,9 @@ int ntfs_unlink_inode(struct inode *dir, const struct dentry *dentry) if (!err) { drop_nlink(inode); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); if (inode->i_nlink) mark_inode_dirty(inode); } else if (!ni_remove_name_undo(dir_ni, ni, de, de2, undo_remove)) { diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index bfd986699f9e..ad430d50bd79 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -156,8 +156,8 @@ static int ntfs_link(struct dentry *ode, struct inode *dir, struct dentry *de) err = ntfs_link_inode(inode, de); if (!err) { - dir->i_ctime = dir->i_mtime = inode->i_ctime = - current_time(dir); + dir->i_mtime = inode_set_ctime_to_ts(inode, + inode_set_ctime_current(dir)); mark_inode_dirty(inode); mark_inode_dirty(dir); d_instantiate(de, inode); diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 023f314e8950..29fd391899e5 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -637,7 +637,7 @@ static noinline int ntfs_set_acl_ex(struct mnt_idmap *idmap, if (!err) { set_cached_acl(inode, type, acl); inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); } @@ -924,7 +924,7 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler, NULL); out: - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); return err; From patchwork Wed Jul 5 19:01:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116375 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097139vqx; Wed, 5 Jul 2023 12:44:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFw37ZmhyZ0GR5PeHOr+eXJQbvA078RKM482vLELMM3B2we6hOo0lF+oko5ze35K/4Chleg X-Received: by 2002:a17:902:cec6:b0:1b7:f64b:379b with SMTP id d6-20020a170902cec600b001b7f64b379bmr19396plg.17.1688586247001; Wed, 05 Jul 2023 12:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586246; cv=none; d=google.com; s=arc-20160816; b=u9jVjsfcU4pH0wyJh4aRCdUyJavxtTF7N/b2nNyB4UlHAUt1Gnc39M/9TBOdX3/zy1 ZmNzbgFx7XZkBwPet+EN/a82Hpb43UgAeBGWgM0q3QyfRL72xcKEzq4SL4k85SnGXE6C H3+6WDliQfafupb08fcd/t5S+JhdTknyVlBYObmLJc7bPu97qUBsHLaXu79lVwchoDBb cpIeiPf+Ix/RIyHlRQF5p/y7VtrJuAw89EsLtC2CVT+PUWMN94vtXPZJONELihiFOyr+ DEXObrSu+CKBFkHU36DUEtWe1uTWRzhkGQjMnEfs3lv4SvkW9rbmwPr2X2zNjsTDdJDg Lfjw== 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=OIasRLBYtFzkF59NqVmLZQ09ZGrOKjOL7xWHIW2QEiM=; fh=legyzCx4dAT/eXQSwluQsbjiqOEMMSwWJo9DxWw3qwY=; b=huNZ9FrG1lF7RK4nMEJt7IjyIKYibWG1foLP54DbI6fAMAqUvMOQIzrV4ZFT8ggwVn Bpg5laEHQjq/NX2SY54yg1lsse8kyUsWAeUrPkScLZsyqaPx3BNokp+kRATfdD9oFr2e Z+t4dksiOS7/tRRkmTSe40bFC1qz5Ove5xJwID6DKcMwQ2W0shTgEZ8NYe5Sp6rqIBoo d+qqzQvJGZ/V1B+IlEsz+HlJQDfbvF5j23KPk9ay3aG3fGiTXGA5N8dEUyYxXhNPLR4s wO1WaSDMD130ONZWZo2K49FT6E2PJg75AOFGJrya7P3K9D/AIQ7g1MxQiQu8oc2lGFi2 +Njw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hJ1EkhlY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a170903230700b001b89b1bae72si7602507plh.528.2023.07.05.12.43.52; Wed, 05 Jul 2023 12:44:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hJ1EkhlY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233466AbjGETIm (ORCPT + 99 others); Wed, 5 Jul 2023 15:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234044AbjGETIS (ORCPT ); Wed, 5 Jul 2023 15:08:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C043A1FFE; Wed, 5 Jul 2023 12:04:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9195E616F0; Wed, 5 Jul 2023 19:04:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26053C433C7; Wed, 5 Jul 2023 19:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583898; bh=h3ycJupFO4ntiyWIqYzQDHpZWep5vJytDJyV/6Ns2ys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hJ1EkhlYuA08mbPPo+SOzXGm8xyzAO5k3u1MOR85DTjEXrqh8vIm1YA89o289Zcqx PkLxr6UWr1fbTmW3bbf5/1EnlOHDnyJ0TdULcoMtA+yKRVAYcA6WHAzCACTy6LEBGE KixEOiWCmow9amCmcDScdpSxQoYkp+Pw72APhoNn8/cXWUb00A//D0phhY5OFOPN4x RnGqe/UrKsEIfII8MBYABeKB/FFT6llcd0GED2LHihqOrCd/hMUiNDWReQJM6CVa4r n+xgk4NdNA81U0/xp4gQ1Y71ysPy4lnTOwqoXXF2c1yOrig+yzeLlepv7eKvVsgT7D QZOQoL7PJytHA== From: Jeff Layton To: Christian Brauner , Mark Fasheh , Joel Becker , Joseph Qi Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ocfs2-devel@lists.linux.dev Subject: [PATCH v2 62/92] ocfs2: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:27 -0400 Message-ID: <20230705190309.579783-60-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611012439656836?= X-GMAIL-MSGID: =?utf-8?q?1770611012439656836?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara Acked-by: Joseph Qi --- fs/ocfs2/acl.c | 6 +++--- fs/ocfs2/alloc.c | 6 +++--- fs/ocfs2/aops.c | 2 +- fs/ocfs2/dir.c | 8 ++++---- fs/ocfs2/dlmfs/dlmfs.c | 4 ++-- fs/ocfs2/dlmglue.c | 7 +++++-- fs/ocfs2/file.c | 16 +++++++++------- fs/ocfs2/inode.c | 12 ++++++------ fs/ocfs2/move_extents.c | 6 +++--- fs/ocfs2/namei.c | 21 +++++++++++---------- fs/ocfs2/refcounttree.c | 14 +++++++------- fs/ocfs2/xattr.c | 6 +++--- 12 files changed, 57 insertions(+), 51 deletions(-) diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index 9fd03eaf15f8..e75137a8e7cb 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -191,10 +191,10 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, } inode->i_mode = new_mode; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); di->i_mode = cpu_to_le16(inode->i_mode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, di_bh); diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 51c93929a146..aef58f1395c8 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -7436,10 +7436,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, } inode->i_blocks = ocfs2_inode_sector_count(inode); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); - di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 1); ocfs2_journal_dirty(handle, di_bh); diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 8dfc284e85f0..0fdba30740ab 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -2048,7 +2048,7 @@ int ocfs2_write_end_nolock(struct address_space *mapping, } inode->i_blocks = ocfs2_inode_sector_count(inode); di->i_size = cpu_to_le64((u64)i_size_read(inode)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); if (handle) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 694471fc46b8..8b123d543e6e 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -1658,7 +1658,7 @@ int __ocfs2_add_entry(handle_t *handle, offset, ocfs2_dir_trailer_blk_off(dir->i_sb)); if (ocfs2_dirent_would_fit(de, rec_len)) { - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); if (retval < 0) { mlog_errno(retval); @@ -2962,11 +2962,11 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, ocfs2_dinode_new_extent_list(dir, di); i_size_write(dir, sb->s_blocksize); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); di->i_size = cpu_to_le64(sb->s_blocksize); - di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(dir).tv_sec); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(dir).tv_nsec); ocfs2_update_inode_fsync_trans(handle, dir, 1); /* diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index ba26c5567cff..81265123ce6c 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -337,7 +337,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) if (inode) { inode->i_ino = get_next_ino(); inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inc_nlink(inode); inode->i_fop = &simple_dir_operations; @@ -360,7 +360,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent, inode->i_ino = get_next_ino(); inode_init_owner(&nop_mnt_idmap, inode, parent, mode); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); ip = DLMFS_I(inode); ip->ip_conn = DLMFS_I(parent)->ip_conn; diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index c28bc983a7b1..c3e2961ee5db 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -2162,6 +2162,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; struct ocfs2_meta_lvb *lvb; + struct timespec64 ctime = inode_get_ctime(inode); lvb = ocfs2_dlm_lvb(&lockres->l_lksb); @@ -2185,7 +2186,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) lvb->lvb_iatime_packed = cpu_to_be64(ocfs2_pack_timespec(&inode->i_atime)); lvb->lvb_ictime_packed = - cpu_to_be64(ocfs2_pack_timespec(&inode->i_ctime)); + cpu_to_be64(ocfs2_pack_timespec(&ctime)); lvb->lvb_imtime_packed = cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); @@ -2208,6 +2209,7 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode) struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; struct ocfs2_meta_lvb *lvb; + struct timespec64 ctime; mlog_meta_lvb(0, lockres); @@ -2238,8 +2240,9 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode) be64_to_cpu(lvb->lvb_iatime_packed)); ocfs2_unpack_timespec(&inode->i_mtime, be64_to_cpu(lvb->lvb_imtime_packed)); - ocfs2_unpack_timespec(&inode->i_ctime, + ocfs2_unpack_timespec(&ctime, be64_to_cpu(lvb->lvb_ictime_packed)); + inode_set_ctime_to_ts(inode, ctime); spin_unlock(&oi->ip_lock); return 0; } diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 9e417cd4fd16..e8c78d16e815 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -232,8 +232,10 @@ int ocfs2_should_update_atime(struct inode *inode, return 0; if (vfsmnt->mnt_flags & MNT_RELATIME) { + struct timespec64 ctime = inode_get_ctime(inode); + if ((timespec64_compare(&inode->i_atime, &inode->i_mtime) <= 0) || - (timespec64_compare(&inode->i_atime, &inode->i_ctime) <= 0)) + (timespec64_compare(&inode->i_atime, &ctime) <= 0)) return 1; return 0; @@ -294,7 +296,7 @@ int ocfs2_set_inode_size(handle_t *handle, i_size_write(inode, new_i_size); inode->i_blocks = ocfs2_inode_sector_count(inode); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); if (status < 0) { @@ -415,12 +417,12 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, } i_size_write(inode, new_i_size); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); di = (struct ocfs2_dinode *) fe_bh->b_data; di->i_size = cpu_to_le64(new_i_size); - di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, fe_bh); @@ -819,7 +821,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, i_size_write(inode, abs_to); inode->i_blocks = ocfs2_inode_sector_count(inode); di->i_size = cpu_to_le64((u64)i_size_read(inode)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); di->i_mtime_nsec = di->i_ctime_nsec; @@ -2038,7 +2040,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, goto out_inode_unlock; } - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); if (ret < 0) mlog_errno(ret); diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index bb116c39b581..e8771600b930 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -306,8 +306,8 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, inode->i_atime.tv_nsec = le32_to_cpu(fe->i_atime_nsec); inode->i_mtime.tv_sec = le64_to_cpu(fe->i_mtime); inode->i_mtime.tv_nsec = le32_to_cpu(fe->i_mtime_nsec); - inode->i_ctime.tv_sec = le64_to_cpu(fe->i_ctime); - inode->i_ctime.tv_nsec = le32_to_cpu(fe->i_ctime_nsec); + inode_set_ctime(inode, le64_to_cpu(fe->i_ctime), + le32_to_cpu(fe->i_ctime_nsec)); if (OCFS2_I(inode)->ip_blkno != le64_to_cpu(fe->i_blkno)) mlog(ML_ERROR, @@ -1314,8 +1314,8 @@ int ocfs2_mark_inode_dirty(handle_t *handle, fe->i_mode = cpu_to_le16(inode->i_mode); fe->i_atime = cpu_to_le64(inode->i_atime.tv_sec); fe->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); - fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + fe->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); fe->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); fe->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); @@ -1352,8 +1352,8 @@ void ocfs2_refresh_inode(struct inode *inode, inode->i_atime.tv_nsec = le32_to_cpu(fe->i_atime_nsec); inode->i_mtime.tv_sec = le64_to_cpu(fe->i_mtime); inode->i_mtime.tv_nsec = le32_to_cpu(fe->i_mtime_nsec); - inode->i_ctime.tv_sec = le64_to_cpu(fe->i_ctime); - inode->i_ctime.tv_nsec = le32_to_cpu(fe->i_ctime_nsec); + inode_set_ctime(inode, le64_to_cpu(fe->i_ctime), + le32_to_cpu(fe->i_ctime_nsec)); spin_unlock(&OCFS2_I(inode)->ip_lock); } diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index b1e32ec4a9d4..05d67968a3a9 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -950,9 +950,9 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context) } di = (struct ocfs2_dinode *)di_bh->b_data; - inode->i_ctime = current_time(inode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + inode_set_ctime_current(inode); + di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, di_bh); diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 17c52225b87d..e4a684d45308 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -793,10 +793,10 @@ static int ocfs2_link(struct dentry *old_dentry, } inc_nlink(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); ocfs2_set_links_count(fe, inode->i_nlink); - fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + fe->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ocfs2_journal_dirty(handle, fe_bh); err = ocfs2_add_entry(handle, dentry, inode, @@ -995,7 +995,7 @@ static int ocfs2_unlink(struct inode *dir, ocfs2_set_links_count(fe, inode->i_nlink); ocfs2_journal_dirty(handle, fe_bh); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); if (S_ISDIR(inode->i_mode)) drop_nlink(dir); @@ -1537,7 +1537,7 @@ static int ocfs2_rename(struct mnt_idmap *idmap, new_dir_bh, &target_insert); } - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); mark_inode_dirty(old_inode); status = ocfs2_journal_access_di(handle, INODE_CACHE(old_inode), @@ -1546,8 +1546,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (status >= 0) { old_di = (struct ocfs2_dinode *) old_inode_bh->b_data; - old_di->i_ctime = cpu_to_le64(old_inode->i_ctime.tv_sec); - old_di->i_ctime_nsec = cpu_to_le32(old_inode->i_ctime.tv_nsec); + old_di->i_ctime = cpu_to_le64(inode_get_ctime(old_inode).tv_sec); + old_di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(old_inode).tv_nsec); ocfs2_journal_dirty(handle, old_inode_bh); } else mlog_errno(status); @@ -1586,9 +1586,9 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (new_inode) { drop_nlink(new_inode); - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); } - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + old_dir->i_mtime = inode_set_ctime_current(old_dir); if (update_dot_dot) { status = ocfs2_update_entry(old_inode, handle, @@ -1610,7 +1610,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (old_dir != new_dir) { /* Keep the same times on both directories.*/ - new_dir->i_ctime = new_dir->i_mtime = old_dir->i_ctime; + new_dir->i_mtime = inode_set_ctime_to_ts(new_dir, + inode_get_ctime(old_dir)); /* * This will also pick up the i_nlink change from the diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 564ab48d03ef..25c8ec3c8c3a 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -3750,9 +3750,9 @@ static int ocfs2_change_ctime(struct inode *inode, goto out_commit; } - inode->i_ctime = current_time(inode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + inode_set_ctime_current(inode); + di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ocfs2_journal_dirty(handle, di_bh); @@ -4073,10 +4073,10 @@ static int ocfs2_complete_reflink(struct inode *s_inode, * we want mtime to appear identical to the source and * update ctime. */ - t_inode->i_ctime = current_time(t_inode); + inode_set_ctime_current(t_inode); - di->i_ctime = cpu_to_le64(t_inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(t_inode->i_ctime.tv_nsec); + di->i_ctime = cpu_to_le64(inode_get_ctime(t_inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(t_inode).tv_nsec); t_inode->i_mtime = s_inode->i_mtime; di->i_mtime = s_di->i_mtime; @@ -4456,7 +4456,7 @@ int ocfs2_reflink_update_dest(struct inode *dest, if (newlen > i_size_read(dest)) i_size_write(dest, newlen); spin_unlock(&OCFS2_I(dest)->ip_lock); - dest->i_ctime = dest->i_mtime = current_time(dest); + dest->i_mtime = inode_set_ctime_current(dest); ret = ocfs2_mark_inode_dirty(handle, dest, d_bh); if (ret) { diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 4ac77ff6e676..6510ad783c91 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -3421,9 +3421,9 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, goto out; } - inode->i_ctime = current_time(inode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + inode_set_ctime_current(inode); + di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ocfs2_journal_dirty(ctxt->handle, xis->inode_bh); } out: From patchwork Wed Jul 5 19:01:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116323 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090769vqx; Wed, 5 Jul 2023 12:30:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QXz0BxrSAySQGOx8fYAkOZbT4pTmIoafV3LyN7MrWsyxzGvuQ00rlQiSiEA0hoXYhcB5U X-Received: by 2002:a05:6830:2015:b0:6b7:1d93:72e0 with SMTP id e21-20020a056830201500b006b71d9372e0mr17427738otp.32.1688585441486; Wed, 05 Jul 2023 12:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585441; cv=none; d=google.com; s=arc-20160816; b=LrbVRhE+Nn2XE8FJk5L4jDYFhD86irr9kGMidepuwtW0UCxCAyRocDECi9iGvdIcYy HwPAGLwu4TirciRsFkn72lorsdOPJAKjf92JkZlqwkr0b7yWuF/PsZaBJy4Ly9DpN+Xs Xx7ppsr7C/0nTUjpfauxXPV5ey//NVMIHm4eFHATnEWI2a1iZLoXq8+iWtsytEOxobKq f/xe5JR8yU8FxLeV2lssscNDANLJvnzr+/rlia5Q+xrg0wnIHeM7KIaJImw6rkaeMP6D +WwzMwz5EnDZUX7fDJOPyMFE+iDJ0Kb4ZaH6TnYEP2Durfj9csNqxVUsJRKjHoy1ZsD2 7u+A== 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=3XB6yX6vqQZ+nFwZsNKdva94nwaaeSK969Wy3lnhZWI=; fh=2Cm7PmyORhSdb4ojVPN+M1G6zRlXP8f6OCOck5tStqM=; b=F90a6DA7O1exXd2JlhUAyH/gnyav3P5S+uTRkdmznTRnEGm+e1jlfXVzSvm+KrMfFy v2V2mWEmGLUIK6GHnWbfbxq12MaP66rytsxK4Na4QKMzKhH3YQwpdCQSTge1nXV75edP cfFwXtWb8F/I657hx8i3SvvmnOLIaP6X3nfzFy4nZbBn8xXvgGOg9HIuJhUiZPEki+BB 7ZX00EmPPnr0EIhLGz/gRxLZIR4drF6ciZj5N6zUYk9RCJpWjE7/GkWgA5oKkeVoZIRt LtXA291o23SUV7H+1iQv+4Uzf0d5A+y53KgY0+t8I372rX9E14IgakFx6DbXZtBurxBd loag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iGyVesnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o19-20020a656a53000000b005577699e66esi27940522pgu.389.2023.07.05.12.30.26; Wed, 05 Jul 2023 12:30:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iGyVesnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234057AbjGETJ4 (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234238AbjGETIj (ORCPT ); Wed, 5 Jul 2023 15:08:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A28E3A9A; Wed, 5 Jul 2023 12:05:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 328E1616E4; Wed, 5 Jul 2023 19:05:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4BEFC433C9; Wed, 5 Jul 2023 19:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583899; bh=JAvhSQ39mq266aIrwqMbso8j9j8kS0A2nuJOE+YNoPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGyVesnYPolO+I26oFXGQS0HFfyLSnyKHr0IztOkcR37+k04gEYGhfLV5iXWbRzUb EObq2VlxILLQJwNu6v40Vw44mKIR/hEv7r12FxATyp+fCsjMdDpE0sJFCVA4/Uc8jR pN57YUcYfoRHHDZhRKvJLBjhf0JfE3TzTVXVb4mkufQmeoj4i9Oc3f7BwJrVnxwcbY PK6IV5XHVTCd/DXK6HdeyC4G7JL6Q7TCWgCtpA3Snu0BM4ejCHtnfKglypX1Fq6CNy 54j3+ODltMqFWVJ/dby/A8lzOQWxNhnRprW4AI4HYD/2TaeQq3/oK5h+aXHpt0gCmT 3N3286UmPeCAg== From: Jeff Layton To: Christian Brauner , Bob Copeland Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-karma-devel@lists.sourceforge.net Subject: [PATCH v2 63/92] omfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:28 -0400 Message-ID: <20230705190309.579783-61-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610167911305194?= X-GMAIL-MSGID: =?utf-8?q?1770610167911305194?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Bob Copeland Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/omfs/dir.c | 4 ++-- fs/omfs/inode.c | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index 82cf7e9a665f..6bda275826d6 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c @@ -143,7 +143,7 @@ static int omfs_add_link(struct dentry *dentry, struct inode *inode) mark_buffer_dirty(bh); brelse(bh); - dir->i_ctime = current_time(dir); + inode_set_ctime_current(dir); /* mark affected inodes dirty to rebuild checksums */ mark_inode_dirty(dir); @@ -399,7 +399,7 @@ static int omfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (err) goto out; - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); mark_inode_dirty(old_inode); out: return err; diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index c4c79e07efc7..2f8c1882f45c 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -51,7 +51,7 @@ struct inode *omfs_new_inode(struct inode *dir, umode_t mode) inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); inode->i_mapping->a_ops = &omfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_op = &omfs_dir_inops; @@ -134,8 +134,8 @@ static int __omfs_write_inode(struct inode *inode, int wait) oi->i_head.h_magic = OMFS_IMAGIC; oi->i_size = cpu_to_be64(inode->i_size); - ctime = inode->i_ctime.tv_sec * 1000LL + - ((inode->i_ctime.tv_nsec + 999)/1000); + ctime = inode_get_ctime(inode).tv_sec * 1000LL + + ((inode_get_ctime(inode).tv_nsec + 999)/1000); oi->i_ctime = cpu_to_be64(ctime); omfs_update_checksums(oi); @@ -232,10 +232,9 @@ struct inode *omfs_iget(struct super_block *sb, ino_t ino) inode->i_atime.tv_sec = ctime; inode->i_mtime.tv_sec = ctime; - inode->i_ctime.tv_sec = ctime; + inode_set_ctime(inode, ctime, nsecs); inode->i_atime.tv_nsec = nsecs; inode->i_mtime.tv_nsec = nsecs; - inode->i_ctime.tv_nsec = nsecs; inode->i_mapping->a_ops = &omfs_aops; From patchwork Wed Jul 5 19:01: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: 116400 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2098363vqx; Wed, 5 Jul 2023 12:46:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlF7Ot7Va0YtY3/peWtB7rFNVCYKeB0cgkclLuPC/xvFc9wdINX5q4WIkyDWLBwROnnyfzeO X-Received: by 2002:a17:90a:306:b0:261:688:fd91 with SMTP id 6-20020a17090a030600b002610688fd91mr13913936pje.8.1688586399987; Wed, 05 Jul 2023 12:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586399; cv=none; d=google.com; s=arc-20160816; b=lhyk/iMph4S3eC1luNRlIIz01vrPLovPYiUYoJCBx2eNv1KJqzCPJNvDe3+gs4bgty Fpy3G68Kn7eIz7seJjvcTxXuhsvEbBTjWZ9PLAV5JUe/8KWowhj6c/clVmolbNwHATqL gxBCZTrSEBxdMRE6TfkBr/SrAWZEDlNjJGDOtuFMzVAewBWGgbgR0Ukiyi42r1xmh0dG Q/pgRqx3fyfeYjDT0ZLt9HqB9Q0TEQ/+Tfbk0nBKKfQeDQAQZ16A7b78/+WBjQ0iWo/b xu6T1Jr9QSNzeKetx8MftgQ0mC+JiBMOKxUJuGFSr1BpjQRJ2wzJW0K5SbgO2UBjvH5+ ffDA== 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=pnP3weW+AQTmxFQGmIy4AD7/tkEBpclvdLOoQ2Z9rKw=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=pUMBPKhhI3JJ7cBzIgqJI5NVcIfJJEgVx7rJtIssl7gAItnDTjRDOeWDQok55jz7mC NFwPY+oD7vOb1jIBm+yrKb74jaLKubrvpt8GVySWTwV1LIlB1XiiyEMytbXDoSpqKtUD zqZw/stAGF3WmtzcNOcGsFC0yIsh7FDI/oo8jUyGqded+eKr+YrKNzxsDhJoPSmxK5wT gJyQDIB7LA3NZXCQ+gatjYqGfZ16HNx1C6IteousTOWhiXUmtt3xsMbfkHj2G6Aa2hRw mVU/WFnUuhHJ0fdxZkIggn8XLN3KQrcYHWMp3ZdYfdzxvZ2BSsedcNtqP53c4MZHuc1v pQyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mG3H3PEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902c40f00b001aff514a8f0si26020673plk.534.2023.07.05.12.46.25; Wed, 05 Jul 2023 12:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mG3H3PEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233940AbjGETKb (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233807AbjGETIn (ORCPT ); Wed, 5 Jul 2023 15:08:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B0B71BC2; Wed, 5 Jul 2023 12:05:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78E46616F5; Wed, 5 Jul 2023 19:05:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58D04C433C8; Wed, 5 Jul 2023 19:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583900; bh=D4PXifJos2kbOsXU6nvjdH1kYQlJwGcy8WjsipEzEik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mG3H3PEc9ZmdfSzPaWslswErvXr3CZmQQt1nL55o1yEsKIg/75QDN/TCflGiSJ3yP YQcG27mucubVIt/jUjX1Bc2cQnsjAV0mzeNzPjnwR4M8T+iq9Cw3Gn3pFUB5xthBjn N9dn1euzTJvXsTzhVo1w3B6xzqmfsoXbVZxvePl36H3HUZhSPagbmV4nRaBlxepKzK 8MCE6pZxqiaUVzWS79/ra6Sn1uwLMxktV3gRNZ5F8IEZx34B5G2+4yR+cTwz08v6Md qJzgyxUb0mVNwj7tzllPbyR/QHqsjYTPECc314uITdBB4jkabli2dima6qJeLLFBG8 W/zvi6zKCYYtA== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 64/92] openpromfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:29 -0400 Message-ID: <20230705190309.579783-62-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611173193916563?= X-GMAIL-MSGID: =?utf-8?q?1770611173193916563?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/openpromfs/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index f0b7f4d51a17..b2457cb97fa0 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -237,7 +237,7 @@ static struct dentry *openpromfs_lookup(struct inode *dir, struct dentry *dentry if (IS_ERR(inode)) return ERR_CAST(inode); if (inode->i_state & I_NEW) { - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); ent_oi = OP_I(inode); ent_oi->type = ent_type; ent_oi->u = ent_data; @@ -387,8 +387,7 @@ static int openprom_fill_super(struct super_block *s, struct fs_context *fc) goto out_no_root; } - root_inode->i_mtime = root_inode->i_atime = - root_inode->i_ctime = current_time(root_inode); + root_inode->i_mtime = root_inode->i_atime = inode_set_ctime_current(root_inode); root_inode->i_op = &openprom_inode_operations; root_inode->i_fop = &openprom_operations; root_inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO; From patchwork Wed Jul 5 19:01:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096731vqx; Wed, 5 Jul 2023 12:43:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWHbV6ZMooy8Sir5srcCRpcHsB0psGfCrrQkDzCttmz96bl7U2a4O0tHmDfrQeM7zPeXp+ X-Received: by 2002:a05:6a00:1956:b0:66a:2ff1:dee2 with SMTP id s22-20020a056a00195600b0066a2ff1dee2mr17315388pfk.10.1688586193628; Wed, 05 Jul 2023 12:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586193; cv=none; d=google.com; s=arc-20160816; b=MYivp28t+PwQRoFLK4fCkE4LBybAXs8Nncf04XUY/KagKEZzRxEUDyINEuGsiZypsv 5oV2mbEinM0MD5BxW7KjJowMvETduuT27TfQ0G2QaIcE2AjrOXqQg95khor+fG71FYdB pbMAo7qr3QJ/t24aKKKjRBQ/srAvjn54Lan5bVdLVLysYqArhRp4mrC8M8gX4IiFSC9m ReU+c4FGs4DTd8rPRujpUzOyO0KFkVWvWksqEjn3TlH4h96M2IieBKrbhncsoWn/s0nb BJHiq5vvNez046ETFvPhK5D+mYyRNHKUWwPuY9LYGJWXuotmw8wzqXlxw1pPJDMKrFiP bXjA== 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=RlLV1/lET3UUmw9wE0tKks2iO9dmVwg2C95RZTzkbE4=; fh=2C0TnyphuD/FB0GCymdU5zOxLE78QBj/MRL83eaVYV0=; b=Y4KcYV/BZjOxNvKOn5IUM+lyPrrtQ9cKkHBuNHPHh4/KMnIzoWNDYXzgJe7j4xMM90 /FrXt4JekpW+wc2Pj5/BrjlFQeY9ZkFl7dCKyy2QgakvDomN6rFstwmU3EeD/YpKSNPi 1U2Fd1qEGoRhDpaXml2GfORQ18lQ2P5XpzoMwSp3tRQiO/MzbwMUnkVDFAVWhPc76Rm9 rn4WsJZCGM54rl29GJLRhDztUcYE4JVxuxMO1n9UifhrG0lWFDi7WB/t0SQvduI/OE2K a/CicZCrJ3n32XAKw9hDnxFKdvN2gjfLvE6qPH8BFUzECJsGKYNr5tmVniAqQkSjQQuQ YVWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FsRHi7/X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ff25-20020a056a002f5900b006826f3512fbsi10278462pfb.253.2023.07.05.12.42.59; Wed, 05 Jul 2023 12:43:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FsRHi7/X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234201AbjGETMZ (ORCPT + 99 others); Wed, 5 Jul 2023 15:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbjGETMB (ORCPT ); Wed, 5 Jul 2023 15:12:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAFB94693; Wed, 5 Jul 2023 12:06:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 26CAB616F6; Wed, 5 Jul 2023 19:05:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5E96C433C9; Wed, 5 Jul 2023 19:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583902; bh=4L4f2j1dXwzf+7ROukpRWmIKlAPq9hAU4+j8l9mv3ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FsRHi7/XSrEQ04l3pTxAs6fvpw/dr0VlD+PtIh2GXYf262SVbChPIRQx1bY2dhICw pDD9WuuxW+SQKrg1L6Q3Y1vymeUP4a3WCFCbUYENVT8jGPNUkNHEIWmctBbLx7p4s4 Lle9utlMCkzLjgeZ8iT0+Hpwqgfi3nKHBWyzaQZ1YBeJ0Ch8PHnVWG/R9aE54KSuS2 eskMgt47uhF5IU2mUVXRbwfi24bHRrZWoPKwLI4kYHMVCap3W5jUf8IgwTrMHjA2O2 8PHdA2cOrZyL9euUcT763C8APBXZ5zj69AGX5ZkK5WpotGIpoMh6lRLeLb6uQ3iHWV E3qP4H2pFzomA== From: Jeff Layton To: Christian Brauner , Mike Marshall , Martin Brandenburg Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, devel@lists.orangefs.org Subject: [PATCH v2 65/92] orangefs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:30 -0400 Message-ID: <20230705190309.579783-63-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610956754197003?= X-GMAIL-MSGID: =?utf-8?q?1770610956754197003?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara Reviewed-by: Jan Kara --- fs/orangefs/namei.c | 2 +- fs/orangefs/orangefs-utils.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c index 77518e248cf7..c9dfd5c6a097 100644 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -421,7 +421,7 @@ static int orangefs_rename(struct mnt_idmap *idmap, ret); if (new_dentry->d_inode) - new_dentry->d_inode->i_ctime = current_time(new_dentry->d_inode); + inode_set_ctime_current(d_inode(new_dentry)); op_release(new_op); return ret; diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c index 46b7dcff18ac..0a9fcfdf552f 100644 --- a/fs/orangefs/orangefs-utils.c +++ b/fs/orangefs/orangefs-utils.c @@ -361,11 +361,11 @@ int orangefs_inode_getattr(struct inode *inode, int flags) downcall.resp.getattr.attributes.atime; inode->i_mtime.tv_sec = (time64_t)new_op-> downcall.resp.getattr.attributes.mtime; - inode->i_ctime.tv_sec = (time64_t)new_op-> - downcall.resp.getattr.attributes.ctime; + inode_set_ctime(inode, + (time64_t)new_op->downcall.resp.getattr.attributes.ctime, + 0); inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; /* special case: mark the root inode as sticky */ inode->i_mode = type | (is_root_handle(inode) ? S_ISVTX : 0) | From patchwork Wed Jul 5 19:01:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095819vqx; Wed, 5 Jul 2023 12:41:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6WpE5UszeVRMRAOjQ8Cf+5AsPkMfyXR63T74AbdPlDPZVj4jKLClBtXI+7INUMq+iyzCmT X-Received: by 2002:a05:6a20:9192:b0:125:88ae:977a with SMTP id v18-20020a056a20919200b0012588ae977amr14294072pzd.42.1688586071843; Wed, 05 Jul 2023 12:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586071; cv=none; d=google.com; s=arc-20160816; b=TdbTEX0iChASJAOry9IxwlAV5Ta/ZHXv7OJ6PQmUX6qYTlOCKN7Q7PMYuiqhOepF8v pSRigotBqTYq53TvS0Yc1ZfRYafM863Jq0IoUTeeR2eVd9dkW2Py0RRkOcFbjoqjywo+ OxBC/g0i8yscUqvBrGl0Uo/ziRTSXOzAu8pqjoog2hwkg+++htCiO0wgKcuiqLIkShav 8WxCQbbRS8GVcOnn7M+KDqL2Txlfc4shqC1BqQFXaJTW4COWMJxbjh6norVOo75gMQvu YFSJkC1zHTakC4Na0y9uKweVddBvQsSoltfxWvNgfYJzttZ6YxtqTNW6SPNz1ZoMQlrL qMBw== 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=3jCxLgylCCeHoykvGRVzlKxeIOxohll3KsUx9mCXrg8=; fh=4Uz9hvdvaurMOoVsWdz+aYr2+tz2uIoOtnpGwJen9pI=; b=SK5YPee/JSJFpb19Hbi4a76C5T68CPIjHabidwbHFxweycfPRgQ9If1fnppf1qSO+b r8K5sR8k6LIEEJ70BqJQGCoV8NeckkfogNoI2gvaQyNtjdYM2a2ac241QL+gUZqaEH6m Yo75weF9gdrt9YMeWF+J88qeybG5dHeI8yEH83CV4pYRIQMQ4NO88bq02rHUM08LEpVl zBuvzNV4a8rivr6STF8IgQLK0rhmCVinO7Q0drcipbg67pqTh3xqWcbo4UEHSqtGaERd TJxPJ9ehjbSbRlvLqMh5h3juUJmmGP6e7IjZ3q0wsT48lnjw9xQILRMM9BJBFQfM52PB Z3aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtD0O7vh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020aa79584000000b006825e062715si12252255pfj.228.2023.07.05.12.40.57; Wed, 05 Jul 2023 12:41:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtD0O7vh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233909AbjGETI4 (ORCPT + 99 others); Wed, 5 Jul 2023 15:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234086AbjGETIW (ORCPT ); Wed, 5 Jul 2023 15:08:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E65223591; Wed, 5 Jul 2023 12:05:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C67A361716; Wed, 5 Jul 2023 19:05:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F744C433AB; Wed, 5 Jul 2023 19:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583904; bh=ifQJh4jOsX9nRxd1w3rU+11KRMag4uZ1uNcUhaA+ULE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FtD0O7vh5P298dVoEO5SI2NfLIiPjUCyawf2QO+XuFPr5YBjUOyi1Sg79Peq9eBZe +Gmsr9dM3ouQLawjDc7DjuuOHi1O4w1wgS0uyT/4C17AEiRiXbjCMdRsx+oSH+vmhG hsHXswRP60+LI0y+XsFtVAIlB/QBNFjRnQAyM7VHY7ckT3C0zUt4NsVgKVuqmWjd32 1y7CQzIhZbX9zbJiZn4Lk+1/cBLyXdIPBn80P8m+S3keY+e9IrFsLppiLUmBLMClQA GR40UeMDOVxVQ/eW7zgfVoLlO1Uuue4w9VY4DcZwO+oohFQl1FEC65AAHuvqY2n+/d Bv5HgackTJ8eA== From: Jeff Layton To: Christian Brauner , Miklos Szeredi , Amir Goldstein Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: [PATCH v2 66/92] overlayfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:31 -0400 Message-ID: <20230705190309.579783-64-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610828761581815?= X-GMAIL-MSGID: =?utf-8?q?1770610828761581815?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Reviewed-by: Amir Goldstein Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/overlayfs/file.c | 7 +++++-- fs/overlayfs/util.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 21245b00722a..7acd3e3fe790 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -239,6 +239,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence) static void ovl_file_accessed(struct file *file) { struct inode *inode, *upperinode; + struct timespec64 ctime, uctime; if (file->f_flags & O_NOATIME) return; @@ -249,10 +250,12 @@ static void ovl_file_accessed(struct file *file) if (!upperinode) return; + ctime = inode_get_ctime(inode); + uctime = inode_get_ctime(upperinode); if ((!timespec64_equal(&inode->i_mtime, &upperinode->i_mtime) || - !timespec64_equal(&inode->i_ctime, &upperinode->i_ctime))) { + !timespec64_equal(&ctime, &uctime))) { inode->i_mtime = upperinode->i_mtime; - inode->i_ctime = upperinode->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(upperinode)); } touch_atime(&file->f_path); diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 7ef9e13c404a..c210b5d496a8 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -1202,6 +1202,6 @@ void ovl_copyattr(struct inode *inode) inode->i_mode = realinode->i_mode; inode->i_atime = realinode->i_atime; inode->i_mtime = realinode->i_mtime; - inode->i_ctime = realinode->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(realinode)); i_size_write(inode, i_size_read(realinode)); } From patchwork Wed Jul 5 19:01:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2092114vqx; Wed, 5 Jul 2023 12:33:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlF8qJKVQyTaP+Yh2utliARwklBtH4hMbKoAKqr+cmnrDQu0OCITAfx5HjFugg8tqrb5HT6z X-Received: by 2002:a17:903:191:b0:1b8:91ad:79e2 with SMTP id z17-20020a170903019100b001b891ad79e2mr13214598plg.3.1688585583909; Wed, 05 Jul 2023 12:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585583; cv=none; d=google.com; s=arc-20160816; b=DuwbEToL0NmxDzWRtK8BajRx3MLGu+I2hJDCqIf8NrnrQIBHaXzJHRj1J5R8VjmDym rse/v2GrDD8ijht9ZyMyvyCAlLNx1iJ3dIN2xcAdNlQpW5y3H+bX3Ih3gc884QHMyDTF EskWc3Egqu5QBRQqEfzg/oZlU1/jcq/p9HkXuAagstcy1yFqBOpigBv5XIdDfXxufFuc 7+473OzkEg/B9C1vuroeC6avzPFJkZKiLmLgDyDboXOywLbcpXdndsbKa5QiLYgsG5Ih oSnJTZWhTKKj4C73Oe8A8PwMENd7/Ec5QGxU6/l262U4uV6LUZj3a42+Lq2wHtMwTiIB /Pcg== 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=WAVWtjyCLwYcNpoFxhlUe3LklAPh6v2sWLI4dsC7iVA=; fh=+3548trj4kv0msiTrrWj+RjLquzDi8Jqb/hjb4C0TtU=; b=gRnvrjbplR3qtdfsPN1/Zi5rcdWZozBrbfxzGrA51aIgu5Fusfhg+WUtqjBfbicsSv CCNkEQU6wTk2hN3fsYU5xG9GVMNrO5Eqc60xwvb2+shKPi82TeviwHVFURpzSIVRzu32 WYNbxVEY/G2bjnCSTBFCaV429n77iviPt2eCRXjMHBIEKQStNbcFZWPPfOcugE/78UQl EvE/UjK/1308kgLlJZezsZiF/gZUaK+sC1Bg8RVNUrzJRtfIvAYB+MGbYKg0BKsR+D96 iAkg5+WYFO2fcO6XRsMVaIeygbJ1ecJKi2IDBOCfDXOQ6rqr/00AA6O5nIpRDH+iNsGr L4cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QllW1hYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b001b3f9cedbb7si21935161plr.398.2023.07.05.12.32.48; Wed, 05 Jul 2023 12:33:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QllW1hYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234143AbjGETMn (ORCPT + 99 others); Wed, 5 Jul 2023 15:12:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234084AbjGETMR (ORCPT ); Wed, 5 Jul 2023 15:12:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B49CB271B; Wed, 5 Jul 2023 12:06:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBA57616F7; Wed, 5 Jul 2023 19:05:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98D41C433C9; Wed, 5 Jul 2023 19:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583906; bh=0YXPvqkA7pZ7Hzh4yB98RxsCcouNOmeqexbNKJzEBzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QllW1hYTAbHIl9ublRCbW0vxvBvNN2KypraBhcy/oOx7ppvm+ma0XkRCYxTUR2lDI Jae1zUdX6DjUURhqCEahjeaJG214uDlTD39GTkBVOj9npRUa516fR3ZOHtM4FQmE52 nYvXt2QdF+XPn6EV8XIEwRD2HoIjQVsR6QQlG6txMDB4Gg9pkCZA4VPaYMj2hAI5J/ YgSQA9RrR7EOFsGgPpR0LcwTQoHL9IEFaexI8B6WxLyrNSbGFRAMKKen5mecPbPjbt qy8/w03354XAXncceJTHv2A7gcXDnAR1FOBprGdJc/e3VPtWJ/R+EzccggBfBq3t3j MVbj27rNEuWYg== From: Jeff Layton To: Christian Brauner , Luis Chamberlain , Kees Cook , Iurii Zaikin Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 67/92] procfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:32 -0400 Message-ID: <20230705190309.579783-65-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610317071115884?= X-GMAIL-MSGID: =?utf-8?q?1770610317071115884?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Luis Chamberlain Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/proc/base.c | 2 +- fs/proc/inode.c | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/proc/self.c | 2 +- fs/proc/thread_self.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index eb2e498e3b8d..bbc998fd2a2f 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1902,7 +1902,7 @@ struct inode *proc_pid_make_inode(struct super_block *sb, ei = PROC_I(inode); inode->i_mode = mode; inode->i_ino = get_next_ino(); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_op = &proc_def_inode_operations; /* diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 67b09a1d9433..532dc9d240f7 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -660,7 +660,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) inode->i_private = de->data; inode->i_ino = de->low_ino; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); PROC_I(inode)->pde = de; if (is_empty_pde(de)) { make_empty_dir_inode(inode); diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 5ea42653126e..6bc10e7e0ff7 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -463,7 +463,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, head->count++; spin_unlock(&sysctl_lock); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_mode = table->mode; if (!S_ISDIR(table->mode)) { inode->i_mode |= S_IFREG; diff --git a/fs/proc/self.c b/fs/proc/self.c index 72cd69bcaf4a..ecc4da8d265e 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c @@ -46,7 +46,7 @@ int proc_setup_self(struct super_block *s) struct inode *inode = new_inode(s); if (inode) { inode->i_ino = self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index a553273fbd41..63ac1f93289f 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c @@ -46,7 +46,7 @@ int proc_setup_thread_self(struct super_block *s) struct inode *inode = new_inode(s); if (inode) { inode->i_ino = thread_self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; From patchwork Wed Jul 5 19:01:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116320 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090081vqx; Wed, 5 Jul 2023 12:29:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlEH0uRF0amIASziB0pSMdLdqi2IRJ2Cujaj5Z/eqcpfml2A+pw6nDCVmy+SNrgUkMo1GiKl X-Received: by 2002:a17:902:f68c:b0:1b6:6dc8:edeb with SMTP id l12-20020a170902f68c00b001b66dc8edebmr4105360plg.21.1688585353092; Wed, 05 Jul 2023 12:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585353; cv=none; d=google.com; s=arc-20160816; b=OosJpld4tBlZBceTQC9lpP1C+p3nWlx5nKOpQF81iDwmSQULtmUgIL47U17CGDcHiH WdciE82BTDSzE17X1Pg6yMcv3XZI/et8xmKUFSWjX1xwfz7oBX+0SkuCRPcB7QmF7PTX yFyJZtCS/ZG7/lzg4f7ef4hsfpaSmDhQB9y74IESMOSPWJpJfUiN6zUc59udbkFsMyXN qEA76vOl9i/bFGjI4yolf0ippMNv/BLPPxXH09AEp/+QqDh1ym3CuKIHrIYm5Z8Amchk ri5JTiZjc6oHShUqB/hptLEo317MGWkEQOyeHe0HpVACAmLirU6glbWA5VkA3vgmU7q2 eCpw== 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=9xnpBYK8gnvOg77qs+pTroO6/z2FVnLqCpdsxGsf3/s=; fh=ZuumiHFfZlExHjf2cFrDFKYQlTfDJg4eO/eb/kH/J6k=; b=ggEb1oeFcGvJfwrgYdFIQiKLmetZ0YdhgJ9t1ublMv0vzUs9sQ8EnVBvbx4MtVcj9I 6PnZKuC97Lobs1acvmycTVVygWO2ECnGMLkqcV/GO+TOGacEhDYBAsk8SyaJDUEErqfn AoEw4ioG6NA/eacCfQCsTEcz2jk8ESEaMzKLY8C9tXEhxTYfWy41wSo3DEHTR+tROsXr 7dFfTWsdPGKr5z3B7WhfkfJ7kILZZ+5P2TCmXicacp/E4aqoWQpi/zRnyIrJDfTxhPjr nXKFb3tQGMr0KtX0p4HXbxc8vrFf6Z5DBgd7u4no8NYD97+PdMBhMUomFL1qhFbrHiQR F99Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DjirD9pZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020a170902ec8100b001b8142bfb5csi9564977plg.296.2023.07.05.12.28.57; Wed, 05 Jul 2023 12:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DjirD9pZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234010AbjGETJ3 (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234105AbjGETIY (ORCPT ); Wed, 5 Jul 2023 15:08:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B47A935A0; Wed, 5 Jul 2023 12:05:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 94F0161702; Wed, 5 Jul 2023 19:05:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25BBCC433C7; Wed, 5 Jul 2023 19:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583908; bh=9tqjc1yQ4vJk7vw2pYwnEX82rP1AT/1qIv5Ev61P7H8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DjirD9pZlAnf1MI0AwOEUGXxPB0fcITLGV4nmQ929feHDnPUkOH/kDgNJBUdHftmv 2WpIxPwzVF5fIyhxk+aTvKI6So+bTsbZMc4OBHHW4Fz4hc/xSM98X2iiENI22a1pTX esNxnQVRQO4GtTncPFG3G1ZYqxAcDwmh9I2FRpVyTB7FPENCVuYK3qAFzjDIRkTd6T If1+QyzOVOHdBaH+a2N7SYJsaxKxEk3ZHJV2WtkQ8A1lPahlPJ90aUo1XYo+dtPqhq o9qRs2BVkBLGleaCDLdsbCDldbvf8s4yeC4BSiby5ZqLbryjk6BCtymbojm3PYU3tv 822o5CifLJM5w== From: Jeff Layton To: Christian Brauner , Kees Cook , Tony Luck , "Guilherme G. Piccoli" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH v2 68/92] pstore: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:33 -0400 Message-ID: <20230705190309.579783-66-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610075027056234?= X-GMAIL-MSGID: =?utf-8?q?1770610075027056234?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Kees Cook Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/pstore/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index ffbadb8b3032..a756af980d0c 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -223,7 +223,7 @@ static struct inode *pstore_get_inode(struct super_block *sb) struct inode *inode = new_inode(sb); if (inode) { inode->i_ino = get_next_ino(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } return inode; } @@ -390,7 +390,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) inode->i_private = private; if (record->time.tv_sec) - inode->i_mtime = inode->i_ctime = record->time; + inode->i_mtime = inode_set_ctime_to_ts(inode, record->time); d_add(dentry, inode); From patchwork Wed Jul 5 19:01:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116336 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2093024vqx; Wed, 5 Jul 2023 12:35:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5oVh8PMoCCvyOkfNZJxRHN+zJq6Ro7zS99aiv4UJseJalhRZxRfb283GrNJdlcgLXKxQzv X-Received: by 2002:a05:6a20:1613:b0:10b:8698:2097 with SMTP id l19-20020a056a20161300b0010b86982097mr17582885pzj.0.1688585699851; Wed, 05 Jul 2023 12:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585699; cv=none; d=google.com; s=arc-20160816; b=ULXITIQX/SRM3LDsTtgiRFgRBl6C5X+NRTZsertRi+Aa4Dlx7BpuJBuK3m+6KYPCNA 8z0mcTuM76Gx8z+uhHFjcBnv7NE5kCKA1o89PQJe+m9PRaIOWB6gVPtYVcW1GzyeE0JT 0UC6SndpZz/Naal8rFHQK3uyV9fGzw48kTf3cw8POxncTdGXbJQXUSE8/R3jVCA+XpXW C2b/FhwK5BSVgxKIgwWTm07k1EeHlTig0NwtNSgpBv1RVnZtg7BZWeBvc9pZUnllSdad 7YP2MiMA9Yn7tbvRFeUMl10r786pv+5PJJxz95oiVhljtka0bbs0IJ/3wDREDMwlw+Gl 0rJg== 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=Q3Hjx2U9M6MQYpULcOMNEvcMPf/DL1x9XK9UcpkLInk=; fh=bfbYXdDCv4z55I4uSe8/b82Gpa+0jD3BhVcxRChxF/s=; b=Bqcav39fUzvvBOrHFRyKPCxrsc4sw1pzFdb4GNi6UNv1M6LgFOkfaEQKDLopFCg8wL o83nzZQX3BIpQm/NIKAEmW7eH5tLAspe35NLo9xLT08ZIZ2+wVRLszU3jOZpA/ZnuQSB P/5tiKvxuAktT1JMZKWSpEwNFEbIwTWGa0CZNc/zpolnvEPy66bj17mRsOvhE7mCaybJ fHYnqf6xeIqxLGzU4yH22JolngAu/XJ9pCz0vANL3GoCt7pBqwYMWwV3cNctbhXwmrmX MXrsTR5rGWaxND2aattz13rwLBDQ01AKGVf3evBP+IavXC/I7/lEPGMd8r8bjb3yirC3 9EYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6WF5VO2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a63dc0b000000b005573a9229f0si24463834pgg.841.2023.07.05.12.34.47; Wed, 05 Jul 2023 12:34:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6WF5VO2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234175AbjGETLM (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234087AbjGETK0 (ORCPT ); Wed, 5 Jul 2023 15:10:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173A13C33; Wed, 5 Jul 2023 12:05:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DEAAF616F4; Wed, 5 Jul 2023 19:05:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4BF4C433C9; Wed, 5 Jul 2023 19:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583909; bh=DuTLhiLcWxa1Ea4hA0KeA7+NSKJEpmgvrsdDl0+Eiao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f6WF5VO2UF1eGXE4/XrP7NsTG5Xmz9ani0JItW5QC9PI1f6Gq+tWs88umqGvxtU1S mxAJz8ikSfaBY6nWlbPNwzFZba5npf6zlYdreW46SoOyDAqgfs1dfQeBQQu69QqwmK aToj8zIUTvW12z2rIQYeUVl3qcspYYgD859sIUKPbM2gLq2fk4ACehMIMRlMk0JgLx iWaTWDpabaBO+kCT42GzjKYhdq2SCezWszRVQJHXP9FAiEDEADJNuAFPeOprsDoo4b 0BwZvVtXHmIcqfYF3T8xwwb4DHv/jNgNd8epq/wDMxmaYDViAg+rR3cYziWRT3+0c0 oxeA0uY8lRDrg== From: Jeff Layton To: Christian Brauner , Anders Larsen Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 69/92] qnx4: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:34 -0400 Message-ID: <20230705190309.579783-67-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610438582593496?= X-GMAIL-MSGID: =?utf-8?q?1770610438582593496?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Anders Larsen Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/qnx4/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 391ea402920d..a7171f5532a1 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -305,8 +305,7 @@ struct inode *qnx4_iget(struct super_block *sb, unsigned long ino) inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_sec = le32_to_cpu(raw_inode->di_atime); inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_sec = le32_to_cpu(raw_inode->di_ctime); - inode->i_ctime.tv_nsec = 0; + inode_set_ctime(inode, le32_to_cpu(raw_inode->di_ctime), 0); inode->i_blocks = le32_to_cpu(raw_inode->di_first_xtnt.xtnt_size); memcpy(qnx4_inode, raw_inode, QNX4_DIR_ENTRY_SIZE); From patchwork Wed Jul 5 19:01:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116383 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097621vqx; Wed, 5 Jul 2023 12:45:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlHvpidTRd81qngON1C6E/ZRN7lRtlHcCbwxQKLz7YDWR+HR8k4qkHYr2y13Dlmu9+h/BYTV X-Received: by 2002:a05:6a20:728c:b0:12f:c61e:7cb7 with SMTP id o12-20020a056a20728c00b0012fc61e7cb7mr2276545pzk.51.1688586312648; Wed, 05 Jul 2023 12:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586312; cv=none; d=google.com; s=arc-20160816; b=SKKmwu7NS7KvBR6iMHC6x1ut5Oc5q1SC2ABVY8cRjuRdgM0/pavLvHDuC+o2QbLj0B 3u6iByNW+dBjMIPyPPpWwE2iEQT4pJddapk+weWZNITbQlhKW7T4kLa8tmwVp5+WOzCr zdOyZuRQxjQRyOyIDkQFYs9tIzcnthGJRRgrIIEJR0LzuoWQKPnkXFkpjfxXOXVicjtj F0NByYyP1QilROUVBqKB66kqwmBGTR262FifEgpfvuumeukCBiwePjvf30xqkk7wgDIJ 2+4nfQglpdAViKKouQbEy5a+rmCS1k6CZkiW1pudbvXf0ByvzkQX0DC+OxuKjn9FCyaP hzVg== 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=Pl3PUhAifwSz+d49eXUwNNX3Ilfpii1vB04LYryz79s=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=WxZ5R10z1t9GjaOor4oB49NHX/Nv6E71O6OqykNDKMXWBm7jEZ6JbaIN5v/SNJh2zI +X3j3nwDncwmM2dKkI0DiX1cxKOHSHgB/mvW6Hm1Z/ZcHCz9xK9h7N5weVwJWMvNEKi7 aQMdhUTDFpvXBXpKS0+Hr3RyR//LWR7MQbqGN9kRms7ZfJhYZmVj4RB2LGZiLvQDR4rC ixMJTuzVsNxwnOv6zQRThYFqHTUWnV707mePSCJ8t8TiNiKQ2BdcVwsrn4FtMt3LSyQ5 5Z5M/CFokIki2gtFQu2cZ/A3QQrsKxhsld3ohyP3bGwL/ZonBKmuJRsS+vhw2W2hshsO VkWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rvia3rWY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902c40f00b001b20e2ba8e1si5823852plk.23.2023.07.05.12.44.58; Wed, 05 Jul 2023 12:45:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rvia3rWY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234185AbjGETLT (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233947AbjGETKe (ORCPT ); Wed, 5 Jul 2023 15:10:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C753420F; Wed, 5 Jul 2023 12:05:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30AFD616EF; Wed, 5 Jul 2023 19:05:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1288EC433C8; Wed, 5 Jul 2023 19:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583910; bh=eJBrCYXPAM78Uhl6doLO7xB75I+7r+A66Ah7b9xHMkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rvia3rWYl7fjY2XB0bH6AfSyk9CRVvizR7DUFO3QDfVB/OELev3kS+UySXuyCgOKm 9gjB+dQmRDKiUeiJ0HcCW5f1oITEauThib3xM1Jz6sVwKsFMtFBhB8Rq6hol0TbwdN QDJs4JZ8KV63yHxPOkk/MoH/jSjMOyPBMNRL3NkFv0Mml+1m+LNmiO52vWsxvU9IWi k3C5wmpuXIv1ZCzD5o5wKp/LMPRg6WDoro+yRg+m7hRcuX0Tm2anPLAIjaV0fBpe/q Wo6375tZJWxdReteCm315iI1jc21ldIJy/1V8TqSSQkehb72s8gfEknPTxbqYQUe0s vdDjswIWNAjrQ== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 70/92] qnx6: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:35 -0400 Message-ID: <20230705190309.579783-68-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611081408484459?= X-GMAIL-MSGID: =?utf-8?q?1770611081408484459?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/qnx6/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index 85b2fa3b211c..21f90d519f1a 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c @@ -562,8 +562,7 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino) inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_atime); inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_ctime); - inode->i_ctime.tv_nsec = 0; + inode_set_ctime(inode, fs32_to_cpu(sbi, raw_inode->di_ctime), 0); /* calc blocks based on 512 byte blocksize */ inode->i_blocks = (inode->i_size + 511) >> 9; From patchwork Wed Jul 5 19:01:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096898vqx; Wed, 5 Jul 2023 12:43:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlGYhRky5WqIAqYTT8yfO3BmXHl0HkAmDY8TaQKAH6HVq1n5tvPq2M8DIRlliu/BZ7JRaYuk X-Received: by 2002:a17:90b:3e85:b0:263:fd88:24bb with SMTP id rj5-20020a17090b3e8500b00263fd8824bbmr1101037pjb.40.1688586221106; Wed, 05 Jul 2023 12:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586221; cv=none; d=google.com; s=arc-20160816; b=ajtp83gAUO9FworaotKPlI+RPp1PGfSNWBL4hd+eBmkd3OGv+oy0SQuGBLObbYAAwm oq0t8WASH3FCYSJwSmCtJ4I5npNEy0IuzsFKjTKN83TAJl+IAhERII+tGUCDIMP4i6eS J4LY8a3AFpXone5vdNkXv5XbjqMhU7xtOQJrulOzLXdo0hxJ2jgbBgRIAXxhQAtsy9H7 mrUATb3wmRBgZnca71LJSiocjD/pFtvfKEMJwqMQnJbHKdSr8Ra1mACnNOKrm+rmiTMJ SMnFplImFpxiq57oDRqwHlbVIbyVRELafZbDEcZHBDVoBDXwR41Gkg/lMkw9VEyJexwP 2AMQ== 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=1QcN5wRw9UwkW94uuHj2a96mgzfBdo9N2i9qLizlxPg=; fh=ZKIZmqHNxXa6SZ/eWQ/qAkY0/5vHxngAhFaZDUngMSo=; b=lrQ5sCb1RbbT1Ip68NflEAeM9k1jB0yYMSHvgUvj1xDw0H9fUeqGRq7mKdxTKFZeH5 uErJ9yY+pRWPr7SJzIm6bmgIBONn9uG467T5Bio512uik7hHDaRiWc6utWIB5Tf5oF2x /Nu56A0CXEXAK6QbDzdy45wqraWXNjLcwY9MC1KEbtKf46y1IrgTURSOcGq5rd+DNAEq uUBRa2Y8u3G1FiCoR1b7Z8eFY8lXd6p5g3/V7w9dvsuIXmuBKKIAXAVXa3yFG+tvplBh dR/LKDaZdKBN2rFr7CoX3MHP3C30OQfB3JsTaE68dJcifFRSLJFpAYX1MftDQE+neC9b JI5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CTwy+iQw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fz20-20020a17090b025400b00263ba5d7088si2205793pjb.48.2023.07.05.12.43.25; Wed, 05 Jul 2023 12:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CTwy+iQw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233971AbjGETJL (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234129AbjGETI0 (ORCPT ); Wed, 5 Jul 2023 15:08:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F28735AD; Wed, 5 Jul 2023 12:05:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7012D6171C; Wed, 5 Jul 2023 19:05:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56A1FC433C8; Wed, 5 Jul 2023 19:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583911; bh=qsxxMPleHFd6x6U4R0KWNNZQhuduOrWIl5HygaPVEtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CTwy+iQw453Xf5IWZcFxXpMjMeR+Lwc3Uo7IoFH4CYQYjUOkXg9KtOul0MlwgaZI5 pf7T5nolArwiZFkOVj9mZ6YVhQSysfvPqZalQKpD7AsYa1Fxub3Yna3/QLT6uIXVaz fy/mH7prd8fK6mmyCQRkR7IVBr+qdUkH4w6HTOCG9XzgKCIv9KiFe5H0F1ZNp+nLZv riM+PeCgqlpDBazEhrOP8++uBvi5YSzNNqmiRtzWkitdbnMtB2dVhXuA+VnrPwzNvK 20fac+OEf7df/k4Av1fDFj9JlpG2m06LSGouqqkXzoc0Xd4wnv6ywIKlFmaHMUHE2f amM7rAuIYrx8Q== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 71/92] ramfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:36 -0400 Message-ID: <20230705190309.579783-69-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610985714721413?= X-GMAIL-MSGID: =?utf-8?q?1770610985714721413?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ramfs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index fef477c78107..18e8387cab41 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -65,7 +65,7 @@ struct inode *ramfs_get_inode(struct super_block *sb, inode->i_mapping->a_ops = &ram_aops; mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); mapping_set_unevictable(inode->i_mapping); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); switch (mode & S_IFMT) { default: init_special_inode(inode, mode, dev); @@ -105,7 +105,7 @@ ramfs_mknod(struct mnt_idmap *idmap, struct inode *dir, d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ error = 0; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); } return error; } @@ -138,7 +138,7 @@ static int ramfs_symlink(struct mnt_idmap *idmap, struct inode *dir, if (!error) { d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); } else iput(inode); } From patchwork Wed Jul 5 19:01:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116401 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2098446vqx; Wed, 5 Jul 2023 12:46:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlHVMubnSldLNpP2G40QKs2BoSZZNwB1U+sg0G+P3PonpiZsKgf1Xt72F1XYPPm6V6e4hVaD X-Received: by 2002:a17:90a:51:b0:262:cef9:84f6 with SMTP id 17-20020a17090a005100b00262cef984f6mr16318253pjb.22.1688586408856; Wed, 05 Jul 2023 12:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586408; cv=none; d=google.com; s=arc-20160816; b=GuXJfEEp0m5kL2ad8Gje13xVJO/Fge/WJA1W7BdRWVfY3kPyLdyg86r3IYr6rGv0p5 OrswiITZELrG6Tlkxubn74LDIArzPAPgx2pjeiih7wiVr6fdb7SqmOD10EptaQxm3Lnl tn2rTG+g8KgoG8F9U5DrZ9ez3n42R1izMhqSUjnYMwQ9SSPTIs3+oGObWsm6i1A3fb0/ qeXvtFCpLJpaUHJ2ADAMz0hKqSVYB7VFZUWj5ngSCEg3BE2BclVCTwvHdvUVFMqOhg5b 4PPXYknIq4X2d8JzSSEAxTQgR/M0Gjhod/sWOwCAs5aw1663eL8aHdXfKDe0RvjxOn+3 zRHg== 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=OWXexZfrotCMlr3xW893R4S99PRR2Z/eqklae/BDK5I=; fh=U0hxqKIAQeXgGcFP5f7HwzvBhBLmDRANk+tmAo1lHE4=; b=vOdMpl/lNIEFP5e812lfGOwfIb3Vxa3vuBGFK9bRiPgoXpcbiiFVGKg/V31Obq9i7d 1mw162up04nvbk/a3wO1Cqsx+G/OZY0lFmz8JDXI9eKZ6gBfkEgScW1A54Xm5JcRNW5L Vp82p1DzpI1Fr5trOD4DjIf6m8lZSMdkXpqWTjqA8NuaO4GVvFIGqytPPmRd60YstoUi sdQ3YmQY8LSTlTr5UkUFpvA1AvGBIAR2PI9GU6bLphcoyKdJeCXUFF0GYE3xKhZ+2rn7 EbH7JL1x7GZu4rhPN8lTA6j/7LWZ+7udBZvF1yG1t+8T6ogqm0X4INYVPc7tSqKzLUvI rkHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DepHFp8A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt7-20020a17090af2c700b00263cdc45e8bsi2291371pjb.87.2023.07.05.12.46.34; Wed, 05 Jul 2023 12:46:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DepHFp8A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbjGETJh (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234136AbjGETI1 (ORCPT ); Wed, 5 Jul 2023 15:08:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2CB335B3; Wed, 5 Jul 2023 12:05:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C35CB616FD; Wed, 5 Jul 2023 19:05:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96431C433C8; Wed, 5 Jul 2023 19:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583914; bh=VDsHkKotGHF3rbDJV684a/iwEaoS4qQlMTVEzxa0ezs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DepHFp8A8vg0TRpOOrMGMOV8hm44msFe5IlcCTRq1gSum6eu4OmruzNXY5RXJkgLl looBizoIhLiJLQdNZMrR+v75b+2QepWsGjg1Q5K8ox4l686bIZvLBJLC12fjiMkNpU BtSFh15yBnuyirgXBN7aMu1PfKgKNcwG2BgULoNpKxNvLkU0NsaTL7LVGwqDV7DJQP uA743xMrxTt0EkSUgWHYacvxpwKvooiz6R0B0U4KEQUpXlHEw0X/yTnZHk1im9Apv5 5Gn30irCk5gPjGk1BN3CA92mDntY0AT4YDtfwdA1GOPwxAlNp3rpyji3JED+d5vtQ6 nGwQvIA/hvkew== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, reiserfs-devel@vger.kernel.org Subject: [PATCH v2 72/92] reiserfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:37 -0400 Message-ID: <20230705190309.579783-70-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611181968651045?= X-GMAIL-MSGID: =?utf-8?q?1770611181968651045?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/reiserfs/inode.c | 12 +++++------- fs/reiserfs/ioctl.c | 4 ++-- fs/reiserfs/namei.c | 11 ++++++----- fs/reiserfs/stree.c | 4 ++-- fs/reiserfs/super.c | 2 +- fs/reiserfs/xattr.c | 5 +++-- fs/reiserfs/xattr_acl.c | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 77bd3b27059f..86e55d4bb10d 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -1259,9 +1259,8 @@ static void init_inode(struct inode *inode, struct treepath *path) inode->i_size = sd_v1_size(sd); inode->i_atime.tv_sec = sd_v1_atime(sd); inode->i_mtime.tv_sec = sd_v1_mtime(sd); - inode->i_ctime.tv_sec = sd_v1_ctime(sd); + inode_set_ctime(inode, sd_v1_ctime(sd), 0); inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; inode->i_blocks = sd_v1_blocks(sd); @@ -1314,8 +1313,7 @@ static void init_inode(struct inode *inode, struct treepath *path) i_gid_write(inode, sd_v2_gid(sd)); inode->i_mtime.tv_sec = sd_v2_mtime(sd); inode->i_atime.tv_sec = sd_v2_atime(sd); - inode->i_ctime.tv_sec = sd_v2_ctime(sd); - inode->i_ctime.tv_nsec = 0; + inode_set_ctime(inode, sd_v2_ctime(sd), 0); inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; inode->i_blocks = sd_v2_blocks(sd); @@ -1374,7 +1372,7 @@ static void inode2sd(void *sd, struct inode *inode, loff_t size) set_sd_v2_gid(sd_v2, i_gid_read(inode)); set_sd_v2_mtime(sd_v2, inode->i_mtime.tv_sec); set_sd_v2_atime(sd_v2, inode->i_atime.tv_sec); - set_sd_v2_ctime(sd_v2, inode->i_ctime.tv_sec); + set_sd_v2_ctime(sd_v2, inode_get_ctime(inode).tv_sec); set_sd_v2_blocks(sd_v2, to_fake_used_blocks(inode, SD_V2_SIZE)); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) set_sd_v2_rdev(sd_v2, new_encode_dev(inode->i_rdev)); @@ -1394,7 +1392,7 @@ static void inode2sd_v1(void *sd, struct inode *inode, loff_t size) set_sd_v1_nlink(sd_v1, inode->i_nlink); set_sd_v1_size(sd_v1, size); set_sd_v1_atime(sd_v1, inode->i_atime.tv_sec); - set_sd_v1_ctime(sd_v1, inode->i_ctime.tv_sec); + set_sd_v1_ctime(sd_v1, inode_get_ctime(inode).tv_sec); set_sd_v1_mtime(sd_v1, inode->i_mtime.tv_sec); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) @@ -1986,7 +1984,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, /* uid and gid must already be set by the caller for quota init */ - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_size = i_size; inode->i_blocks = 0; inode->i_bytes = 0; diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index 6bf9b54e58ca..dd33f8cc6eda 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c @@ -55,7 +55,7 @@ int reiserfs_fileattr_set(struct mnt_idmap *idmap, } sd_attrs_to_i_attrs(flags, inode); REISERFS_I(inode)->i_attrs = flags; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); err = 0; unlock: @@ -107,7 +107,7 @@ long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) err = -EFAULT; goto setversion_out; } - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); setversion_out: mnt_drop_write_file(filp); diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 405ac59eb2dd..9c5704be2435 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -572,7 +572,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, } dir->i_size += paste_size; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); if (!S_ISDIR(inode->i_mode) && visible) /* reiserfs_mkdir or reiserfs_rename will do that by itself */ reiserfs_update_sd(th, dir); @@ -966,7 +966,8 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) inode->i_nlink); clear_nlink(inode); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_to_ts(dir, + inode_set_ctime_current(inode)); reiserfs_update_sd(&th, inode); DEC_DIR_INODE_NLINK(dir) @@ -1070,11 +1071,11 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) inc_nlink(inode); goto end_unlink; } - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); reiserfs_update_sd(&th, inode); dir->i_size -= (de.de_entrylen + DEH_SIZE); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); reiserfs_update_sd(&th, dir); if (!savelink) @@ -1250,7 +1251,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, return err ? err : retval; } - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); reiserfs_update_sd(&th, inode); ihold(inode); diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index ce5003986789..3676e02a0232 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -2004,7 +2004,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, if (update_timestamps) { inode->i_mtime = current_time(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); } reiserfs_update_sd(th, inode); @@ -2029,7 +2029,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, if (update_timestamps) { /* this is truncate, not file closing */ inode->i_mtime = current_time(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); } reiserfs_update_sd(th, inode); diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 929acce6e731..7eaf36b3de12 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -2587,7 +2587,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type, return err; if (inode->i_size < off + len - towrite) i_size_write(inode, off + len - towrite); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); return len - towrite; } diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 651027967159..6000964c2b80 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -466,12 +466,13 @@ int reiserfs_commit_write(struct file *f, struct page *page, static void update_ctime(struct inode *inode) { struct timespec64 now = current_time(inode); + struct timespec64 ctime = inode_get_ctime(inode); if (inode_unhashed(inode) || !inode->i_nlink || - timespec64_equal(&inode->i_ctime, &now)) + timespec64_equal(&ctime, &now)) return; - inode->i_ctime = current_time(inode); + inode_set_ctime_to_ts(inode, now); mark_inode_dirty(inode); } diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 138060452678..064264992b49 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c @@ -285,7 +285,7 @@ __reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode, if (error == -ENODATA) { error = 0; if (type == ACL_TYPE_ACCESS) { - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); } } From patchwork Wed Jul 5 19:01:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116313 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2087784vqx; Wed, 5 Jul 2023 12:24:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHFcaHY1p+0HC4RzPhlL8oQohnx50/tDKLQZSk52/RPSjCv7o8c6YqDkdPnthl3pDkh+un7 X-Received: by 2002:a17:902:db10:b0:1b8:417d:d042 with SMTP id m16-20020a170902db1000b001b8417dd042mr4605318plx.20.1688585068727; Wed, 05 Jul 2023 12:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585068; cv=none; d=google.com; s=arc-20160816; b=nMYMQiGxcuxM+q2DFGqSrPsIb+bs21iiP0LX/ngSreSlBZyU5lH0mT8hhwOP/TYCiZ 9yrVWIyo7TnCn2wV4F+00dsLWPSCGIJWIOikAY+nSR2HQI8PJW4UMqBH7fX/rkPN/3i+ PCUw9iAecTNMcvzN/J1ivVWnmyRP+BvqxJhscynn5Dly7X1YNRLWIa6XBn8M1+nZR/vY 0HJK8kRlphs3ZpnrWOMy2r5WGWrhEp93vC6nNlKmPCUugUfouRZGxicE0D+ZAwj6loYc mOmGTibhtDJTHrUPr/LAxBBryXOJ6sR8TfhHWhE+fjg8d909PHBp3g6o9Br8UgKxCNiv 71KA== 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=/mLBDFQ3kATDsUTMMQV0BnHbMd5wpFhEpLYjsDxfIsY=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=qsBBmtPhI+JZPhbJjMvAKutAlMSFUTxEUGHbOXSIzpXJzSoDh2t0FK2ZNqv171xTiW EPf+ckksjYiGRHHeleI+D9vfBefN77lVcpZ12k2wEokDw7P8wNOvy/8pjM0BY9oIgnc+ Cr6pViVInZQLJAHHGQEp2jv44xxkJLbmGefi0duljHVvk+0tn3hEfm+x+vF5PhbC3Y3D W82qTKbkZ3Xz/PhxznmYjIkrXmMvqsJcI+s3wiGIvveU3C11UCEeao3tySZTEtS7S37/ CQLrw4Hg42okQYyNIQlraJ3TBzFM1See/s2YbQU7O8VqNzAmJxSxZdCIYlYAEoIaEkQl pmow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L9UEBWbc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a170902988700b001b5afcfa180si23680403plp.213.2023.07.05.12.24.13; Wed, 05 Jul 2023 12:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L9UEBWbc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234074AbjGETLz (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233373AbjGETLD (ORCPT ); Wed, 5 Jul 2023 15:11:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03DD64499; Wed, 5 Jul 2023 12:06:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C4BD616FF; Wed, 5 Jul 2023 19:05:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2EF0C433C9; Wed, 5 Jul 2023 19:05:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583915; bh=AxIRr4uzMf6HToOd79HziOv2aR8VXWEmEPY7SKLA4QY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L9UEBWbcccHAypoaHtHAC9hXPW4mp7QiJ7Tv7GKLpaDE45Wvszfh0sBcdqILPht2o sh/Uvgm4T0iChWi0zI3i8hWE6yc1mz10RKN82ApYP3T+Ggm81HfPwnhVAbhH8QSzHw 4dOTC7NhQRbRuli9HjAOEW/3Reh0xyO84UMkSK0nWbn9t1NTVtYvlsdzIIpFCaMsjr OXgsu3HnmBsze0PW0fYYyXW6FQD3sQZHq4Ibf0iHUEkibG56IkZbwQIUM5d9v/sqAI WtiblYa0KsSi57Vtju82IPLWBIARy84kSZbJhd3O5WwqHR/lz1g20cfhYitMVRCrqB koKaabQRHwc/g== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 73/92] romfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:38 -0400 Message-ID: <20230705190309.579783-71-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770609776868983620?= X-GMAIL-MSGID: =?utf-8?q?1770609776868983620?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton --- fs/romfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/romfs/super.c b/fs/romfs/super.c index c59b230d55b4..961b9d342e0e 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -322,8 +322,8 @@ static struct inode *romfs_iget(struct super_block *sb, unsigned long pos) set_nlink(i, 1); /* Hard to decide.. */ i->i_size = be32_to_cpu(ri.size); - i->i_mtime.tv_sec = i->i_atime.tv_sec = i->i_ctime.tv_sec = 0; - i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0; + i->i_mtime.tv_sec = i->i_atime.tv_sec = inode_set_ctime(i, 0, 0).tv_sec; + i->i_mtime.tv_nsec = i->i_atime.tv_nsec = 0; /* set up mode and ops */ mode = romfs_modemap[nextfh & ROMFH_TYPE]; From patchwork Wed Jul 5 19:01:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116343 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2094954vqx; Wed, 5 Jul 2023 12:39:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlHibR1lyV8SOVd/2nYYfQVf9j4uFX0ScZrIiX30TF8Yvv2Hgs/lWaby4o5d6+Kc/2eNcvYy X-Received: by 2002:a05:6a20:3d16:b0:12f:c61e:7cc3 with SMTP id y22-20020a056a203d1600b0012fc61e7cc3mr2460231pzi.38.1688585961018; Wed, 05 Jul 2023 12:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585961; cv=none; d=google.com; s=arc-20160816; b=bh9KRdlKKVpnaQZhO8AyWe0JW247Y5ARxLeZ3u/lI6QLxI77GMKzhKSUnBVt0bHCyN CNPmDjyF3zAiNVa3Uk52N2NNQa1TcE1WTkYyGqPfnQYmNCOaDVYtAoyEkFnczKynTJ6z NfVYzM0BilQdnEX4kWkT3S3UvsyaWLQ5wPccv/HAqyXXJRPX4O8LrDrPRwk/w6KXgslj 62VXyMWzBL/mpnUeLuOO/QkmZ8NKSUi+jkDSb1KoeHvLSFP0dGJ7LhjT3XItGcWhEZK9 J8iJeeVrXvybttL6mOFbJhFbnQUZZ9z1gl/7ww1SpWvusN0apK9tUytewjuARn2LPkWa 1iiw== 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=vZ0j2bS6RxesxlCDc+RUEONyKVd1hAJCdDg4C33Yn30=; fh=eVPI9gx1HBcAw3/7lnROfnjv7yPoU7lw+EMQz659asM=; b=0HMfePQ5LoRiNlH279mvm/4+ezCzd6NCvNR7T++oGFatqOIZwT91EbHjLHKlipSsRx zShmCdsn8FnE2TzYgYiXcR3dGeO6YSpGmYRloLihZMMcpfak3lEA2hb2BNa5Xto+t5Si pVjLLk85RYVXkUNU8aBYHBrzvjBBi+qx4NM9oEPSy+5E1IQGvocKG8ujbK5ctAyjkfse uXd+s8rnXwczNdpBxdKPYxIWE+c8ToDOiyjOIxDbg/YniR8J7QgezaU9uZxemJatxWGk xvpxijuRApA94smDLmt/OVBbDa4x08FfLms2Lb/GhJl87iLt+fCxZ7a/kXTYwjZa88R+ UNYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fBxoHWcY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w70-20020a638249000000b0055acc7f8086si20959813pgd.821.2023.07.05.12.39.08; Wed, 05 Jul 2023 12:39:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fBxoHWcY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234221AbjGETXs (ORCPT + 99 others); Wed, 5 Jul 2023 15:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234205AbjGETXc (ORCPT ); Wed, 5 Jul 2023 15:23:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7571D30CF; Wed, 5 Jul 2023 12:20:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B5DB26170E; Wed, 5 Jul 2023 19:05:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD8CFC433C7; Wed, 5 Jul 2023 19:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583918; bh=6SL6mUSfB28KQKat8cbksYV4mudw5XTM3p/j6GIEI7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fBxoHWcYPCpxo2vQboMwtpHWVRXR9R3BF+3Iducwz7fJSJVJ/HmlEdHya3joPw2Z+ TE2flAeu1oqGVxvGQWcoCC+992jTRIpTthuoM2aogWWkxcUnSa55zkJoogWaKIyYiK dB5j8nZWSnzgEyx7iAun1wS/h9eLYK9A/f0LiUHlZCTnSVlo2QD67tItalRanJpql3 QcpCSxF7hu8qlaEWzlkhVcqtremoum0i936kWVWtvNEW0Cw1U+2MRosckD354oEp0W KCVS7NZPy2Dr9wI+rlS+32CkKN6TBP03uj4h4Oq1TBW3HpduOs/WZUCIU02wt6JXfy eEkQb8HInhqdA== From: Jeff Layton To: Christian Brauner , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Namjae Jeon , Sergey Senozhatsky Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH v2 74/92] smb: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:39 -0400 Message-ID: <20230705190309.579783-72-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610713060971640?= X-GMAIL-MSGID: =?utf-8?q?1770610713060971640?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Tom Talpey Reviewed-by: Sergey Senozhatsky Signed-off-by: Jeff Layton Acked-by: Steve French --- fs/smb/client/file.c | 4 ++-- fs/smb/client/fscache.h | 5 +++-- fs/smb/client/inode.c | 14 +++++++------- fs/smb/client/smb2ops.c | 3 ++- fs/smb/server/smb2pdu.c | 8 ++++---- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 0a5fe8d5314b..689058e1b6e6 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -1085,7 +1085,7 @@ int cifs_close(struct inode *inode, struct file *file) !test_bit(CIFS_INO_CLOSE_ON_LOCK, &cinode->flags) && dclose) { if (test_and_clear_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags)) { - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); } spin_lock(&cinode->deferred_lock); cifs_add_deferred_close(cfile, dclose); @@ -2596,7 +2596,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) write_data, to - from, &offset); cifsFileInfo_put(open_file); /* Does mm or vfs already set times? */ - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); if ((bytes_written > 0) && (offset)) rc = 0; else if (bytes_written < 0) diff --git a/fs/smb/client/fscache.h b/fs/smb/client/fscache.h index 173999610997..a228964bc2ce 100644 --- a/fs/smb/client/fscache.h +++ b/fs/smb/client/fscache.h @@ -50,12 +50,13 @@ void cifs_fscache_fill_coherency(struct inode *inode, struct cifs_fscache_inode_coherency_data *cd) { struct cifsInodeInfo *cifsi = CIFS_I(inode); + struct timespec64 ctime = inode_get_ctime(inode); memset(cd, 0, sizeof(*cd)); cd->last_write_time_sec = cpu_to_le64(cifsi->netfs.inode.i_mtime.tv_sec); cd->last_write_time_nsec = cpu_to_le32(cifsi->netfs.inode.i_mtime.tv_nsec); - cd->last_change_time_sec = cpu_to_le64(cifsi->netfs.inode.i_ctime.tv_sec); - cd->last_change_time_nsec = cpu_to_le32(cifsi->netfs.inode.i_ctime.tv_nsec); + cd->last_change_time_sec = cpu_to_le64(ctime.tv_sec); + cd->last_change_time_nsec = cpu_to_le64(ctime.tv_nsec); } diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index c3eeae07e139..218f03dd3f52 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -172,7 +172,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) else inode->i_atime = fattr->cf_atime; inode->i_mtime = fattr->cf_mtime; - inode->i_ctime = fattr->cf_ctime; + inode_set_ctime_to_ts(inode, fattr->cf_ctime); inode->i_rdev = fattr->cf_rdev; cifs_nlink_fattr_to_inode(inode, fattr); inode->i_uid = fattr->cf_uid; @@ -1744,9 +1744,9 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) cifs_inode = CIFS_I(inode); cifs_inode->time = 0; /* will force revalidate to get info when needed */ - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); } - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); cifs_inode = CIFS_I(dir); CIFS_I(dir)->time = 0; /* force revalidate of dir as well */ unlink_out: @@ -2060,8 +2060,8 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) */ cifsInode->time = 0; - d_inode(direntry)->i_ctime = inode->i_ctime = inode->i_mtime = - current_time(inode); + inode_set_ctime_current(d_inode(direntry)); + inode->i_mtime = inode_set_ctime_current(inode); rmdir_exit: free_dentry_path(page); @@ -2267,8 +2267,8 @@ cifs_rename2(struct mnt_idmap *idmap, struct inode *source_dir, /* force revalidate to go get info when needed */ CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0; - source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime = - target_dir->i_mtime = current_time(source_dir); + source_dir->i_mtime = target_dir->i_mtime = inode_set_ctime_to_ts(source_dir, + inode_set_ctime_current(target_dir)); cifs_rename_exit: kfree(info_buf_source); diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 87abce010974..3cc3c4a71e32 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -1396,7 +1396,8 @@ smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon, if (file_inf.LastWriteTime) inode->i_mtime = cifs_NTtimeToUnix(file_inf.LastWriteTime); if (file_inf.ChangeTime) - inode->i_ctime = cifs_NTtimeToUnix(file_inf.ChangeTime); + inode_set_ctime_to_ts(inode, + cifs_NTtimeToUnix(file_inf.ChangeTime)); if (file_inf.LastAccessTime) inode->i_atime = cifs_NTtimeToUnix(file_inf.LastAccessTime); diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index cf8822103f50..f9099831c8ff 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -4779,7 +4779,7 @@ static int find_file_posix_info(struct smb2_query_info_rsp *rsp, file_info->LastAccessTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode->i_mtime); file_info->LastWriteTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_ctime); + time = ksmbd_UnixTimeToNT(inode_get_ctime(inode)); file_info->ChangeTime = cpu_to_le64(time); file_info->DosAttributes = fp->f_ci->m_fattr; file_info->Inode = cpu_to_le64(inode->i_ino); @@ -5422,7 +5422,7 @@ int smb2_close(struct ksmbd_work *work) rsp->LastAccessTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode->i_mtime); rsp->LastWriteTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_ctime); + time = ksmbd_UnixTimeToNT(inode_get_ctime(inode)); rsp->ChangeTime = cpu_to_le64(time); ksmbd_fd_put(work, fp); } else { @@ -5644,7 +5644,7 @@ static int set_file_basic_info(struct ksmbd_file *fp, if (file_info->ChangeTime) attrs.ia_ctime = ksmbd_NTtimeToUnix(file_info->ChangeTime); else - attrs.ia_ctime = inode->i_ctime; + attrs.ia_ctime = inode_get_ctime(inode); if (file_info->LastWriteTime) { attrs.ia_mtime = ksmbd_NTtimeToUnix(file_info->LastWriteTime); @@ -5689,7 +5689,7 @@ static int set_file_basic_info(struct ksmbd_file *fp, return -EACCES; inode_lock(inode); - inode->i_ctime = attrs.ia_ctime; + inode_set_ctime_to_ts(inode, attrs.ia_ctime); attrs.ia_valid &= ~ATTR_CTIME; rc = notify_change(idmap, dentry, &attrs, NULL); inode_unlock(inode); From patchwork Wed Jul 5 19:01:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096270vqx; Wed, 5 Jul 2023 12:42:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/MyR/BROi8DStNoDLYpdtMcaSuPMERaUvbDq5yXjQUPkAFlKRBNlJ4Z41wHxyW0KBXzXY X-Received: by 2002:a17:90b:3b88:b0:25b:d4bc:28d4 with SMTP id pc8-20020a17090b3b8800b0025bd4bc28d4mr16347915pjb.40.1688586127658; Wed, 05 Jul 2023 12:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586127; cv=none; d=google.com; s=arc-20160816; b=VP3nhNmsRRo9kRv9BmKq2WfrwkgfHoyqNsZYlKsjDWTqgc804Qvoa0LkSOjzCe0Lcv 4gPJGP8J8geMqnVdMcRzDKxjh4xlMSWDsmC8MRMIunje2H63eOzKtlhODUXZ3MZYyw8a AjAGcSGFfcuEBPZqr+RrTvsUuPJByvV/xHa+aRX7OCpLvj2Xgveex1Gg/BE7GGVvumIg thvte2/uJQgFvxuvDchKhgq/Ic05D5ZEf+onkiXrdhS75D8xD0Pu21yrz0RtBW67y2G3 NjcczPZUJ8rm73eOjHQi+zw6pJDoIGwmtAvFZHJpcb88dp+c5JSc/t/hE2+H9n3aHjXU 16qw== 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=IYfa1+pE0T2erisD1fempdsgyVcUUV+rB8akz949B1Q=; fh=C3F3BinwmLxJ8F7hr6QyxbuUa6zJrlgp0/Odg0bQl0U=; b=a7k/RS9/aQyYavPthapxNVJqHktGVcJSMAGYQtNmYkGBWFc5k/8KgYwfcvCbG/rc42 zbHS0Tg9rGi/RYjm0hyddBEyPJWkbxvYZV5HCFN//cWeFvcbr1X+XhMy/ZgiB4MU8DJq WxYcK1lA0je2Z5fWCONBS35azbF4xhQozwG34kBRsjeonfY4fdAuZYDWvh9bxzJdF3Ss saceCNG8d0Yk8JlwQ+dzYM7S1dqUKiopoAHD2FqVCXf026Dp1likwLZOEGygvmd3cK4A YhUZtk+l1perLKc38ZGFUGUbmRGPKUhSL4FYy0bbNrnjYRiJ+a+oLrPFE1G0Y/ZuqIBz 9OCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Jvy/ZMtA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a170902c40300b001b665d8d63asi26482594plk.356.2023.07.05.12.41.52; Wed, 05 Jul 2023 12:42:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Jvy/ZMtA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232588AbjGETMd (ORCPT + 99 others); Wed, 5 Jul 2023 15:12:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234123AbjGETML (ORCPT ); Wed, 5 Jul 2023 15:12:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767C446AA; Wed, 5 Jul 2023 12:06:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 117AE61659; Wed, 5 Jul 2023 19:05:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB099C433C8; Wed, 5 Jul 2023 19:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583919; bh=APonqwGt5CzNfjmUkmd25I4muRb/3bt+mHUzQm46fRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jvy/ZMtAwgjO7i3+DtGUaeRokw/RaZVluzeNY+QjImXpzyVnDYMqO1MtYtsW8Miof g1j7T/CgfxDiedagcyz+HupS0HST8OgckpQhiD9eC5pRmLSWmPU7P/59dK5wJE2VrF bZaxw1gpMBsIM8VZWPDTzq76Eosq/T7o6u1A6uj3G2RG7aBIqm42DZlknY+xdBLa2I n0NLMLH1l/8xfS6YnaYSKNgzFyc+7z3gvxTMOSlBKqqthWxvYMDJ/zUp3V2u4Erx4w Jf+SqTew1nM2vFf1L3dIkPoEem+Lm6CoeRlmBux/C/wUU9wU7O6C8fY+muu1HIYB3p caB4uDRck2oqg== From: Jeff Layton To: Christian Brauner , Phillip Lougher Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 75/92] squashfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:40 -0400 Message-ID: <20230705190309.579783-73-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610887424617781?= X-GMAIL-MSGID: =?utf-8?q?1770610887424617781?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/squashfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c index 24463145b351..c6e626b00546 100644 --- a/fs/squashfs/inode.c +++ b/fs/squashfs/inode.c @@ -61,7 +61,7 @@ static int squashfs_new_inode(struct super_block *sb, struct inode *inode, inode->i_ino = le32_to_cpu(sqsh_ino->inode_number); inode->i_mtime.tv_sec = le32_to_cpu(sqsh_ino->mtime); inode->i_atime.tv_sec = inode->i_mtime.tv_sec; - inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode_set_ctime(inode, inode->i_mtime.tv_sec, 0); inode->i_mode = le16_to_cpu(sqsh_ino->mode); inode->i_size = 0; From patchwork Wed Jul 5 19:01:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116335 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2093011vqx; Wed, 5 Jul 2023 12:34:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlGjeBX0Hw6F76/WS3hmNjWeJRQIat9+/qI3UKBqkY2Jv2mO++dOCBP9SdRXc/sOGu4zB2NS X-Received: by 2002:a17:902:8b84:b0:1b6:a99b:cece with SMTP id ay4-20020a1709028b8400b001b6a99bcecemr3443186plb.30.1688585697341; Wed, 05 Jul 2023 12:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585697; cv=none; d=google.com; s=arc-20160816; b=EtKRi+GyElHDbO6tO0hvrtfcPtiLar7SbpdvqrIxcKrJHpkdJmUYy7sl8/+x3v4w3g ZomDoih/U0YbsnMCZ0lIzq7m4uRhKwPtobRS87SGcFPG7Oqm86wJqGLJLWC1aB5Vx5mo hC0mdYH4yJ909g0lsaZ2Wi9agNuj9tbOAUFJQJ1pEwLFW5YjnUhH4caaqsPZnuVEIsK7 o/K13Jffkvi8zsKBfPcpN4XVc0qjBsMGi1nJ2MCQLWf08rRJH3//9gA0HqukIATNZ6mb SMcM3HctQ1tz3k9z88ar6U7c8Sub3Ksy9lWFFQBZR2dUYpDV19XYvP123PVl+jYMgWRu DjKg== 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=8oE4KQ5D2DlOHmrsFiowshXAiGAi/6kWW6BxX2Hb5Q4=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=bI7wb70jLtodm7VmMrNvNhqk8vmbnLL+MUza5MTJ7Dwi1HWHxzYpRfBTbT9H0hux8h anv7npH95RmnJrgTSZZDojqtUsQOxa4GXMrQY0kw8HtdbXGb3ry78Ynt5BakwZY/c2K7 BL8gd7Pr0TNS1xT9JpOKavOntEReVjEt2kZWmh0/ThmtnERB7dECn7UZmVC1vXVsBtqg VDFKN/c7/9PWD9X8p96wwzFCnlwugLcQTNlUK27o+FJzDdR0ks1Y2IV8bWCP4Y/xTDcp SH93fRVDpCbwduKNKM+7tqcvFYHgXlIkwlEodaI9DMn3UXuupENjB154cHfP+PU51ZI3 Iz9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MOP2M5G1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b001b3f9cedbb7si21935161plr.398.2023.07.05.12.34.42; Wed, 05 Jul 2023 12:34:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MOP2M5G1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234011AbjGETMD (ORCPT + 99 others); Wed, 5 Jul 2023 15:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233973AbjGETLo (ORCPT ); Wed, 5 Jul 2023 15:11:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F821BD4; Wed, 5 Jul 2023 12:06:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F2B2F616EC; Wed, 5 Jul 2023 19:05:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCDA8C433C9; Wed, 5 Jul 2023 19:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583921; bh=c2Ibbh4QGi07R4DFEsfP2TPQkIZ3JNkmq7vEUDROrEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MOP2M5G1BEeB6CmGAasySy8gS2HZTCQS5Zv3stH92Taz4cTSH0T6/Jr5yKyF4L3sy OeCcaaJlBqtWPO2k5LNXffJ3h1PinteQk9Cp1BDphrKl27YGmD4xHnY/nJFGRTttpU 9vOaA8KN+13TonnDEEyCcFQ1PkrNN85fJDLKw00ynEg5ZewUhZiMQ67VXYtaLqZ0nY CYEIjy37J0PYS94yRCbMXwmpPz5e2R0bd4NM+XVbYk0IqKGOemgM74QSH5oSHGBbPH kFXLn2HZHE5PrT6RGSgc0k3t3cwX4aBL+aeenbbrAjvGxfvK+13ils5F9eCmeZCuBA uMTYBxsWf15EA== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 76/92] sysv: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:41 -0400 Message-ID: <20230705190309.579783-74-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610436402815797?= X-GMAIL-MSGID: =?utf-8?q?1770610436402815797?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/sysv/dir.c | 6 +++--- fs/sysv/ialloc.c | 2 +- fs/sysv/inode.c | 5 ++--- fs/sysv/itree.c | 4 ++-- fs/sysv/namei.c | 6 +++--- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index 0140010aa0c3..2f5ead88d00b 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c @@ -224,7 +224,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode) memset (de->name + namelen, 0, SYSV_DIRSIZE - namelen - 2); de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino); dir_commit_chunk(page, pos, SYSV_DIRSIZE); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); err = sysv_handle_dirsync(dir); out_page: @@ -249,7 +249,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de, struct page *page) } de->inode = 0; dir_commit_chunk(page, pos, SYSV_DIRSIZE); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); return sysv_handle_dirsync(inode); } @@ -346,7 +346,7 @@ int sysv_set_link(struct sysv_dir_entry *de, struct page *page, } de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino); dir_commit_chunk(page, pos, SYSV_DIRSIZE); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); return sysv_handle_dirsync(inode); } diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c index e732879036ab..6719da5889d9 100644 --- a/fs/sysv/ialloc.c +++ b/fs/sysv/ialloc.c @@ -165,7 +165,7 @@ struct inode * sysv_new_inode(const struct inode * dir, umode_t mode) dirty_sb(sb); inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_ino = fs16_to_cpu(sbi, ino); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_blocks = 0; memset(SYSV_I(inode)->i_data, 0, sizeof(SYSV_I(inode)->i_data)); SYSV_I(inode)->i_dir_start_lookup = 0; diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c index 9e8d4a6fb2f3..0aa3827d8178 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c @@ -202,8 +202,7 @@ struct inode *sysv_iget(struct super_block *sb, unsigned int ino) inode->i_size = fs32_to_cpu(sbi, raw_inode->i_size); inode->i_atime.tv_sec = fs32_to_cpu(sbi, raw_inode->i_atime); inode->i_mtime.tv_sec = fs32_to_cpu(sbi, raw_inode->i_mtime); - inode->i_ctime.tv_sec = fs32_to_cpu(sbi, raw_inode->i_ctime); - inode->i_ctime.tv_nsec = 0; + inode_set_ctime(inode, fs32_to_cpu(sbi, raw_inode->i_ctime), 0); inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; inode->i_blocks = 0; @@ -256,7 +255,7 @@ static int __sysv_write_inode(struct inode *inode, int wait) raw_inode->i_size = cpu_to_fs32(sbi, inode->i_size); raw_inode->i_atime = cpu_to_fs32(sbi, inode->i_atime.tv_sec); raw_inode->i_mtime = cpu_to_fs32(sbi, inode->i_mtime.tv_sec); - raw_inode->i_ctime = cpu_to_fs32(sbi, inode->i_ctime.tv_sec); + raw_inode->i_ctime = cpu_to_fs32(sbi, inode_get_ctime(inode).tv_sec); si = SYSV_I(inode); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c index 58d7f43a1371..dba6a2ef26f1 100644 --- a/fs/sysv/itree.c +++ b/fs/sysv/itree.c @@ -183,7 +183,7 @@ static inline int splice_branch(struct inode *inode, *where->p = where->key; write_unlock(&pointers_lock); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); /* had we spliced it onto indirect block? */ if (where->bh) @@ -423,7 +423,7 @@ void sysv_truncate (struct inode * inode) } n++; } - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); if (IS_SYNC(inode)) sysv_sync_inode (inode); else diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index fcf163fea3ad..d6b73798071b 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c @@ -103,7 +103,7 @@ static int sysv_link(struct dentry * old_dentry, struct inode * dir, { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -161,7 +161,7 @@ static int sysv_unlink(struct inode * dir, struct dentry * dentry) err = sysv_delete_entry(de, page); if (!err) { - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); inode_dec_link_count(inode); } unmap_and_put_page(page, de); @@ -230,7 +230,7 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir, unmap_and_put_page(new_page, new_de); if (err) goto out_dir; - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); From patchwork Wed Jul 5 19:01:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2095093vqx; Wed, 5 Jul 2023 12:39:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlGWj0rMW/jM3NxeAYFNPCQ9RKpGGxaEBSzEvAWr/TKjP0WO5P9QtccYm6OJwdO//Ubmx/4G X-Received: by 2002:a05:6870:14d4:b0:1b0:1f0e:2bd4 with SMTP id l20-20020a05687014d400b001b01f0e2bd4mr9393oab.8.1688585980973; Wed, 05 Jul 2023 12:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585980; cv=none; d=google.com; s=arc-20160816; b=fAFva1Vdc5ztMVIjojpHw6jK8XUVtPmSowp/cXBGBjd0Ph3yc2IECLDALKJ9UebNzK XHqaiwlNxMEFD3hTuf3q8j1w3zb57AiGM4qZYqCLhosF11YR6ryn8LPQbxfI/h0kP92U 5YrimTgxIrGe1DxEBEoijRNbuszV7M4C7vs3O6+ScyIddgb7CaUCC/fzuoPHSGoKcS9X hXllkBZrMyv377gtS+khxNcp/vCyP6u0qXweWgLhOGgiohiD1VHAEbdZCZ/3CNrPr87u r8SJlXO7Zz0WIBr5i5bmwou7fvINBmJ4i8bQTZ9KGuccFFyBUfdeUBj+T+xMmNoWhlrw fl/w== 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=mnIHdFHUAbV8n/Cv/jRNe2Mor+2zsh7iyP+WuD20MUk=; fh=rdGU7l6o/z5npt2cWEQVraZmvUPPTYsM5I6VsXuOZm0=; b=wwlzco90fN6Ese96k8CDzAmjmz6Yr1yi8yu/cfK1ciNuOwUQHzKKt1QoZiMXv/OzVS 7nmzDk+WXHgLVeeP1nSm51ZXmjvxfDH6dJebAXkUJpFRtZ6E3s5jRjV0UNMkxXKJBtO3 OOE6WiZRyODsu2BfNWHL11wQ2yY2vudrrF5ZDfPNxEscVEzMYBcnj4ok7JFJst+KKLfw Z2OoMrmZ0sy/uSseHcn0bL66ODlg/N37B3GbxQbSFRi3Ife4snzdXhBV34r0P70C3hiH +2IzgIyqKoh8lr/+JJCybeNrcP/w19Pze+p4P+sdXE4y35c2CBzecM/zq0I639poZpXn PkQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=poksKqNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o22-20020a17090ac09600b0025c02c13dfbsi2065721pjs.100.2023.07.05.12.39.28; Wed, 05 Jul 2023 12:39:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=poksKqNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234030AbjGETJj (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234180AbjGETIe (ORCPT ); Wed, 5 Jul 2023 15:08:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A48303A89; Wed, 5 Jul 2023 12:05:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 85113616CC; Wed, 5 Jul 2023 19:05:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21A8DC433C8; Wed, 5 Jul 2023 19:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583922; bh=j2FHLWwY3lGvOt5LLokAlhbkWWJYJoA+RCAfeF2LfzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=poksKqNgXNeDO6UFWdVg9nxYWkZFdCSlRLtxCk9+5dLhCED/sXsVrn37aXqb7TQ2U S+r+UKtGn2oMkEdiD1grlcbIZTjNHYiFfYbgOYCJFiLIS000DWgUYh5emMNZ20kk60 iEHKLZO3c7TsMjbXvmY9ox/Ke6I3j9521sdqGmIN5iCkvgJ5Wc/WwVWpqlVhlS71va 0Ni1G51txKrfK9AQq1SyfHkbYMz3EDDTFQEKoVzC7Fpr2ZDC7x6IlzGfMBmyf3UdeF KxbCulggOWzJYpO/bc8dwlQZ3oPxsK7UZ7xN22jSFvZpfIUxLaPj+5StzA3AEZPeK8 mmwasQN0+9byA== From: Jeff Layton To: Christian Brauner , Steven Rostedt , Masami Hiramatsu Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v2 77/92] tracefs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:42 -0400 Message-ID: <20230705190309.579783-75-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610733844580302?= X-GMAIL-MSGID: =?utf-8?q?1770610733844580302?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara Acked-by: Steven Rostedt (Google) --- fs/tracefs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 57ac8aa4a724..2feb6c58648c 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -132,7 +132,7 @@ static struct inode *tracefs_get_inode(struct super_block *sb) struct inode *inode = new_inode(sb); if (inode) { inode->i_ino = get_next_ino(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } return inode; } From patchwork Wed Jul 5 19:01:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2092566vqx; Wed, 5 Jul 2023 12:33:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlGJa29zyxlylF78dlEew/PewVY9fykAYyDEtN+c7epAdt/beh8MELm1bCLjHYxPx1XhPM+g X-Received: by 2002:a05:6a20:38b:b0:12e:7a8a:3793 with SMTP id 11-20020a056a20038b00b0012e7a8a3793mr6906891pzt.44.1688585638240; Wed, 05 Jul 2023 12:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585638; cv=none; d=google.com; s=arc-20160816; b=mm9JUx2Qpo6NBDEA2+77MA56OZjQTn/A//WL3A3LOGS7ONyD7vRgIkI+qu6rdvQ+uD FKPw4R3sG3NQrsm8td7t22byQjjJFtdWSYELfki4oJJUUgCHFdId9A1JOqyyll82+Gb1 PL1AMWblzqN0l4LEbAMovsIScU4Vo82zV3ZhdA51v+uHlynZ+jJ4giR6Wt2TTvDq/sQF 4cGv7rBAv97HCXZTxUT5DQChJ7aMDICBaGBIHv+Jd4vgbwah+NLJOTuYtAWrRNX+TgW2 +nu67/KGjPyeU5iweP3yX7AQV/uTyL/Vz3goLUgP/PehvrcR7CuHjZ5RskD9sDGfzjVQ UGqw== 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=KW4eKZjntdPJevoTN93H8/mU8TUX/u4fB+etXWlen4M=; fh=ZnOAzm1T0UOkfWnRudlMPPyYQlFU/bSR1Q9ZKqx8ZF8=; b=FwfglV5GikPtgEagatjBHnYKu7Y0VRWbwpHEQ05ZiSthoU9uHsz9dIPSF+ZkuF330X 9zLo2IvMLxjWVNigXDpLbEUJVwLFfggY9i+x+HMpqlVf6PowQdsSrRluNv2Tgbwi3PwP K+JtsoP+vnqJY4WZGMvjpUqIrib8OAjNpfWebiDNCgIBnpHUaYM9jpsxUg9dAqx80wxz E0Ly1wcvXVa+NbzMph+VuDNzmH7HiUaFo8gaw0FIbEp15vDnGmsfPzQK6LIwaL/6Vj/n ev86IkbkRu4hyfg2DzQrKUCrv573xFfVhhFkUSq0oqmc+MJJgReIyCayf4K49PL/XZt+ vCrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uXlMgo7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv12-20020a056a00414c00b00676fd3ad23dsi20779902pfb.384.2023.07.05.12.33.45; Wed, 05 Jul 2023 12:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uXlMgo7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234212AbjGETMO (ORCPT + 99 others); Wed, 5 Jul 2023 15:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbjGETLt (ORCPT ); Wed, 5 Jul 2023 15:11:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2664344AE; Wed, 5 Jul 2023 12:06:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 07AFE616EE; Wed, 5 Jul 2023 19:05:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDCCDC433C8; Wed, 5 Jul 2023 19:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583925; bh=+82KIEoO6oe3lt8wvhlCVrwz0sAgstySmhvyztkjhOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uXlMgo7K0nLw9Zu5iobBzGnnFdymopJit67shC/TeLB3S3KsEA3BdpaNiy7at9SD6 0nzunf+JDC4kaA38QyfG0bmYGYwT8bUOpDORVjD3D4d7DHnOljTBtDIVq4DOb73arQ J0Dl3A1qlbE1mFfUN1dgZDJNgML/Er95Zlc+6fhKrS2NXKCzAfRJqCHokajPe0aPa4 N4FgxE916CmS/GIwsTLUpEB/J85F4VH6mNZXHegUI3qAuMs5hRMEYogsecPfhqNtxh X8Yv1jhm9AnwGKX50lA6wrIadRczrLXIeBoFGhU1OraASxEoud/YHwTCLVHCe6K4K8 68vIgOM0qedsQ== From: Jeff Layton To: Christian Brauner , Richard Weinberger Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH v2 78/92] ubifs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:43 -0400 Message-ID: <20230705190309.579783-76-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610373893861694?= X-GMAIL-MSGID: =?utf-8?q?1770610373893861694?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Zhihao Cheng --- fs/ubifs/debug.c | 4 ++-- fs/ubifs/dir.c | 24 +++++++++++------------- fs/ubifs/file.c | 16 +++++++++------- fs/ubifs/ioctl.c | 2 +- fs/ubifs/journal.c | 4 ++-- fs/ubifs/super.c | 4 ++-- fs/ubifs/xattr.c | 6 +++--- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 9c9d3f0e36a4..eef9e527d9ff 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -243,8 +243,8 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) (unsigned int)inode->i_mtime.tv_sec, (unsigned int)inode->i_mtime.tv_nsec); pr_err("\tctime %u.%u\n", - (unsigned int)inode->i_ctime.tv_sec, - (unsigned int)inode->i_ctime.tv_nsec); + (unsigned int) inode_get_ctime(inode).tv_sec, + (unsigned int) inode_get_ctime(inode).tv_nsec); pr_err("\tcreat_sqnum %llu\n", ui->creat_sqnum); pr_err("\txattr_size %u\n", ui->xattr_size); pr_err("\txattr_cnt %u\n", ui->xattr_cnt); diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 7ec25310bd8a..3a1ba8ba308a 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -96,8 +96,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir, inode->i_flags |= S_NOCMTIME; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); - inode->i_mtime = inode->i_atime = inode->i_ctime = - current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_mapping->nrpages = 0; if (!is_xattr) { @@ -325,7 +324,7 @@ static int ubifs_create(struct mnt_idmap *idmap, struct inode *dir, mutex_lock(&dir_ui->ui_mutex); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -765,10 +764,10 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir, inc_nlink(inode); ihold(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -838,11 +837,11 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) } lock_2_inodes(dir, inode); - inode->i_ctime = current_time(dir); + inode_set_ctime_current(inode); drop_nlink(inode); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 1, 0); if (err) goto out_cancel; @@ -940,12 +939,12 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) } lock_2_inodes(dir, inode); - inode->i_ctime = current_time(dir); + inode_set_ctime_current(inode); clear_nlink(inode); drop_nlink(dir); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 1, 0); if (err) goto out_cancel; @@ -1019,7 +1018,7 @@ static int ubifs_mkdir(struct mnt_idmap *idmap, struct inode *dir, inc_nlink(dir); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) { ubifs_err(c, "cannot create directory, error %d", err); @@ -1110,7 +1109,7 @@ static int ubifs_mknod(struct mnt_idmap *idmap, struct inode *dir, mutex_lock(&dir_ui->ui_mutex); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -1210,7 +1209,7 @@ static int ubifs_symlink(struct mnt_idmap *idmap, struct inode *dir, mutex_lock(&dir_ui->ui_mutex); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -1298,7 +1297,6 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, struct ubifs_budget_req ino_req = { .dirtied_ino = 1, .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) }; struct ubifs_budget_req wht_req; - struct timespec64 time; unsigned int saved_nlink; struct fscrypt_name old_nm, new_nm; diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 6738fe43040b..436b27d7c58f 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1092,7 +1092,7 @@ static void do_attr_changes(struct inode *inode, const struct iattr *attr) if (attr->ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (attr->ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_set_ctime_to_ts(inode, attr->ia_ctime); if (attr->ia_valid & ATTR_MODE) { umode_t mode = attr->ia_mode; @@ -1192,7 +1192,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode, mutex_lock(&ui->ui_mutex); ui->ui_size = inode->i_size; /* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); /* Other attributes may be changed at the same time as well */ do_attr_changes(inode, attr); err = ubifs_jnl_truncate(c, inode, old_size, new_size); @@ -1239,7 +1239,7 @@ static int do_setattr(struct ubifs_info *c, struct inode *inode, mutex_lock(&ui->ui_mutex); if (attr->ia_valid & ATTR_SIZE) { /* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); /* 'truncate_setsize()' changed @i_size, update @ui_size */ ui->ui_size = inode->i_size; } @@ -1364,8 +1364,10 @@ int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) static inline int mctime_update_needed(const struct inode *inode, const struct timespec64 *now) { + struct timespec64 ctime = inode_get_ctime(inode); + if (!timespec64_equal(&inode->i_mtime, now) || - !timespec64_equal(&inode->i_ctime, now)) + !timespec64_equal(&ctime, now)) return 1; return 0; } @@ -1396,7 +1398,7 @@ int ubifs_update_time(struct inode *inode, struct timespec64 *time, if (flags & S_ATIME) inode->i_atime = *time; if (flags & S_CTIME) - inode->i_ctime = *time; + inode_set_ctime_to_ts(inode, *time); if (flags & S_MTIME) inode->i_mtime = *time; @@ -1432,7 +1434,7 @@ static int update_mctime(struct inode *inode) return err; mutex_lock(&ui->ui_mutex); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); @@ -1570,7 +1572,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf) struct ubifs_inode *ui = ubifs_inode(inode); mutex_lock(&ui->ui_mutex); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 67c5108abd89..d79cabe193c3 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c @@ -118,7 +118,7 @@ static int setflags(struct inode *inode, int flags) ui->flags &= ~ioctl2ubifs(UBIFS_SETTABLE_IOCTL_FLAGS); ui->flags |= ioctl2ubifs(flags); ubifs_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index dc52ac0f4a34..ffc9beee7be6 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -454,8 +454,8 @@ static void pack_inode(struct ubifs_info *c, struct ubifs_ino_node *ino, ino->creat_sqnum = cpu_to_le64(ui->creat_sqnum); ino->atime_sec = cpu_to_le64(inode->i_atime.tv_sec); ino->atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); - ino->ctime_sec = cpu_to_le64(inode->i_ctime.tv_sec); - ino->ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + ino->ctime_sec = cpu_to_le64(inode_get_ctime(inode).tv_sec); + ino->ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); ino->mtime_sec = cpu_to_le64(inode->i_mtime.tv_sec); ino->mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); ino->uid = cpu_to_le32(i_uid_read(inode)); diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 32cb14759796..b08fb28d16b5 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -146,8 +146,8 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum) inode->i_atime.tv_nsec = le32_to_cpu(ino->atime_nsec); inode->i_mtime.tv_sec = (int64_t)le64_to_cpu(ino->mtime_sec); inode->i_mtime.tv_nsec = le32_to_cpu(ino->mtime_nsec); - inode->i_ctime.tv_sec = (int64_t)le64_to_cpu(ino->ctime_sec); - inode->i_ctime.tv_nsec = le32_to_cpu(ino->ctime_nsec); + inode_set_ctime(inode, (int64_t)le64_to_cpu(ino->ctime_sec), + le32_to_cpu(ino->ctime_nsec)); inode->i_mode = le32_to_cpu(ino->mode); inode->i_size = le64_to_cpu(ino->size); diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 349228dd1191..406c82eab513 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -134,7 +134,7 @@ static int create_xattr(struct ubifs_info *c, struct inode *host, ui->data_len = size; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = current_time(host); + inode_set_ctime_current(host); host_ui->xattr_cnt += 1; host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); host_ui->xattr_size += CALC_XATTR_BYTES(size); @@ -215,7 +215,7 @@ static int change_xattr(struct ubifs_info *c, struct inode *host, ui->data_len = size; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = current_time(host); + inode_set_ctime_current(host); host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); host_ui->xattr_size += CALC_XATTR_BYTES(size); @@ -474,7 +474,7 @@ static int remove_xattr(struct ubifs_info *c, struct inode *host, return err; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = current_time(host); + inode_set_ctime_current(host); host_ui->xattr_cnt -= 1; host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len); From patchwork Wed Jul 5 19:01:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097716vqx; Wed, 5 Jul 2023 12:45:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlH2E0Nb2nf3EeMyXcVj14vkz5UpgMVwfBu1cz9yn+FNIMM9AWKcfD0DZ4Ykw6AURdcY+1Js X-Received: by 2002:a17:90a:ff11:b0:263:59a8:5480 with SMTP id ce17-20020a17090aff1100b0026359a85480mr4501369pjb.4.1688586325653; Wed, 05 Jul 2023 12:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586325; cv=none; d=google.com; s=arc-20160816; b=u1ee0lL9+A4znZ2HuLy9f7xDRKw2f94I/s7H8QiGUD6e+CDHnlKdwI8Hdziqxx5Twt 5iXgTn08fBToZ9hlEtVMnjx0iHQ8zoqULjHs1xMlOXsRURwrKqhufB5ZQKUnPADQ6LSp R0BcflfRDrxc1qv1LM5n9E6GS/YlKIj5T9e8Vg9620Ai+fuVqN/7bVqxl/SScuVnAN6J /Pb7amyGX/WBHQfiw9IbYuIeTKFJwjWsbGVZNpdlVjVDkR7fxuSmfQzKBx0Q+wv/2/Mx bU545JtLDaUcN8xgIWTpBb/O0Mf9C7hodAuWdiHoKAFiawt844R1pY7EglyZ464qRcWw ricw== 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=scV84NafXfNExr/7sebwWzql3jotZOVPcBzAaMx1BCU=; fh=SerdLlYobPirLpgwuBJtu6UT6J3GZUFY+V8ZxhjE8t4=; b=VInc48Ek0c3p+M29QmoIA7fu8O3BfmG6FqtkydQ4dxSBTQzuPfxxDFCs0QVBerZ4Eh nCRY8eU5KwYlTJ0JbbXKlxL+WeH4JFSe585kMqbEmgWSg7fqUR+XO/D8WKw4u2nk0K7J 6MxBgEv6g6goXB839F/fh9nqR+qo2SMj1EER5t1ZRy+OwA0pJFhReFRihtd1xaJI2ssS UJnJqkpTwWYWi+VUEgYccimkYe0vh7hhwYc8DzJHNuSBOdXQ5zdUz9PakhdM8BXpSoqw 9RtVLtLxOCAarul+Qew/X5rssOsbTvVVGZAtgxg5iFCj+7AIn6pcd5ZFty+cJjDBP0jQ Qtrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WfQ0SYHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt7-20020a17090af2c700b00263cdc45e8bsi2291371pjb.87.2023.07.05.12.45.10; Wed, 05 Jul 2023 12:45:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WfQ0SYHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234227AbjGETUy (ORCPT + 99 others); Wed, 5 Jul 2023 15:20:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233366AbjGETUm (ORCPT ); Wed, 5 Jul 2023 15:20:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BE935FD3; Wed, 5 Jul 2023 12:15:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D46A261711; Wed, 5 Jul 2023 19:05:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E059C433C8; Wed, 5 Jul 2023 19:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583927; bh=J5Wr9umKh9wwjzryMyuVhIjsxj4Oc2HZ5hUKITlldUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WfQ0SYHgW9AEsfWHSKjGsVkuKFBDnh01IC/FD1QHVhWuiiXVBBrf1IzodNoAXoLti LSple36tFC5rpxSAnwnuQ7Boq7ls7b9oy8ZLKW3Sc1uCEpo3TQ3QAeZQASYxq3BdJt 6SoDYP/bdZ0vq30MINFqbG6W0kU7N76yuTPbqWGGYmVGBwef+fH9V3xWNNzphjrBuh 0w9R36p3wr1pP+xsCXEbB23zicmLCvvWMe5A2pre533uG76CegE31Uc7JgOOgUvmDp rw7X9suJALo3LhalD/wBSwgJj2svQwYlJW119cEp7apOEIv3wfZPUcNan1Sb+okFTo 6Igv0l6fmBPkQ== From: Jeff Layton To: Christian Brauner , Jan Kara Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 79/92] udf: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:44 -0400 Message-ID: <20230705190309.579783-77-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611095314276403?= X-GMAIL-MSGID: =?utf-8?q?1770611095314276403?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/udf/ialloc.c | 2 +- fs/udf/inode.c | 17 ++++++++++------- fs/udf/namei.c | 24 ++++++++++++------------ 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 5f7ac8c84798..6b558cbbeb6b 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c @@ -100,7 +100,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; else iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); iinfo->i_crtime = inode->i_mtime; if (unlikely(insert_inode_locked(inode) < 0)) { make_bad_inode(inode); diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 28cdfc57d946..d089795074e8 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -910,7 +910,7 @@ static int inode_getblk(struct inode *inode, struct udf_map_rq *map) map->oflags = UDF_BLK_NEW | UDF_BLK_MAPPED; iinfo->i_next_alloc_block = map->lblk + 1; iinfo->i_next_alloc_goal = newblocknum + 1; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (IS_SYNC(inode)) udf_sync_inode(inode); @@ -1298,7 +1298,7 @@ int udf_setsize(struct inode *inode, loff_t newsize) goto out_unlock; } update_time: - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); if (IS_SYNC(inode)) udf_sync_inode(inode); else @@ -1329,6 +1329,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) int bs = inode->i_sb->s_blocksize; int ret = -EIO; uint32_t uid, gid; + struct timespec64 ctime; reread: if (iloc->partitionReferenceNum >= sbi->s_partitions) { @@ -1507,7 +1508,8 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) udf_disk_stamp_to_time(&inode->i_atime, fe->accessTime); udf_disk_stamp_to_time(&inode->i_mtime, fe->modificationTime); - udf_disk_stamp_to_time(&inode->i_ctime, fe->attrTime); + udf_disk_stamp_to_time(&ctime, fe->attrTime); + inode_set_ctime_to_ts(inode, ctime); iinfo->i_unique = le64_to_cpu(fe->uniqueID); iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); @@ -1522,7 +1524,8 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) udf_disk_stamp_to_time(&inode->i_atime, efe->accessTime); udf_disk_stamp_to_time(&inode->i_mtime, efe->modificationTime); udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); - udf_disk_stamp_to_time(&inode->i_ctime, efe->attrTime); + udf_disk_stamp_to_time(&ctime, efe->attrTime); + inode_set_ctime_to_ts(inode, ctime); iinfo->i_unique = le64_to_cpu(efe->uniqueID); iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); @@ -1799,7 +1802,7 @@ static int udf_update_inode(struct inode *inode, int do_sync) udf_time_to_disk_stamp(&fe->accessTime, inode->i_atime); udf_time_to_disk_stamp(&fe->modificationTime, inode->i_mtime); - udf_time_to_disk_stamp(&fe->attrTime, inode->i_ctime); + udf_time_to_disk_stamp(&fe->attrTime, inode_get_ctime(inode)); memset(&(fe->impIdent), 0, sizeof(struct regid)); strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; @@ -1830,12 +1833,12 @@ static int udf_update_inode(struct inode *inode, int do_sync) udf_adjust_time(iinfo, inode->i_atime); udf_adjust_time(iinfo, inode->i_mtime); - udf_adjust_time(iinfo, inode->i_ctime); + udf_adjust_time(iinfo, inode_get_ctime(inode)); udf_time_to_disk_stamp(&efe->accessTime, inode->i_atime); udf_time_to_disk_stamp(&efe->modificationTime, inode->i_mtime); udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); - udf_time_to_disk_stamp(&efe->attrTime, inode->i_ctime); + udf_time_to_disk_stamp(&efe->attrTime, inode_get_ctime(inode)); memset(&(efe->impIdent), 0, sizeof(efe->impIdent)); strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); diff --git a/fs/udf/namei.c b/fs/udf/namei.c index a95579b043ab..ae55ab8859b6 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -365,7 +365,7 @@ static int udf_add_nondir(struct dentry *dentry, struct inode *inode) *(__le32 *)((struct allocDescImpUse *)iter.fi.icb.impUse)->impUse = cpu_to_le32(iinfo->i_unique & 0x00000000FFFFFFFFUL); udf_fiiter_write_fi(&iter, NULL); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); udf_fiiter_release(&iter); udf_add_fid_counter(dir->i_sb, false, 1); @@ -471,7 +471,7 @@ static int udf_mkdir(struct mnt_idmap *idmap, struct inode *dir, udf_fiiter_release(&iter); udf_add_fid_counter(dir->i_sb, true, 1); inc_nlink(dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); d_instantiate_new(dentry, inode); @@ -523,8 +523,8 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) inode->i_size = 0; inode_dec_link_count(dir); udf_add_fid_counter(dir->i_sb, true, -1); - inode->i_ctime = dir->i_ctime = dir->i_mtime = - current_time(inode); + dir->i_mtime = inode_set_ctime_to_ts(dir, + inode_set_ctime_current(inode)); mark_inode_dirty(dir); ret = 0; end_rmdir: @@ -555,11 +555,11 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) set_nlink(inode, 1); } udf_fiiter_delete_entry(&iter); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); inode_dec_link_count(inode); udf_add_fid_counter(dir->i_sb, false, -1); - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); ret = 0; end_unlink: udf_fiiter_release(&iter); @@ -746,9 +746,9 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir, inc_nlink(inode); udf_add_fid_counter(dir->i_sb, false, 1); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); ihold(inode); d_instantiate(dentry, inode); @@ -833,7 +833,7 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); mark_inode_dirty(old_inode); /* @@ -861,13 +861,13 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir, } if (new_inode) { - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); inode_dec_link_count(new_inode); udf_add_fid_counter(old_dir->i_sb, S_ISDIR(new_inode->i_mode), -1); } - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); - new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); + old_dir->i_mtime = inode_set_ctime_current(old_dir); + new_dir->i_mtime = inode_set_ctime_current(new_dir); mark_inode_dirty(old_dir); mark_inode_dirty(new_dir); From patchwork Wed Jul 5 19:01:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096261vqx; Wed, 5 Jul 2023 12:42:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlHnm+mZXpx5o8I6FVfFIYew0HjCVTrW+gPOWAsSrUJ+9wydppZk6iqPXSv3+JTVoW+O2COP X-Received: by 2002:a05:6a00:2d84:b0:66a:386c:e6a6 with SMTP id fb4-20020a056a002d8400b0066a386ce6a6mr21943686pfb.6.1688586127169; Wed, 05 Jul 2023 12:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586127; cv=none; d=google.com; s=arc-20160816; b=S25VgHi4eOGA6v5vq2V0xON3/KZBYAvYY3DQSi7/ya73AXn28BRKx5ZWP+WYH8fmJD /9OntZgJwjFEhBd3prXX9QoCS1Pef9Kqk0zDQx0tD4J5pSp6YMLPXLXCa3/TgfItcK3C pR+SzBzokyLIPVdn1XQCrkB3XPZQKTpb+l0FZLLGSavwRd848J6Yx4C5fbQxdh8+x0O3 RItzArinWiTl7JTfrNzx4yOySdfZtzsO09f3jT0F/A1IKZChrdYQSryYo0Awr3ujmeuH 6cfgaDDlxzSSKM2mXL4+nWPZRaLsrIMtVtFHVDSNDCyyjddho58/l9EjImseg9USUk8N rTfQ== 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=JOCVomXKkynzcadeJV6v/CipHPp/vt44sJRIELuagac=; fh=FCpRC8mHr6eNwrHOaCyDgjyuwHH/x513FiK7Z9/ROBc=; b=fq7RKJ0rkJ78uueEIAq6mPzLglBCUboZ8K+BQZXIhdxMwDRGBIXqBBCciGPiX+YrJP y1S7wwk71568+htTgoayYP3IRjASPcn8pjN6Ywk+FbM2ZK3wt9D3vfW2uBWSrePzgBnV D5cnB02RRphUnbZ5UBtnLYWPszShNBAnwwwGos/3qDbEiEj03CQU5NF7QBivrl4MXJaV 5hqb997RCjRg82wT9ajY1bjMtCX0d8nbqrNqGxDagWyjKg09at2bmcT0d+tgOPn88snm bW844cmwR+ec06nVWyZG0oyox1ybfRzRnAURzzhOmkKMC37U8yU3BxScF9n++hqsg39C mqzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="g/ks/Box"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv12-20020a056a00414c00b00676fd3ad23dsi20779902pfb.384.2023.07.05.12.41.54; Wed, 05 Jul 2023 12:42:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="g/ks/Box"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234045AbjGETJm (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234228AbjGETIi (ORCPT ); Wed, 5 Jul 2023 15:08:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F383A90; Wed, 5 Jul 2023 12:05:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BBC986170C; Wed, 5 Jul 2023 19:05:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DEE8C433C7; Wed, 5 Jul 2023 19:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583929; bh=N41sRvjWUM+giT4o3DhV73SdjvTXgpcGef0e4/i5ocI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g/ks/Box9NsEnOZQZvnpvhRQ/USiaZ3FgZrclMtifuYNtg+IL69Jmh62tTnfUXje/ gK4OhCeeZZ8HcdybEe7MXgXYqjLC16dt6olv95JTzqp3KHaiIKkafvONho9tubIKWz BvK/MSBJDZ0uKdwZDDY0DQb0v0Wdofjivy8L3881bPLMBHCRSVp9MBWsPHnQJ4v9Yy PeHAjw1cgrzb/fRk0wO/cRRQe1lZFmBXmDVCeLxc3rYg6E6G7pNvJ4TszMOKV0p5N7 EeRwW6vQiWuS2nolqi5GFFM1G6pHF5r53c35BvSULk5xuP09D/tGQOvZJUmKn2cCFh FV4nTh24U1YoA== From: Jeff Layton To: Christian Brauner , Evgeniy Dushistov Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 80/92] ufs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:45 -0400 Message-ID: <20230705190309.579783-78-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610886630379789?= X-GMAIL-MSGID: =?utf-8?q?1770610886630379789?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/ufs/dir.c | 6 +++--- fs/ufs/ialloc.c | 2 +- fs/ufs/inode.c | 23 +++++++++++++---------- fs/ufs/namei.c | 8 ++++---- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index 379d75796a5c..fd57f03b6c93 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c @@ -107,7 +107,7 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, ufs_commit_chunk(page, pos, len); ufs_put_page(page); if (update_times) - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); ufs_handle_dirsync(dir); } @@ -397,7 +397,7 @@ int ufs_add_link(struct dentry *dentry, struct inode *inode) ufs_set_de_type(sb, de, inode->i_mode); ufs_commit_chunk(page, pos, rec_len); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); mark_inode_dirty(dir); err = ufs_handle_dirsync(dir); @@ -539,7 +539,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, pde->d_reclen = cpu_to_fs16(sb, to - from); dir->d_ino = 0; ufs_commit_chunk(page, pos, to - from); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); err = ufs_handle_dirsync(inode); out: diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index 06bd84d555bd..a1e7bd9d1f98 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c @@ -292,7 +292,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_blocks = 0; inode->i_generation = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); ufsi->i_flags = UFS_I(dir)->i_flags; ufsi->i_lastfrag = 0; ufsi->i_shadow = 0; diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index a4246c83a8cd..21a4779a2de5 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -296,7 +296,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned index, if (new) *new = 1; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (IS_SYNC(inode)) ufs_sync_inode (inode); mark_inode_dirty(inode); @@ -378,7 +378,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block, mark_buffer_dirty(bh); if (IS_SYNC(inode)) sync_dirty_buffer(bh); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); mark_inode_dirty(inode); out: brelse (bh); @@ -580,11 +580,12 @@ static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode) inode->i_size = fs64_to_cpu(sb, ufs_inode->ui_size); inode->i_atime.tv_sec = (signed)fs32_to_cpu(sb, ufs_inode->ui_atime.tv_sec); - inode->i_ctime.tv_sec = (signed)fs32_to_cpu(sb, ufs_inode->ui_ctime.tv_sec); + inode_set_ctime(inode, + (signed)fs32_to_cpu(sb, ufs_inode->ui_ctime.tv_sec), + 0); inode->i_mtime.tv_sec = (signed)fs32_to_cpu(sb, ufs_inode->ui_mtime.tv_sec); inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; inode->i_blocks = fs32_to_cpu(sb, ufs_inode->ui_blocks); inode->i_generation = fs32_to_cpu(sb, ufs_inode->ui_gen); ufsi->i_flags = fs32_to_cpu(sb, ufs_inode->ui_flags); @@ -626,10 +627,10 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode) inode->i_size = fs64_to_cpu(sb, ufs2_inode->ui_size); inode->i_atime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_atime); - inode->i_ctime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_ctime); + inode_set_ctime(inode, fs64_to_cpu(sb, ufs2_inode->ui_ctime), + fs32_to_cpu(sb, ufs2_inode->ui_ctimensec)); inode->i_mtime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_mtime); inode->i_atime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_atimensec); - inode->i_ctime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_ctimensec); inode->i_mtime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_mtimensec); inode->i_blocks = fs64_to_cpu(sb, ufs2_inode->ui_blocks); inode->i_generation = fs32_to_cpu(sb, ufs2_inode->ui_gen); @@ -726,7 +727,8 @@ static void ufs1_update_inode(struct inode *inode, struct ufs_inode *ufs_inode) ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); ufs_inode->ui_atime.tv_sec = cpu_to_fs32(sb, inode->i_atime.tv_sec); ufs_inode->ui_atime.tv_usec = 0; - ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, inode->i_ctime.tv_sec); + ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, + inode_get_ctime(inode).tv_sec); ufs_inode->ui_ctime.tv_usec = 0; ufs_inode->ui_mtime.tv_sec = cpu_to_fs32(sb, inode->i_mtime.tv_sec); ufs_inode->ui_mtime.tv_usec = 0; @@ -770,8 +772,9 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode) ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); ufs_inode->ui_atime = cpu_to_fs64(sb, inode->i_atime.tv_sec); ufs_inode->ui_atimensec = cpu_to_fs32(sb, inode->i_atime.tv_nsec); - ufs_inode->ui_ctime = cpu_to_fs64(sb, inode->i_ctime.tv_sec); - ufs_inode->ui_ctimensec = cpu_to_fs32(sb, inode->i_ctime.tv_nsec); + ufs_inode->ui_ctime = cpu_to_fs64(sb, inode_get_ctime(inode).tv_sec); + ufs_inode->ui_ctimensec = cpu_to_fs32(sb, + inode_get_ctime(inode).tv_nsec); ufs_inode->ui_mtime = cpu_to_fs64(sb, inode->i_mtime.tv_sec); ufs_inode->ui_mtimensec = cpu_to_fs32(sb, inode->i_mtime.tv_nsec); @@ -1205,7 +1208,7 @@ static int ufs_truncate(struct inode *inode, loff_t size) truncate_setsize(inode, size); ufs_truncate_blocks(inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); mark_inode_dirty(inode); out: UFSD("EXIT: err %d\n", err); diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 36154b5aca6d..9cad29463791 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -153,7 +153,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir, struct inode *inode = d_inode(old_dentry); int error; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -220,7 +220,7 @@ static int ufs_unlink(struct inode *dir, struct dentry *dentry) if (err) goto out; - inode->i_ctime = dir->i_ctime; + inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); inode_dec_link_count(inode); err = 0; out: @@ -282,7 +282,7 @@ static int ufs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (!new_de) goto out_dir; ufs_set_link(new_dir, new_de, new_page, old_inode, 1); - new_inode->i_ctime = current_time(new_inode); + inode_set_ctime_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); @@ -298,7 +298,7 @@ static int ufs_rename(struct mnt_idmap *idmap, struct inode *old_dir, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); ufs_delete_entry(old_dir, old_de, old_page); mark_inode_dirty(old_inode); From patchwork Wed Jul 5 19:01:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097353vqx; Wed, 5 Jul 2023 12:44:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlH6AiuPpdM7e4v/B9uZJ3yXMPL4McYIiDkp8y+/f8zPFGoBY9ykR5paEU9DoGyUShR9nWmx X-Received: by 2002:a17:902:d2cd:b0:1b8:1b79:a76d with SMTP id n13-20020a170902d2cd00b001b81b79a76dmr15017332plc.44.1688586273991; Wed, 05 Jul 2023 12:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586273; cv=none; d=google.com; s=arc-20160816; b=yFYlSjEEeDFR4aOqa3JIpzaF0DosQwlnjLip+7Nha1EL5SWnsaiEd9+ylktMhEPt+I q4a4ox1hONaJuIn708uixtTdx9F7Dw/xZFv6gGTAQikm4d5Jr3LsmbXCOJw48ead2vFF ejA9QXRXXhVpMUqhWMXfL0pzCAjVSpWnovieVt2NOG2g+eBaPsuir6DhrSaUP89R+fXb Uv/opK2o5kgMZKW+jWXVZxyDg/sMnr82JhOtiyqUZuhwM3G5O8Un1KYBJTp3wVbX99M5 XRVuI/+87hHvBJn3F26igPWsQXzGMtGmlCBx69QaPiyJdxFHCZhIAvlRgmeAaPj3Rc1f lkRA== 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=8+bHHJJWzCF9sTv49H1MVLn00fGzGKKTJy9ZmjDfP+A=; fh=Ymp1Y9C7WBNmhkDN6gtVgzAgIg8luwb7880rVddRqnk=; b=z80cSuOidERLNGv4uh0N38S71SzKbwQT2jxW/gQCkzP3181Ty/Tk+fHHgZz/Tf/Mr4 4k8oHKhQSPdRJTf+nRWK7rs2TEdA37Kq0TnfYxBANSFPjPHKcKfE1bM7MZRj7RmoFGDb a47pReQjwkcQzocCqzOxDEGUK4z5OShIIjtAWDzNVoiUhWRKCoHWyyUM2ztp9PR1PC69 ZYNKYrjIy3KwpSA6forSkbqwiSrlj4RhV4N+ZeTLEQEchiSoNS9cjYdUqrUi2Hgcf/pT pMmKjh0aU8+7sziGupEUDANCXsMkxe2ElxDMXFdLSyv2akWFJmDqFzBQ3Vr8pZqoLoif ie+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WHsbj5r0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902c40f00b001b20e2ba8e1si5823852plk.23.2023.07.05.12.44.18; Wed, 05 Jul 2023 12:44:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WHsbj5r0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234070AbjGETKF (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234242AbjGETIj (ORCPT ); Wed, 5 Jul 2023 15:08:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD5F3A9B; Wed, 5 Jul 2023 12:05:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A9D0616F9; Wed, 5 Jul 2023 19:05:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E074CC433C8; Wed, 5 Jul 2023 19:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583930; bh=44HUiQLthdvp35Vl8UfXmn2JgpqIpKZ+sVAddJOP8s4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WHsbj5r0fS8qV6pGFoQVuP49IY+vzc/K6Ko2Cq3y0QofnlVTuw04RkEE2vr+qFvjd ACBVjH2DoPeWzol0YC5NzgnOx1VP52vTkPUg38GC/MAGNzCGxK0waiZo2i9DwuSBqP hHQUBQ9RwUuDR/p/2hJJOVin1/e0aH+hkhwR+mVNzo7S66rQ7oL5rydLgGYEUnSiXe Yde+cOShAbiA7SaG4sHFYltota81jbZhg4LtvNMc6Epz+2LBpLQYwyEfLg58uPEQwS 38cBcaGkKIOMAC79JsNsoFpqZhoTgRskpoxe0MzThGCtTqIZEaBcsQoWuVTKGLYR7Q XUf62bVTWWvEA== From: Jeff Layton To: Christian Brauner , Hans de Goede Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 81/92] vboxsf: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:46 -0400 Message-ID: <20230705190309.579783-79-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611041048846513?= X-GMAIL-MSGID: =?utf-8?q?1770611041048846513?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/vboxsf/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c index dd0ae1188e87..576b91d571c5 100644 --- a/fs/vboxsf/utils.c +++ b/fs/vboxsf/utils.c @@ -128,8 +128,8 @@ int vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode, inode->i_atime = ns_to_timespec64( info->access_time.ns_relative_to_unix_epoch); - inode->i_ctime = ns_to_timespec64( - info->change_time.ns_relative_to_unix_epoch); + inode_set_ctime_to_ts(inode, + ns_to_timespec64(info->change_time.ns_relative_to_unix_epoch)); inode->i_mtime = ns_to_timespec64( info->modification_time.ns_relative_to_unix_epoch); return 0; From patchwork Wed Jul 5 19:01:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096758vqx; Wed, 5 Jul 2023 12:43:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73D03EEwz31wNiG5pzMulq5aOiB5LaVIQm6AndSUtYaTXD01Zo3RcFtzow77yh3mAz2yAG X-Received: by 2002:a05:6870:d1c6:b0:1b0:84df:50ec with SMTP id b6-20020a056870d1c600b001b084df50ecmr21586817oac.50.1688586198309; Wed, 05 Jul 2023 12:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586198; cv=none; d=google.com; s=arc-20160816; b=xbUCX8/3tm6Mnbl5CpxjjihmR6Q7k089JC95PHtXGe1Nilr9B82EHM26SqENB4tuEd EZSFS8W2F4yxM/DbPP1z6AO1jcubaVXEW7G1ifB4dB57COd7PS9PlC7XYsACdK1km++d ttA6F89kvBFWSCccEFhST28vjICMC2uuLWAEJmEuN+CKUvf57MpLa7IghRocsILmZf4B sx/mV+IRC0drc5NK4p45WllmGLqwkIPuHFIqP233v4z7qNB0tH0wa6JoR4sv+uyxU9Rz /LslZcDm4vjN9AjKtE22bcIifR4PquPt9avHqH7O6igRkfwP1G/WryTp6/mVwsf159ER Ufpw== 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=YRaRol5pNS+JP5puvvM2veTJvZnwjtAqZAYrrNF67f0=; fh=0WPwm1zDOxivXmw+QfvxcSHTh3lQuZIG+6dddNeTDwE=; b=ZQOQf9oh+W6jiKoqp9dk2Bj9EgCNuJlNuL2Fh54xwkakMcxi9L4umB8YgKw8a/bhOt 2657YDrhlqpEoPz9EYyHnuQJfYOnl1XWRkDZlLzm9u9tkmdlqTOAAegmFWINrzppCKlg iZyIIY5RnhzK83pDY6lhotvwP2nXUJqxZl0gXwCtNJ4f2yp37ceOp7AwkMw45Y7R51WR GpC6Ykr3j21nExR51WCVNSRnqfyi4zGHCYAxpioNjm4wsknyLo/Nuc1AK0nMVDaNt9T/ b28tWpxvijqDKGgJnmw6KyN27y8T8IvxrfjIuTjWrH7VUVCzmSO1eYMxcjMXPCY5HQ6Q 9dHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o1mQShMy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi16-20020a17090b1e5000b0025bcbba10c6si2595196pjb.85.2023.07.05.12.43.03; Wed, 05 Jul 2023 12:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o1mQShMy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234085AbjGETKZ (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233373AbjGETIl (ORCPT ); Wed, 5 Jul 2023 15:08:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03A543AA7; Wed, 5 Jul 2023 12:05:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C3C3C61713; Wed, 5 Jul 2023 19:05:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8172BC433C8; Wed, 5 Jul 2023 19:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583933; bh=wOEdHgPAOR7irhsVE9RE6wxCMaMe3r8tynspxCtlVZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o1mQShMyEPgS+lIlnXfDr690Chd4tqVtaCWW1deRvvqBIV37+ojoRWr9lnYUAvjjG Hod+T2pHnqm7CYcVEmPYULnBt7GEMCb7ejtp/iwG4zkobMLWje+r4mwYTvI9i2+84D LzcjUOwSpJmQ8SRZFCbgDYuHO7d0HJ/7blaIkL7+dzubLizRLoouYREysRGj+RsZXD VLvEbdgPMfYwsM6eLYHctj7v7eQtiI5klHcLU8LgsGHYsCTKnK6zg3+W6jX2Inip0M EPdRiSQWYaSyE4kbmr0d3JxJXWlrCzFcVHIweraoG8jcrGRuV3r+fGt8A+27Wpyaoj rE9wWxqgEA0Cw== From: Jeff Layton To: Christian Brauner , "Darrick J. Wong" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH v2 82/92] xfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:47 -0400 Message-ID: <20230705190309.579783-80-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610961172284328?= X-GMAIL-MSGID: =?utf-8?q?1770610961172284328?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/xfs/libxfs/xfs_inode_buf.c | 5 +++-- fs/xfs/libxfs/xfs_trans_inode.c | 2 +- fs/xfs/xfs_acl.c | 2 +- fs/xfs/xfs_bmap_util.c | 6 ++++-- fs/xfs/xfs_inode.c | 3 +-- fs/xfs/xfs_inode_item.c | 2 +- fs/xfs/xfs_iops.c | 4 ++-- fs/xfs/xfs_itable.c | 4 ++-- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 758aacd8166b..a35781577cad 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -222,7 +222,8 @@ xfs_inode_from_disk( */ inode->i_atime = xfs_inode_from_disk_ts(from, from->di_atime); inode->i_mtime = xfs_inode_from_disk_ts(from, from->di_mtime); - inode->i_ctime = xfs_inode_from_disk_ts(from, from->di_ctime); + inode_set_ctime_to_ts(inode, + xfs_inode_from_disk_ts(from, from->di_ctime)); ip->i_disk_size = be64_to_cpu(from->di_size); ip->i_nblocks = be64_to_cpu(from->di_nblocks); @@ -316,7 +317,7 @@ xfs_inode_to_disk( to->di_atime = xfs_inode_to_disk_ts(ip, inode->i_atime); to->di_mtime = xfs_inode_to_disk_ts(ip, inode->i_mtime); - to->di_ctime = xfs_inode_to_disk_ts(ip, inode->i_ctime); + to->di_ctime = xfs_inode_to_disk_ts(ip, inode_get_ctime(inode)); to->di_nlink = cpu_to_be32(inode->i_nlink); to->di_gen = cpu_to_be32(inode->i_generation); to->di_mode = cpu_to_be16(inode->i_mode); diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c index cb4796b6e693..6b2296ff248a 100644 --- a/fs/xfs/libxfs/xfs_trans_inode.c +++ b/fs/xfs/libxfs/xfs_trans_inode.c @@ -67,7 +67,7 @@ xfs_trans_ichgtime( if (flags & XFS_ICHGTIME_MOD) inode->i_mtime = tv; if (flags & XFS_ICHGTIME_CHG) - inode->i_ctime = tv; + inode_set_ctime_to_ts(inode, tv); if (flags & XFS_ICHGTIME_CREATE) ip->i_crtime = tv; } diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index 791db7d9c849..6b840301817a 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -233,7 +233,7 @@ xfs_acl_set_mode( xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); if (xfs_has_wsync(mp)) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index fbb675563208..fcefab687285 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1644,6 +1644,7 @@ xfs_swap_extents( uint64_t f; int resblks = 0; unsigned int flags = 0; + struct timespec64 ctime; /* * Lock the inodes against other IO, page faults and truncate to @@ -1756,8 +1757,9 @@ xfs_swap_extents( * process that the file was not changed out from * under it. */ - if ((sbp->bs_ctime.tv_sec != VFS_I(ip)->i_ctime.tv_sec) || - (sbp->bs_ctime.tv_nsec != VFS_I(ip)->i_ctime.tv_nsec) || + ctime = inode_get_ctime(VFS_I(ip)); + if ((sbp->bs_ctime.tv_sec != ctime.tv_sec) || + (sbp->bs_ctime.tv_nsec != ctime.tv_nsec) || (sbp->bs_mtime.tv_sec != VFS_I(ip)->i_mtime.tv_sec) || (sbp->bs_mtime.tv_nsec != VFS_I(ip)->i_mtime.tv_nsec)) { error = -EBUSY; diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 9e62cc500140..360fe83a334f 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -843,10 +843,9 @@ xfs_init_new_inode( ip->i_df.if_nextents = 0; ASSERT(ip->i_nblocks == 0); - tv = current_time(inode); + tv = inode_set_ctime_current(inode); inode->i_mtime = tv; inode->i_atime = tv; - inode->i_ctime = tv; ip->i_extsize = 0; ip->i_diflags = 0; diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 91c847a84e10..127b2410eb20 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -528,7 +528,7 @@ xfs_inode_to_log_dinode( memset(to->di_pad3, 0, sizeof(to->di_pad3)); to->di_atime = xfs_inode_to_log_dinode_ts(ip, inode->i_atime); to->di_mtime = xfs_inode_to_log_dinode_ts(ip, inode->i_mtime); - to->di_ctime = xfs_inode_to_log_dinode_ts(ip, inode->i_ctime); + to->di_ctime = xfs_inode_to_log_dinode_ts(ip, inode_get_ctime(inode)); to->di_nlink = inode->i_nlink; to->di_gen = inode->i_generation; to->di_mode = inode->i_mode; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 24718adb3c16..3a9363953ef2 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -574,7 +574,7 @@ xfs_vn_getattr( stat->ino = ip->i_ino; stat->atime = inode->i_atime; stat->mtime = inode->i_mtime; - stat->ctime = inode->i_ctime; + stat->ctime = inode_get_ctime(inode); stat->blocks = XFS_FSB_TO_BB(mp, ip->i_nblocks + ip->i_delayed_blks); if (xfs_has_v3inodes(mp)) { @@ -1055,7 +1055,7 @@ xfs_vn_update_time( xfs_ilock(ip, XFS_ILOCK_EXCL); if (flags & S_CTIME) - inode->i_ctime = *now; + inode_set_ctime_to_ts(inode, *now); if (flags & S_MTIME) inode->i_mtime = *now; if (flags & S_ATIME) diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index f225413a993c..c2093cb56092 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -100,8 +100,8 @@ xfs_bulkstat_one_int( buf->bs_atime_nsec = inode->i_atime.tv_nsec; buf->bs_mtime = inode->i_mtime.tv_sec; buf->bs_mtime_nsec = inode->i_mtime.tv_nsec; - buf->bs_ctime = inode->i_ctime.tv_sec; - buf->bs_ctime_nsec = inode->i_ctime.tv_nsec; + buf->bs_ctime = inode_get_ctime(inode).tv_sec; + buf->bs_ctime_nsec = inode_get_ctime(inode).tv_nsec; buf->bs_gen = inode->i_generation; buf->bs_mode = inode->i_mode; From patchwork Wed Jul 5 19:01:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097579vqx; Wed, 5 Jul 2023 12:45:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFNYOVHM3Hve5wOrRTiC16CvkWmAlyojK18k1Cf3cy76IKpABQHDo+ux2yyJ3uo9lN6FWqw X-Received: by 2002:a05:6a20:2595:b0:126:5ffd:c5b7 with SMTP id k21-20020a056a20259500b001265ffdc5b7mr112585pzd.22.1688586307154; Wed, 05 Jul 2023 12:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586307; cv=none; d=google.com; s=arc-20160816; b=0E0N2b88js+H2Wi+IW6hA05sRymZ7XMOZOCtdJhHvuBfF+BU8NF/CNuCqq96bYTfdn IRqj4/y7ZjxdNdZ4I5RZygbO3silqe/f03QAdk0m1g52muvEoXS/9JZ4vcWNp6IR8pom i7i3wM1BJvr/5ZZpbSgjRPliVL+CyftiC8ZH8YUoeasAz5t8hInr7wgN4flS/CodamFU 0NdDl3Ygfui0LQcZn6wMYRv5P+Sslm/FDnOO8JHkb/NCD4lTOkYFrqfYALhPP2B48wW/ xEw2U6j3UTEhNMsyEtN81tW8CnpyOEKReSNKqoa1Scer1d9QMSvLKeqsg2s5fVP1eot/ /THQ== 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=iVH0ODKj9xrYjsqkKlQRc5cSls88JQbMRsmihy29JVs=; fh=Nb5M9mUNR71fvhOUuW8lXNObXvR+P8mbgKOmxFjIIdI=; b=LCVmAw57i1l/WtSgi8/+hZ5FmTgLk0RiKwV89ROOG+38Sq6bwdcz1TVHbwhLsM0ivf +4XUayaBWN1SuYOk/u2uadtD1yOWmMPQvWfJUxwoxPVT/kxxmylajusC6+6BmWGJAqKf rspKtR5bI78EaIyD2dbA6pSPsFkhmf/MHHJb/GG5NZ1JOJU679cM3wTFSF2HRCZ1EJBW cu2upURQW97OUhEy0IGe7pzEb1/Gm1B8poJirpCocAI3OeKcQXVwEYD4grEX+M/i8GRy tuDMsz6ZreB83rK8NWVi0H97bMgbKeiLsYBpgy/q8+LFWh2yJs0sx/z9EotXLG0tpYCz S8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CXrkzL2s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a056a00150900b00682c1cd974asi671545pfu.379.2023.07.05.12.44.53; Wed, 05 Jul 2023 12:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CXrkzL2s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233847AbjGETK2 (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbjGETIm (ORCPT ); Wed, 5 Jul 2023 15:08:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F338819A2; Wed, 5 Jul 2023 12:05:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 568E161702; Wed, 5 Jul 2023 19:05:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0063AC433C7; Wed, 5 Jul 2023 19:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583934; bh=3sp7OmcXVbe5zYzTxLB6I6YtUeT1soXk8Hp0RuH3SJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXrkzL2spbbappNHiT8iNIbL27Oyus1z08ocp1va0NyNPq9oRvpQ1kcmrnZeJJVkI F1v3lmptBoZi+Vc1Z0Ka9bpXjSDJdH1cjnhi87SQoeY5txF4eqSPlZf6aedJPdA3YI 6pV7JPX0/E8KkUivWlWkhH+qlm/XNCJo3IQcO5VFLRxClc1upAmSDdpZa+Zs3iwFrQ 4tfC78X0lU4Fh7+ArU2+Smf3jXdwJgPhcKFnmJz/t8i9ASJXMabyfeV4vdVf2Da0d0 iUzyljBH7cYr+75eftkoVsj8LLe/26Mg6zn63dRkqLwloGqFSa7MycG/KQ4Zy8FVfa 95WGghGW5aAOA== From: Jeff Layton To: Christian Brauner , Damien Le Moal , Naohiro Aota , Johannes Thumshirn Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 83/92] zonefs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:48 -0400 Message-ID: <20230705190309.579783-81-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611076059809537?= X-GMAIL-MSGID: =?utf-8?q?1770611076059809537?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Damien Le Moal Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/zonefs/super.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index bbe44a26a8e5..eaaa23cf6d93 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -658,7 +658,8 @@ static struct inode *zonefs_get_file_inode(struct inode *dir, inode->i_ino = ino; inode->i_mode = z->z_mode; - inode->i_ctime = inode->i_mtime = inode->i_atime = dir->i_ctime; + inode->i_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, + inode_get_ctime(dir)); inode->i_uid = z->z_uid; inode->i_gid = z->z_gid; inode->i_size = z->z_wpoffset; @@ -694,7 +695,8 @@ static struct inode *zonefs_get_zgroup_inode(struct super_block *sb, inode->i_ino = ino; inode_init_owner(&nop_mnt_idmap, inode, root, S_IFDIR | 0555); inode->i_size = sbi->s_zgroup[ztype].g_nr_zones; - inode->i_ctime = inode->i_mtime = inode->i_atime = root->i_ctime; + inode->i_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, + inode_get_ctime(root)); inode->i_private = &sbi->s_zgroup[ztype]; set_nlink(inode, 2); @@ -1317,7 +1319,7 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) inode->i_ino = bdev_nr_zones(sb->s_bdev); inode->i_mode = S_IFDIR | 0555; - inode->i_ctime = inode->i_mtime = inode->i_atime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_op = &zonefs_dir_inode_operations; inode->i_fop = &zonefs_dir_operations; inode->i_size = 2; From patchwork Wed Jul 5 19:01:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116389 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097802vqx; Wed, 5 Jul 2023 12:45:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0mOk3P/1P0VuiBnD2ihLadU6+Eu4V1iwCpOU3rCmfb+QTSe6471aEeJx9yV1C1gRzWXr0 X-Received: by 2002:a05:6a00:99c:b0:681:eddd:51fb with SMTP id u28-20020a056a00099c00b00681eddd51fbmr23424119pfg.18.1688586335554; Wed, 05 Jul 2023 12:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586335; cv=none; d=google.com; s=arc-20160816; b=SKrvJLzVZLDRs3ZRlKfw0FyXSl1RdlG/y6njJ9HAoDrCnDDkGtmbdXX2Tdvm+skxUT oG4oyRHlbpwLqwIIiLRyDJMI1pVSsNUr1idBf1PEMNNWpy1GW2tmuQmm3F2s0Gwn8px1 WAai10KTy0CwcnN+GI8TOhfczWtdiwTx7nsi16Bs30zqoq+wAvuSDLrThVDWiRwuI/31 SkXMO+7hLsz9uNj1WXReute65AHwzHHW2Qkl8WpUQ3zdpWNzuCZ+OsPnO+yBuNQqUdwR 0YfPYpmhephR4a0B6ZS0NZJ11+MCRgcDUR6OjmEVN6CBXfS7ZuUIdZMCNYlng9GM2y2v I6iw== 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=GSRuxb0KMgKsO/Rt3+rvbC4EqFsZFkfTkNeqKSSm89I=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=xbbyNs4gZHFw33ZuS8CzxXdhwteRiaRCeQmZZk06No6Mhigi9v41wUDK/CJ0+dKAZ5 4ZQuV6WADdpx3YfndV/Y5PppqpsbM1pwHTW/NnHWSGf4vFBwo+TpOn1jM9o2fXsxiuHA 4jQDQv0qzZDHAYgItcKsWaLU1sCdNs6MSrfmPhaC/9BYcwgaXqpKqA79Wp1WtU1nsx/u TSiPnPFqw4TqCtZxMzQzfAK8s8sMJWm07fptTx5imoWWj4RN2JXJun1IL6aH26H+AEce FYdKBw5CF1N8MpCp8SlnF/bF6F8X2XdXPr+txlbItRELuzpJqvhPmzbk2W7l/EtLtEcc X13A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gs5vb9BC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w70-20020a638249000000b0055acc7f8086si20959813pgd.821.2023.07.05.12.45.23; Wed, 05 Jul 2023 12:45:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gs5vb9BC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234101AbjGETKa (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233812AbjGETIn (ORCPT ); Wed, 5 Jul 2023 15:08:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08571BC5; Wed, 5 Jul 2023 12:05:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 99209616C4; Wed, 5 Jul 2023 19:05:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79B17C433C7; Wed, 5 Jul 2023 19:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583936; bh=hA94f6wyhm1dscTfqscmBzMcM3Ka33XMmF4YRR7LFAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gs5vb9BC62hWj2fkEaoviFSqLfo2N8woX+4CHRNL6DGgiWkzkXKb/HlarndUpvCaK 7aQYIkHFVUZjqXOeVmRrEJmNhiMo3KJRw25Xh7nsmNIMcVPrprEBBIAb1w35+Jf6Bx kkNUTezh4p78c/yPAaRaLT4W929h5r2fCcbTfNEsypPhg2aFqSCBI3N6Z1kx0NMoaA xSIYm0+cja1oYkzX8uiHuZd7vBCuOs3Y1zcf/ymo8gTicuCGegflAMz0PjIAb90J2w ojVHqPAl1fw8MPx3zhlLe21rP3ZV3vKwtlQRF3k562RheM6p4etqDVGbL5scbioS44 n4lOmlZWLZOOg== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 84/92] linux: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:49 -0400 Message-ID: <20230705190309.579783-82-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611105402648220?= X-GMAIL-MSGID: =?utf-8?q?1770611105402648220?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- include/linux/fs_stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h index 54210a42c30d..010d39d0dc1c 100644 --- a/include/linux/fs_stack.h +++ b/include/linux/fs_stack.h @@ -24,7 +24,7 @@ static inline void fsstack_copy_attr_times(struct inode *dest, { dest->i_atime = src->i_atime; dest->i_mtime = src->i_mtime; - dest->i_ctime = src->i_ctime; + inode_set_ctime_to_ts(dest, inode_get_ctime(src)); } #endif /* _LINUX_FS_STACK_H */ From patchwork Wed Jul 5 19:01:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116390 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097820vqx; Wed, 5 Jul 2023 12:45:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlHm9WILC5EhD2u0bjMSUzwrDBt1GJheHpuBCOarBfbXS7IleXsozZS9EVIvBu3HgPpk27f/ X-Received: by 2002:a17:90a:778c:b0:262:eb20:2dd8 with SMTP id v12-20020a17090a778c00b00262eb202dd8mr35098pjk.20.1688586337247; Wed, 05 Jul 2023 12:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586337; cv=none; d=google.com; s=arc-20160816; b=ksCAJvFPyZ3tutb0hj7TJPPNkPXPj82I9nRFXVQAlrxcPEwBtTuw4O8bmJmbsJYvvN hjNGpmygZtKDWnHnYndPvXthzKaz96+re1j3v2mO6xjMOSr7/w/rXDRCJ4pOYTMfE2XU Ul4dGyYcbkq3Y/QOK+4SdEqMdT+HVJo8N+IfvCftYn5uSX85wtnakJ3VsLjA5WXrGPqC DQtw7JD0li7joDGdkNLJgqWmx5vpH8BR5uZXeuOpCQsfdj+EeMZ3UdpylHx8NpNFNl9m 1Vfw34QGu8J3Mqj3umMpd29nZPSgGfImkC9XeoI1tZ0IL6IL7XM1ut3d4buklKEsuE0C 271w== 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=CqfBaALxnniNRyFAKFVTXfjCZ0tNYb4Ya6wsfYFM6K0=; fh=MnumwSc2Lu5kQ7dcvNoe84fV8IrhKdisdHLTZIbGVWE=; b=Wxi6UxvHMUqpTUYbToIw6/1xRchv3iHZkM7H97I4tK3Qe/GRm2I1fOqh1nzFVDPpak f0kzXz8GUpRnAWEn37hiakBA2hTNGj2/vzP6l3T2m6gy/Tpi2Z5vOLYLM6nYMi7pYvi0 YltTkF5Zq6BDUmTwLijDLPr0++joroagSzWX/DDdAXjjsY+2x+yo8MdmpSIEr2awrz6S jubE66ufP9MF2sHlzPzmoZTHtrclFYwZsvZ1w2iF1AguEWX1o5ccGJJakRB2OHpNsrAk +DVXnbr3sI6Y+/e5NXSnA5GAEsGz+AH/mn7T5YXu2hvQNXeSBlB51zC+hxYXJxaFHUiC c0+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wtdubbe1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a63c14b000000b0053f2551834fsi23298518pgi.552.2023.07.05.12.45.22; Wed, 05 Jul 2023 12:45:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wtdubbe1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233980AbjGETKp (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233945AbjGETJR (ORCPT ); Wed, 5 Jul 2023 15:09:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5253E3AB8; Wed, 5 Jul 2023 12:05:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E15BC61704; Wed, 5 Jul 2023 19:05:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB319C433C8; Wed, 5 Jul 2023 19:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583937; bh=gqeEXinsZAJRqeLTPU00VtiRMUUB3gXboIunzReeQAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wtdubbe1duEyifOHaqcAQuo4/6cpn1L9dcnjDU+DxOqBVhkq/TAZSeNocYisgEn+S /HgrB88MmBu6gTQG7bKp5Tn3bQ544teqcU+9ABqoPpHKW6P3xmf616eOiPR3sYNprC R3Rrxb8GbEsWqMZOle1a2yI6kKH6NLB4PQUDmxJlImeL93/HNMKIM8/yO/CUFb2aNl /CRyvvci20qr6FZryVwYgUAzqX0buYs308BLIyMGI1iXjyv7VJqK3Kd4A0SVZHTrEh xLgXZNOVIQRWqPFPW9ym7NLYctM3b7lW8eoRqZ/6CXEAa1wFrP7Y/wtxts3QJYyW4T 90fVEcbSqIaMA== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 85/92] mqueue: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:50 -0400 Message-ID: <20230705190309.579783-83-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611106758317748?= X-GMAIL-MSGID: =?utf-8?q?1770611106758317748?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- ipc/mqueue.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 71881bddad25..ba8215ed663a 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -302,7 +302,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_mtime = inode->i_ctime = inode->i_atime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); if (S_ISREG(mode)) { struct mqueue_inode_info *info; @@ -596,7 +596,7 @@ static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg) put_ipc_ns(ipc_ns); dir->i_size += DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); + dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); d_instantiate(dentry, inode); dget(dentry); @@ -618,7 +618,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); + dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); dir->i_size -= DIRENT_SIZE; drop_nlink(inode); dput(dentry); @@ -635,7 +635,8 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, size_t count, loff_t *off) { - struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); + struct inode *inode = file_inode(filp); + struct mqueue_inode_info *info = MQUEUE_I(inode); char buffer[FILENT_SIZE]; ssize_t ret; @@ -656,7 +657,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, if (ret <= 0) return ret; - file_inode(filp)->i_atime = file_inode(filp)->i_ctime = current_time(file_inode(filp)); + inode->i_atime = inode_set_ctime_current(inode); return ret; } @@ -1162,8 +1163,7 @@ static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, goto out_unlock; __do_notify(info); } - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); } out_unlock: spin_unlock(&info->lock); @@ -1257,8 +1257,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, msg_ptr = msg_get(info); - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); /* There is now free space in queue. */ pipelined_receive(&wake_q, info); @@ -1396,7 +1395,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) if (notification == NULL) { if (info->notify_owner == task_tgid(current)) { remove_notification(info); - inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_atime = inode_set_ctime_current(inode); } } else if (info->notify_owner != NULL) { ret = -EBUSY; @@ -1422,7 +1421,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) info->notify_owner = get_pid(task_tgid(current)); info->notify_user_ns = get_user_ns(current_user_ns()); - inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_atime = inode_set_ctime_current(inode); } spin_unlock(&info->lock); out_fput: @@ -1485,7 +1484,7 @@ static int do_mq_getsetattr(int mqdes, struct mq_attr *new, struct mq_attr *old) f.file->f_flags &= ~O_NONBLOCK; spin_unlock(&f.file->f_lock); - inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_atime = inode_set_ctime_current(inode); } spin_unlock(&info->lock); From patchwork Wed Jul 5 19:01:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2092404vqx; Wed, 5 Jul 2023 12:33:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGygvSvjt58NRQj6DIxOsiiJgDZi3jodfHwMyseVU0GJ+Nakr1KkilT5szF/tBqrIIPH0yl X-Received: by 2002:a17:902:e5c1:b0:1b6:9551:e297 with SMTP id u1-20020a170902e5c100b001b69551e297mr15737828plf.44.1688585617074; Wed, 05 Jul 2023 12:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585617; cv=none; d=google.com; s=arc-20160816; b=me1ZJz/sb07jdEcc7f+fLo7JbBk8x5Yv1XauteGetXCPbz7uZx9GCyQJ3Brnb6RpcY 0jd7/936PWn4noTFMgUAnFk9Bwg4vsxuy6KaxlkwdD7rxwKkDwhwdaBFE/GIVedYah04 KLXSK2k6wsM1y8OybSREuhkl6/CAGS/DmyUkqmkdzgg+aWkcNotWl+pkmrGT/FF39AyQ un3inqdCdjgeBi+GNy0wXIOdD1HPietC8nzpVGYc+lVr7ylWtw+RPPJrAiuJmV3vg9Ty fwQ/L3KeS/0JpfMVlP9XybdRDPe920cMq3iLwBn7WB3k7PZkgROitxG2SHdM4mZgXRXa lELQ== 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=SDK/WArJRve3HeXhfrA4xgTKsXFbIrYJGoVcMqSk8rg=; fh=jr8QhJr2llEgkVy2YoXqJRI9s4gGiY0qzgnqM+uZ9Xw=; b=tRa6O8Tyi5efG4vx3vhAf7v7YeDTyqvrS+1tEagvYEMPTmkPVee5Ytmx1BAg+nX0Db veDPHF5owsbalJCTLPXLFHSadzMHroZC8pISDnL6uawRVdmblRqm8m7h7KS0y8Tvm7gI qzFgJ+IsEqQXAFIzflIAa0gtGL83nklEg4NDwKynE8AD1HCcxvS92mt36GhiBRmrjwep EZiTN5JoPQw689Q/1FwWr+x9yl8IUrSKdqhjnri5um6Xa02qQlojVb9LtAXO1qjpONwM AKtudC5/l1d4iZus6wnbjXJRecIiTBoE9U9MrKFDF7kuaugny3HjEf2fzbh8MULYrkr7 7dQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C6fBOQcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a170902dac100b001a664075202si25417628plx.542.2023.07.05.12.33.22; Wed, 05 Jul 2023 12:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C6fBOQcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234133AbjGETK7 (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233655AbjGETKG (ORCPT ); Wed, 5 Jul 2023 15:10:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7825A26A0; Wed, 5 Jul 2023 12:05:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2533B616F0; Wed, 5 Jul 2023 19:05:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 132EAC433C7; Wed, 5 Jul 2023 19:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583939; bh=fuAcROkTvzWt2oLhwWrBRUVTBdgYfzuMksRnIzfqmIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C6fBOQcWDc/pi/H95I+kf1JujNXMjelHZVfb8qt4mTiNkNM6c6jDvFKaihRMDr5AG ZbTxTPNng7DHr+2qgsCcMoh1vXTuuBrUh60Kz20uVdmvRFACmim8lw7S/nX74+8Phi JVojm6xelMYsFECol+OmTAfJiVC6IOtTOqRg8StKBa2mUapqgcgeyk0OsG0DiJHMxq F5iUXroxJyxAh6dglCanl133Fy67F9KKjMrbY9vxv4eHozCZojPMr5mF8u78WGKdru zc/SidxREFDoR8sGbx2kwknTcaksqY+qzmc7U7+0UXqNqwFI21TmSKnMuG75Iw5F0i uiuomrNVRF2Hw== From: Jeff Layton To: Christian Brauner , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v2 86/92] bpf: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:51 -0400 Message-ID: <20230705190309.579783-84-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610352078006550?= X-GMAIL-MSGID: =?utf-8?q?1770610352078006550?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- kernel/bpf/inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index 4174f76133df..99d0625b6c82 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -118,9 +118,8 @@ static struct inode *bpf_get_inode(struct super_block *sb, return ERR_PTR(-ENOSPC); inode->i_ino = get_next_ino(); - inode->i_atime = current_time(inode); + inode->i_atime = inode_set_ctime_current(inode); inode->i_mtime = inode->i_atime; - inode->i_ctime = inode->i_atime; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); @@ -148,8 +147,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode, d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = current_time(dir); - dir->i_ctime = dir->i_mtime; + dir->i_mtime = inode_set_ctime_current(dir); } static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir, From patchwork Wed Jul 5 19:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116373 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097070vqx; Wed, 5 Jul 2023 12:44:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xJmE1HR+jZCYKwXuUN3TE7hOFpueBQQpUowRvqIoVS5vIES65ab4yrgO7SwGAp6+5P/cu X-Received: by 2002:a05:6a20:7487:b0:126:92de:b893 with SMTP id p7-20020a056a20748700b0012692deb893mr22197346pzd.31.1688586240508; Wed, 05 Jul 2023 12:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586240; cv=none; d=google.com; s=arc-20160816; b=YtdN8Yfdul8ed1X+njjMFmuw5TW3hWBiNbx+DeEiRaV1W1Frnuwl5rjSnffv24IG+E kF5RvlYYgp65Re2W//RAcFzAXgO0sXwLV6byvh3DPpjMRxj7qe8XfW+fjw59toEKy2dZ P/yVc2zyMa/OKtULyHorSOfGZ6+QttUjpd2oWY7rmjFykNyqLJElw72xINTtraMmhAAS pNNXQND6LYdsHScFRS1vqfh+NCft9fjcPafgR5SRlwOnO+AoRhAf4PEyigjJmT7jNKJ7 3Lq+ZZLmcX9fm0nihpiHGAVoPXU0hXqVh8Yi5X8+CZO+akIG15+WL7hH33/2NhHjSNt1 ni9A== 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=L3pU5Q00INptaBFAO9mFc3Gi0t16lE110/oKSVwhMEg=; fh=F0TBjGtdr07rIyL2N50xNH5K7Dnohp0JfmFjEcpmwnA=; b=BFRciN+GzWN44iI69fDhcB3/gbGBzRyBR4uLaFnmztx89em/fjHMjJKtqpkEpMw5JO l+8n2lD1Fy7jpNb1w+9dBjgTuHT7BigkVMwBubt5jo/+Rxy5lXRMdgwtlsswfNoCP6bR yPT8rO87g6TXa4QYp3V1gPPLTgS9ec4STy5widmvhKr3367GM0jT3mR5/enTEti2imNW ZmtI379mxnVZWBaqePCty0jYZYEhdmd6Kmm1tTKbEdm7CPLKyVvCpWtPpLuRB6NHB0k5 yNB0EK6lJdQ1v01LKFRg6xWHQowxy0Fa0PYjQesjrE1dCEkP4JaIkhUDzFcZ5lD+Z7CE Re6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VjCutnJI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a056a0016c500b0065ee6c40f91si25033272pfc.159.2023.07.05.12.43.46; Wed, 05 Jul 2023 12:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VjCutnJI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233965AbjGETLG (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234076AbjGETKY (ORCPT ); Wed, 5 Jul 2023 15:10:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75B9B3C27; Wed, 5 Jul 2023 12:05:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AFD3C616D1; Wed, 5 Jul 2023 19:05:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59D8DC433C9; Wed, 5 Jul 2023 19:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583941; bh=GKBCwLrYWAi3v0y6MO93lIfNnq+o58agxgcNSmD247M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjCutnJIUPMgnmCBtHf33PNh66QZiXyZbegxgDSHMXLyEpi+E2XZBS7unmk8g5A/E 1vRwbOcVg4MwoSTulTtqWD0yc1P69v1xHCJV2TMVBBJoxmXNBIRwRd0uEEIJWTotPd wxit/iq+dAgVTkGNqSQYiC9d5RYFXT1Ct1ySxYchal2VyA1P7wrcmB1oXBE87t0tWS 08zPWFehqqaG8ePSrnTE+HN/vd5S0N1pAxoYU7s3aoKTrQVfbRMXKh2JCs67bTUQkQ VygI7K4nV0a1+8iHMw7HZrrGWS5C8bZmEz03rcLQBUucWi0VIBEWLmYHSbaViiOSvy CR1BGZAbDI8Wg== From: Jeff Layton To: Christian Brauner , Hugh Dickins , Andrew Morton Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 87/92] shmem: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:52 -0400 Message-ID: <20230705190309.579783-85-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611005369103586?= X-GMAIL-MSGID: =?utf-8?q?1770611005369103586?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- mm/shmem.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 1693134959c5..51aaaf479437 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1064,7 +1064,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_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); inode_inc_iversion(inode); } EXPORT_SYMBOL_GPL(shmem_truncate_range); @@ -1161,9 +1161,9 @@ static int shmem_setattr(struct mnt_idmap *idmap, if (attr->ia_valid & ATTR_MODE) error = posix_acl_chmod(idmap, dentry, inode->i_mode); if (!error && update_ctime) { - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); if (update_mtime) - inode->i_mtime = inode->i_ctime; + inode->i_mtime = inode_get_ctime(inode); inode_inc_iversion(inode); } return error; @@ -2394,7 +2394,7 @@ static struct inode *shmem_get_inode(struct mnt_idmap *idmap, struct super_block inode->i_ino = ino; inode_init_owner(idmap, inode, dir, mode); inode->i_blocks = 0; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_generation = get_random_u32(); info = SHMEM_I(inode); memset(info, 0, (char *)inode - (char *)info); @@ -3110,7 +3110,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, goto out_iput; dir->i_size += BOGO_DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ @@ -3193,7 +3193,8 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr } dir->i_size += BOGO_DIRENT_SIZE; - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + dir->i_mtime = inode_set_ctime_to_ts(dir, + inode_set_ctime_current(inode)); inode_inc_iversion(dir); inc_nlink(inode); ihold(inode); /* New dentry reference */ @@ -3213,7 +3214,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; - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + dir->i_mtime = 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 */ @@ -3360,7 +3362,7 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, folio_put(folio); } dir->i_size += BOGO_DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry); @@ -3438,7 +3440,7 @@ static int shmem_fileattr_set(struct mnt_idmap *idmap, (fa->flags & SHMEM_FL_USER_MODIFIABLE); shmem_set_inode_flags(inode, info->fsflags); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_iversion(inode); return 0; } @@ -3508,7 +3510,7 @@ static int shmem_xattr_handler_set(const struct xattr_handler *handler, name = xattr_full_name(handler, name); err = simple_xattr_set(&info->xattrs, name, value, size, flags, NULL); if (!err) { - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); inode_inc_iversion(inode); } return err; From patchwork Wed Jul 5 19:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096790vqx; Wed, 5 Jul 2023 12:43:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7jDnRCR+jTkd3DEZZBmgx7wMkOmkWv9HG2AjNfOEB6btI610BUcQO2vZNA+zH0Y3DN5slY X-Received: by 2002:a05:6a20:6a0c:b0:127:6bda:a2ae with SMTP id p12-20020a056a206a0c00b001276bdaa2aemr22288548pzk.10.1688586202701; Wed, 05 Jul 2023 12:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586202; cv=none; d=google.com; s=arc-20160816; b=iIq4jarYfWdmCO6ldwI7YpN8E0unWyfq0vpc+KGXsvlt3TTYP/9QnNymSrrdSAmEil t4cZTS70SJaiY1ABCiDMJ0BGqCubLDRPSpulVdHDyIDEmvWxL6ACSKHvj97pztxfwW2q dIvr5rUzgCCx0qLFEo03JaSKnXJlOyhQmKLFNj1z5yTjWGYMHleWamYyk6dTkWAXerk/ /45/W+1Ph1dPmLg214MNLG4ubgckbkiUtSPg9TpeywmjLhE5VKPq5BmD2hOX7C46+cOP jAPShPFF8HVocbcz8Detzys2d1UYYIeC7kgvjrTX+gZTYF4QYxgtA2uvYY4nhML04C3z lfhA== 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=hevbwjFoBumEc23O62NG7FeHzp/vinmf6qmlFeMwBXc=; fh=Rof+EjqBGnNRaGNeWabbAJ1iJSOBykSeV3Gy8yySZyo=; b=WutwOubGPUlkMvYd+rDTjJviNe2I9OUgwSSaiVK9ZSnmN5779KzsDxCAoUe18RkFc9 XhEMQI4qoHjzslFpRSxktYV5IcsiEAQZhf+uSLASIn8S9MQTaOPG5vktPtUzhFqpaow9 7Y5c5hyqMdqTX133fZx3axfLcYLxKppAuNi34Q8pyQtLzc2LKsrzCyb/B6WTEKYqeOXb D43gX9GPInOoAvnWymXsaipNsvqid54s9K9bS/FXkgglH5Ngp4CIuJIi4YKfXkffx2HW 31mzrNjRCByqddGdDnG6XQrmQ+oZl+8vjFr0XDEQkVjEFmilQO0u37KvMQx+DFx2fqDK 3pyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UeAwqR8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cl8-20020a056a0032c800b0067d2eeacacesi17915361pfb.355.2023.07.05.12.43.08; Wed, 05 Jul 2023 12:43:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UeAwqR8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234169AbjGETLK (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234080AbjGETKY (ORCPT ); Wed, 5 Jul 2023 15:10:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 803A63C29; Wed, 5 Jul 2023 12:05:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A5D861716; Wed, 5 Jul 2023 19:05:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D925CC433CA; Wed, 5 Jul 2023 19:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583943; bh=PupGEBmpc4BS3GR/o7WIzvxzbsSfu55Z8rACvDIEA1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UeAwqR8Xl0h07N6K15EXbDERNSWmUYaYGEVGFgjnZMtepCmt1llB/o23xcjhlwLas 6CiwqQJJtoCwixWGV/lVcUuZZKO6JsD8SiSt3FCk1RDYxFjY1KFUCBzxplJ4PXtI+x 4/ADpSVzofY0F4F1Q2YdzkkG+4AFvl6W/8UJtqbe9omwrrQ1fV58teVyo6S+1Ndtta cpR+KOH3XFCEY6W2LvMIs1W3/oR8PY2YrCXkn6ZQIysVDp8v74+o5QHGoKYUw9IojB VwDQslscQGW9cYBZbGedv9tH1cMnorngGns+cDo2tXLg4WKBJ1PK3U4rc1mtPRAKWQ aUfgQraSQYuZg== From: Jeff Layton To: Christian Brauner , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 88/92] sunrpc: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:53 -0400 Message-ID: <20230705190309.579783-86-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610966360260914?= X-GMAIL-MSGID: =?utf-8?q?1770610966360260914?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- net/sunrpc/rpc_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 0b6034fab9ab..f420d8457345 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -472,7 +472,7 @@ rpc_get_inode(struct super_block *sb, umode_t mode) return NULL; inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_fop = &simple_dir_operations; From patchwork Wed Jul 5 19:01:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2096980vqx; Wed, 5 Jul 2023 12:43:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlGUB/iEqlFV0y36HbBpiZvdMap3BIksGmoRbF4Mp50lhwAZ0XM53eKa9KdStd5l4bKi1zV2 X-Received: by 2002:a17:90a:3988:b0:262:ec13:d3d with SMTP id z8-20020a17090a398800b00262ec130d3dmr12516151pjb.18.1688586230371; Wed, 05 Jul 2023 12:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586230; cv=none; d=google.com; s=arc-20160816; b=VealQwDkDZ6K5PAXqvqWq2qfe7evrwdc3CEjq0AZL2+WWkERrxFNLDc7AN4dDjvhPJ /xMyVDSxzAFJ9a7gjz2hyKBhcNhb/QZd6H14CcBtep2jM+vgOFc4LIVqQAKiWGYOjwwT 0+jDf7aHOrnnWaFCAFztADGjFaSyoTVZv4Kn5GwEI7cRJdxwUggA9895q/fdnJ3VNr1m a0cKm0Ukb0XS2yHbXlQemWnf0zVvekEl3937wzOgUjguznzvnNmNS7kOPGnxJWAfiCrm yJYWhc2gb6WXrKWR2Tjk1PZcehdvIfz4ZVPC8LoIjuk36FnnXOlR5+oM6ByL34TQNYm9 jDmQ== 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=MOsnav18iYqFZ1Yygak9tCaNPEpv67xnki5KwCjoYUg=; fh=T0juAWR+Y6rbLDCVAbeKOkyvavtntncQff2iY47RrIE=; b=FSrPZeS51vitKKcUfSEueCBQJs+jCFwatg5Vtcn8OGF38dY6WfAxjPumEUhRgf2UII HXJuwenjKpWZ8dR1BZA0UXJUxsP1cEwUB1yCZ4gGEbbnLJG/cQk9ojmv+S3FVFTx6kee YjtQRUCKpeQRab45IyMx4wT++6oKIMikilCZULhqir9BKhT5MoTU4C59dRYoKik0W3+U h+OXZzFHYB3kNNF0+fh5yXBe83Mx4f0+pMze0Zp8ayjoFw/USEGvRslcaIDLL/C0aeE0 hbY4rXcNbyjaBG6j4qH9OKTKnlwfAKbpguF3dv1g+G5eEBpnGgmkfEP1kjO0pEtKIoKY /aNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n1SGksIN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx19-20020a17090af49300b00263cee680ecsi2290430pjb.89.2023.07.05.12.43.35; Wed, 05 Jul 2023 12:43:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n1SGksIN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233755AbjGETLP (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234104AbjGETKa (ORCPT ); Wed, 5 Jul 2023 15:10:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA1FC3C3F; Wed, 5 Jul 2023 12:05:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0CD87616FC; Wed, 5 Jul 2023 19:05:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6872EC433C8; Wed, 5 Jul 2023 19:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583945; bh=TXSxRuiJHKwV/2Aw+LtmUoK8B39D2LWcTb8UoUWUREI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n1SGksING+sQkSnN9pPB8r2jPmytKLeyeNQ0IzlMjkQkcicrH6T9e8aGRlLggrjhe J6B4enXwNi16W4Ah8QPypWlzkFqH/iXM7cWqjd/cNYkaPrP0KaV6hjZrjRKHjCyFZa g2DUNicQOhlYpSZciRlbC9RcyVoh9r5mjlOaTey4Yv0cMYJdPGvUaZopG8lTw1zb9a EhEBFvnzo8gpXeJGfjhh1EeFc2c3kqZzKxVnRrMxUib82DKwTaZtyo9dmJNp/zS653 XUtANaW6EQC42ddwpG8D/c+sBtdhPJtoTwMnW/QAxTRUrYUfuFm49RseWr/a2IpHJY f5QKpWIh9oHFA== From: Jeff Layton To: Christian Brauner , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH v2 89/92] apparmor: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:54 -0400 Message-ID: <20230705190309.579783-87-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610995105135811?= X-GMAIL-MSGID: =?utf-8?q?1770610995105135811?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- security/apparmor/apparmorfs.c | 6 +++--- security/apparmor/policy_unpack.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 3d0d370d6ffd..7dbd0a5aaeeb 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -226,7 +226,7 @@ static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry, inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = iops ? iops : &simple_dir_inode_operations; @@ -1557,7 +1557,7 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, if (new->dents[i]) { struct inode *inode = d_inode(new->dents[i]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); } old->dents[i] = NULL; } @@ -2546,7 +2546,7 @@ static int aa_mk_null_file(struct dentry *parent) inode->i_ino = get_next_ino(); inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3)); d_instantiate(dentry, inode); diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index ed180722a833..8b8846073e14 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -89,10 +89,10 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) struct inode *inode; inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); } } From patchwork Wed Jul 5 19:01:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2098083vqx; Wed, 5 Jul 2023 12:46:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7lRuoD0miAux4JnDs8zMKOsToDXGNL8G1g2dC9Zu7p6+6Kc1SGcav38ODLk80Uoc2kYdhs X-Received: by 2002:a05:6870:c988:b0:1b3:54b5:ac6e with SMTP id hi8-20020a056870c98800b001b354b5ac6emr19705908oab.50.1688586367817; Wed, 05 Jul 2023 12:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586367; cv=none; d=google.com; s=arc-20160816; b=E64hedBPSm0/VIITg7krBAc09Tz5LWkQNW+wPqSziLHP/pWF2mII6waMq+vbHuH8pT YhyIBY1llVquwklQUftoy6RCe4Fp6l1yH3WuzJ6PfzsT03LbrF0ufk7Vb6nw4vTnvppX WFB9CVLfiKcwJXeRpWCRVPoy8H9xjAv5IjcymjFphgS95IaKX6oT1YX6XiiCD5lqll96 cmMLBw2pHmbMt6QxCZZN9PSjjJD/PsO0SPznGEozfjokemCvX4HJRoRLa9b/kf3s3PHL bTwjYB3KOJ/gZks9OhLmx/SKf8DNA0xcLjxb3EDDH+ttBK+VrxwuoI3F6Q4YWyqLwpm1 9bXA== 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=PVAK/mXy3JNsi/k+UiEAI2huoS9VjzQ1sWXK1RoUlkU=; fh=IApfx+O7Jlpe3N0c1dVtnqXfCj4IntESZiNpxOlxYHs=; b=HVoBPUVTK/aHVnqx9hPU30yJkqTT9iuVr6U0TPmGrcILlLjrU706JrFw6UDlbYngnd 1z/D7OqIdhHWN/hnheD/5xoM669zm90PKpu9E/n1GrS2a3Pa/Tb8taOfp0HRe7fVZVgY mAuuyhjBpNEe7XUBNp8ivPRplFEVh4I8rmoROLfcq5cLu5Q937GBTN8uPeUlrbXu1Ya4 5aNUv0R0sPcaNkIs9EyYrtTLwfynp8v/jsEjWVS3LPaKEMy45nkyTimU6rpiOS14pWL6 pG8rHbWNUKDn5GsvidtUIgAXHhoI516kG4Q23WU1S6zGpDuuSfFtyb7phHYeQA0DhU56 2+Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=btSVBxT5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bh21-20020a17090b049500b002637d779bf3si2251534pjb.17.2023.07.05.12.45.54; Wed, 05 Jul 2023 12:46:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=btSVBxT5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234195AbjGETLZ (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234108AbjGETKb (ORCPT ); Wed, 5 Jul 2023 15:10:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B47D24203; Wed, 5 Jul 2023 12:05:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 94B1961705; Wed, 5 Jul 2023 19:05:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F8D9C433C9; Wed, 5 Jul 2023 19:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583947; bh=XfqTBNQp2owuW7Y/glX6VYcpT/QJIApBnBVCG8ov/H8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=btSVBxT54HuwxgjfGwTto13ThwkDsnlcJ2KYyL6Ygw70ybKyP3UsJIxgNNfzRacgb 2v/nMZ1MVLNSbL+aHKPp/H8fDdgjhs3LEYCSiWK48EX0qtWJMV/zilm3ALvPK7//dk d7L3RGSTnVt5ZVfl23geIxLlgvKYpC2a53XZRma0zj9zPsw9z8DkOfpsx78FjKwaA9 J2n1E4KXwUSJGyWp/9tUEtP4oAkaiT/5KDRhbo+AziERj5mdAg9/+HKFuO2Vpu2ouc b4qhW3vLHx2D/X9eVRdFKbNXBTPF8ZtFnd0m/6b15OUmnOnRkqQRmxDgaT8n50g5Pf 3V5cQ6KW6x/Og== From: Jeff Layton To: Christian Brauner , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH v2 90/92] security: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:55 -0400 Message-ID: <20230705190309.579783-88-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611139217343039?= X-GMAIL-MSGID: =?utf-8?q?1770611139217343039?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Paul Moore Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- security/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/inode.c b/security/inode.c index 6c326939750d..3aa75fffa8c9 100644 --- a/security/inode.c +++ b/security/inode.c @@ -145,7 +145,7 @@ static struct dentry *securityfs_create_dentry(const char *name, umode_t mode, inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = &simple_dir_inode_operations; From patchwork Wed Jul 5 19:01:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116413 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2103494vqx; Wed, 5 Jul 2023 12:58:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/SCMXKKJSohLTp5rpFk7QLkGY0EtlPBOG8YYUqnuMtOVvRL2v1QzPupa6zJcFi2JVstyp X-Received: by 2002:a05:6a21:6da1:b0:10b:764b:a942 with SMTP id wl33-20020a056a216da100b0010b764ba942mr4443215pzb.11.1688587118368; Wed, 05 Jul 2023 12:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688587118; cv=none; d=google.com; s=arc-20160816; b=nX7UEJ+IRCo2tpkYAwlhGHHQOsji/ycEl1Wrwhvq1SqC3ICDAJ5R5/ssauXx0FPHlj v3KPwnVNJL9jHWYld0IvUleHDfIWtmLqrXqgyCIT3gwXJoIvEL4V2txu5TFbSGmVHyC1 QlrQf8LQoRk9FAoYSe4mt49oCZ8oyneMIjyrsJVjdle3swc2DSPKE5rpsLBsuS6isHy7 Tvbd6IKVcSp5jN+i2qeMMTa4/FIUoLTN7UuvPKlGEiQkTvEZIL+I3RM4C3RaJdaRmqWS GxcjZUnwMSr3NQ/+MRK0fa3guWmfR/XidOXJYubxpFSjISY18aCyD0n5cZMzeYk0YKK2 8W9g== 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=J2cqJEpyHBMV8v3ue1kwqqPjsSFhGhMjAqJxhcU9krk=; fh=xhF5qRm/teEA73yFz+l3jw2qqn9VJ4xv+YNUdGiHzkY=; b=dfTTvhYqr4jRSwXya3uIii5+M2yQLeTxcY7/6Qa9DrqG1vBjqnqVUTtweQtYEzkHmF itpFLEf1vz3wZUX14WZID+L7gfkhz/72hY5RRl1OngqRT0EnDlTieBdTblWLlVP4s8Vv BfnXOpPJNfEzYvyIy3K7hnMhaCSGupWDiBkwTDoRTVbUhypgXbpkDXhklEIchWu5AtZk pquH7Fh8NGG3mWNGI/V1/Mya7U04B3vVq2soBBiK2YUHFKWR6zq5F3I6TT+Xj3/1133m Y+S8vCoIs8ouIeGnwSkj52AS20MJWJkpenlFHM64Cx1Djl6lP50EgRjXpblUNEUCcOYK 7dwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BfI2Jszn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f30-20020a631f1e000000b00544b88dda25si22572660pgf.64.2023.07.05.12.58.23; Wed, 05 Jul 2023 12:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BfI2Jszn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234190AbjGETLX (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234110AbjGETKe (ORCPT ); Wed, 5 Jul 2023 15:10:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49EC5420A; Wed, 5 Jul 2023 12:05:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 40CB56171C; Wed, 5 Jul 2023 19:05:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2375C433C7; Wed, 5 Jul 2023 19:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583948; bh=h+YjMsn4Qu+tNMhA5V9icLWH3DAN1ha4KPOWk0eHFlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BfI2JsznIuKtZGtFSEhKOPI06bCrFYexEv6QgKLLavNRCiNqPZ2fCXh5YMZ3+qk6z uHYKtQrOAtE1+9yqspAq/SkmWtS8Chv2RrzTpqMZtI+ZfQb6mqfUu4DBh/Uk+kQf6M WTTV67y1Nq1a+vJbkVT6313ICRCjcJlVO3XrdnKVEyNxJNT43Ze1phh/FWKkKqYyrO wWi3b4B2v6gc0Abd122oA7HKFFfpLL/nUvNvcMjcJ14iaudOj2eod8SdimXSUHHX2B 6K1v3jCGj/D+qUnYwXWZNpeAVJozPL+dzknN4Hp8nb0PLYA4zgWz1nHWhhNx+p0E2U ERz+czJ3zy1+g== From: Jeff Layton To: Christian Brauner , Paul Moore , Stephen Smalley , Eric Paris Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, selinux@vger.kernel.org Subject: [PATCH v2 91/92] selinux: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:56 -0400 Message-ID: <20230705190309.579783-89-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611926316101276?= X-GMAIL-MSGID: =?utf-8?q?1770611926316101276?= In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Paul Moore Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- security/selinux/selinuxfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index bad1f6b685fd..9dafb6ff110d 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -1197,7 +1197,7 @@ static struct inode *sel_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_set_ctime_current(ret); } return ret; }