Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3148869rdh; Thu, 28 Sep 2023 04:19:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEdlXu3+4B3MePaFupK2XABedl1i6gtmf7oefQg1Ai9DNKa0OGfX2e9TQi4Rn2xz3xCxys X-Received: by 2002:a05:6358:9490:b0:142:fb84:92e6 with SMTP id i16-20020a056358949000b00142fb8492e6mr749347rwb.9.1695899989233; Thu, 28 Sep 2023 04:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899989; cv=none; d=google.com; s=arc-20160816; b=f9V1e05D+z9TX9/5LOq604zStVkfPAxg9a4MzvNDcjdLPAphnhK9GjxAYlUBlgGWW0 ekf7Tji7mAweQAnBvQLPyLTu94nKyNVghE8OShazmaoit1WAtKpPx8YACLGHgmXdqM2r B/iUkEUnBCcKVIu6jl/YxFo4LZS61dj9Bi82t/c/K7PRBlQciWD/Mx6bZgbbmqxDkHNT UA8OpUIFtdhl4GDM9xq249BXTLuxy5v/0w9lftmf6HWD9oMvrgaXtHRddu8EnRtpgT6M 5sTANicd/Fzo/d4+AB6zB28XK+aNyNpl0s21Zr1onzxRF6LtVMnKf5eEQxztOGNIZ8ex 5juA== 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=rVY8w57YMh9zfO3tgED40xxETodS5fn7Ym8tvIlrTWM=; fh=8qCKqn6BYkGuQTCNhe8+upUWuYLHCe1OqceJ45ksEvw=; b=z92v8CqrwfBg4JEogYCy5BGI/o5OCfgM0op22kjeouuOLqtr/vnb3g3V1NBFDfNCmf yo8MJklxeA6lFwcchw3NDVlAWLK9HbF6Bq59HEt6LH19WIXP3mSvF7djMKwVl3IThABk PDgBaSDeCzh/V4Gl3wx8VpwEHKw8c56KyS9v/goFV1nHDai2Tw+A1i0VxzUsDKpLo3Ly VUsSqgHl05twp0Z8p15KDkeYhyqoUsV/XCbEd0Y23od+/pEsh+BqQswvAmzk5HtU0OFH aYI4XFWsoTClU4EMIE8Xu9rNmaFhoct/EOGoz1w01FsaJC8euOmka8/OhTObYIptLd/D vNnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dgEOBlGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z189-20020a6333c6000000b00573efae0ee1si7678071pgz.515.2023.09.28.04.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dgEOBlGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 479BA858E8E2; Thu, 28 Sep 2023 04:09:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232501AbjI1LIk (ORCPT + 99 others); Thu, 28 Sep 2023 07:08:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232291AbjI1LHc (ORCPT ); Thu, 28 Sep 2023 07:07:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7247819B7; Thu, 28 Sep 2023 04:05:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AED99C433CC; Thu, 28 Sep 2023 11:05:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899115; bh=VoXxlVrUqhBQVgwjQRi6qU/ZUnPcdpAUrcKR8cbC/GU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dgEOBlGxUkrY1UdDotHV8qYcq/YOtzMq9YHMhD3agVMSTw/us/cpFfcBz/nth7rUj zRWZpyzdYypQQykYBbsWt8+MAYeYNDi8uVYbnPsPUjrriqGEhVmdhOIafyZryy43DU Nk4UKhCs47HVDHlwS3kpdskGF7+ZZ6yJOQsBrI0Qlho9FP8yzHDpEtlqgWexgrwJ+v r+YxsIRtSnYdXo+1gVKjsYOWS94tba9gmJpMU75DTtIPwLvyUtbSvZZRBPiG2A/C7v ieXtx01U0AQc+Bm7ZklrbMxlL9h25Vzq4rcWNHlYq3wyyTz9QNZXmhRJ69B08FtF1u cI9D2dv7qUwUw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-nilfs@vger.kernel.org Subject: [PATCH 52/87] fs/nilfs2: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:01 -0400 Message-ID: <20230928110413.33032-51-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:09:19 -0700 (PDT) Signed-off-by: Jeff Layton --- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index bce734b68f08..de2073c47651 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, 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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, 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 1a8bd5993476..b59380a8bbc0 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_set_ctime_current(inode); + simple_inode_init_ts(inode); if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) { err = nilfs_bmap_read(ii->i_bmap, NULL); @@ -449,12 +449,12 @@ int nilfs_read_inode_common(struct inode *inode, i_gid_write(inode, le32_to_cpu(raw_inode->i_gid)); 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_set_atime(inode, le64_to_cpu(raw_inode->i_mtime), + le32_to_cpu(raw_inode->i_mtime_nsec)); 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_mtime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); + inode_set_mtime(inode, le64_to_cpu(raw_inode->i_mtime), + 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 */ if (inode->i_nlink == 0) @@ -769,9 +769,9 @@ void nilfs_write_inode_common(struct inode *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_get_ctime(inode).tv_sec); - raw_inode->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); + raw_inode->i_mtime = cpu_to_le64(inode_get_mtime(inode).tv_sec); 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_mtime_nsec = cpu_to_le32(inode_get_mtime(inode).tv_nsec); raw_inode->i_blocks = cpu_to_le64(inode->i_blocks); raw_inode->i_flags = cpu_to_le32(ii->i_flags); @@ -875,7 +875,7 @@ void nilfs_truncate(struct inode *inode) nilfs_truncate_bmap(ii, blkoff); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); -- 2.41.0