Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2807655rdb; Wed, 4 Oct 2023 12:01:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7TLaE/mzx871TezTT2CX+PDbvwovOH2RkJ2pt9jifKxkIN8bpu4I4y42fz2692WNjBlbG X-Received: by 2002:a17:90b:1c0b:b0:268:3f6d:9751 with SMTP id oc11-20020a17090b1c0b00b002683f6d9751mr3128683pjb.23.1696446118841; Wed, 04 Oct 2023 12:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446118; cv=none; d=google.com; s=arc-20160816; b=y02VXcj+JNk9ROH84McsQTzUzuWtJbgGPH2dowy7KbJ2oik6z3o/iedg66QeMFtf4r UZNYHDpAu6hqDfl8F8TyGqMcfAymz3IpKKCWKmjm4Ho1ZDx90JHHvPhb4XqN0d8DGemq zVx0fl6K1cKqz84E/kkOr2Qg6TdgWaxNRCeU0PcvhD/ubM6Y5Aluso/QFAxKwsb3oDPl hZNarNlqT9XLhHcXLAB+Jai53BvsD+7xkhoEaIaxhfK9XQAcYaLViIVemyxLYn8tcNjr PhvuCBvHh3nTkkamVVdtTjUWFLow6kCNzX/Pm3gbsa31lkLAeU2tfqX/SCLPkn0A5oDm IfvA== 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=gzT9dpuBqD6fvGO0uDZE3aqHl8bUWPuK2VosfIrQJpk=; fh=8qCKqn6BYkGuQTCNhe8+upUWuYLHCe1OqceJ45ksEvw=; b=mH9J+L+Y9yfDPzyVTPKAM8P/hsNO6Ja2c0X9f7Xm3H6KM6A8CGzeV0ReyXVWZAZI+c 8OMzeb5tatmLhWwsMLOusEjr1T4fx+tDG1WQT1wo1jdVEQ1b4q9rMxFmcGofqRzhsdN5 GWCjNAlzJ1HBdqzuWgP21waTQSfU+BAgCICuSOTRzllNyp9XLZQBK40EFUcNOkLuD24p uqxe2Vrh2UvWALmI4mi/NJFPparnivVG/J5PUSYx0c7xzh9vtVRHOOrenmtbjrAyJrSp op6xB2muOpjEQZp3bx4f0+UX07bbxyT20eRmqjsigBUuaHDRXi6l0Hw9MOx4knUOLiT3 I46Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bL7wuzDQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id nn11-20020a17090b38cb00b002791d79bbf9si2163264pjb.187.2023.10.04.12.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bL7wuzDQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id B6D7380A4336; Wed, 4 Oct 2023 12:01:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245075AbjJDS5y (ORCPT + 99 others); Wed, 4 Oct 2023 14:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244953AbjJDSzb (ORCPT ); Wed, 4 Oct 2023 14:55:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED7F0171F; Wed, 4 Oct 2023 11:54:49 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8D99C433CA; Wed, 4 Oct 2023 18:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445689; bh=BzmHHAJz6lYHHZHZoa6zewaRspqSDICvIyQA0NDXkSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bL7wuzDQWPALt/93IkyyQc+LFc/NemtrEXf/xfciiaEjZ3f6RElycysodrnL8RyrI m6jPMzcT+lZ2Aj/nEfVAMOZR7o0GqN+Q4jjW9/K/1JGhxqQVlrpHSeKr6jPPEDndvw ci/icWTpE8PwBpkb88gfDoa8kASYMwsP11NUavrmZDZJUFuLTtLSIBVY8xmKbJDgDj R9DhK/i5qP5rBJBQwkaeXPe17CPwu2GkEq8FkOsnuwdD5/1zpAvnLt1w/SChqbLR8k UUmuAYbZuC1O4XoFvjHjBcC2ZLboqCHepAJCWNLthmuFOYC8PuFfjclO27zDUyPVZV JN7VV2G01Vwug== 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 v2 53/89] nilfs2: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:38 -0400 Message-ID: <20231004185347.80880-51-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185347.80880-1-jlayton@kernel.org> References: <20231004185221.80802-1-jlayton@kernel.org> <20231004185347.80880-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:01:33 -0700 (PDT) X-Spam-Level: ** Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 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..f861f3a0bf5c 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) @@ -768,10 +768,10 @@ 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_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_get_ctime(inode).tv_nsec); - raw_inode->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); + raw_inode->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + raw_inode->i_mtime = cpu_to_le64(inode_get_mtime_sec(inode)); + raw_inode->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); + raw_inode->i_mtime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode)); 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