Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2807638rdb; Wed, 4 Oct 2023 12:01:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEidKewHqACnfkoh+oHXRqQriVvv7P8brFkBnc9nNv6FHAjex44M9UGMzH6L+YZwgWhw9TV X-Received: by 2002:a17:90a:ba87:b0:268:b682:23de with SMTP id t7-20020a17090aba8700b00268b68223demr3309129pjr.28.1696446117331; Wed, 04 Oct 2023 12:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446117; cv=none; d=google.com; s=arc-20160816; b=mMa2tj8Fl0rSIwCscYYdgX5oBd0XcbI6a/C+RMgPx8NH5llW+9VJpOeACwS5lhW3rX NzSetj7VBYXsHBXLASqen0YzXPl7AQXniQs7oCNA/0wzzbN3TjPfefF2G2kWr5sCVIAP L/SiiXWO1eqcq10E0ykJjlGSCfXjxcr+QWXoVn72VDO4C3jOHXl/jcVnrfD4tLi95EHa uIsDy7ErHsnpTSVbsBX7tsHk4AqfK3kBJSIc6ZbTP3ObLtZAt7Wu+9GU+JHFqcFrYxDV j6PSebjkB/+xjp+BPEezPr1QdnGr87q+HIz+zfJdvVazTW4aEeuqFerUkdZLa/I01q+K loaQ== 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:to:from :dkim-signature; bh=dlyXXyuFn59nG9OYRygg2WvA6OxOYVRNumdTs350yMg=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=YCWY2ppc5gppmaY9JERrtvTn6wpOIKnV7Az3/YDVm+pxEVffNxWtZDLAbvzvM4kvSP Z0Fx1YkZik50WX82I6tIJgWupHhVEgF8n9w+zO8mapJ12nsilq5dmWb/ROwe59UyDRG7 7hs6AVep8ge9+2u/CA2itwpwp9rPECN8gV9XOiOlPSWPq+gpQdLAi4tFmbQtukH81+lJ ZECmYcx4m4bsYUjGZBS/uGB8Ru9fwfNBap3WX8tM7q40WJnuOw/lQyfA95ASoTSCNcFZ 3yQvIGJSrQAAfRdJBIUY311+Ik6FaS6kPZ+qmm65w9xPjvpBuDat1pRsxrUHEiMtMZLc aHNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LIpqcTRN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ms21-20020a17090b235500b00277677f8beesi1962643pjb.142.2023.10.04.12.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LIpqcTRN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 C489B8099279; Wed, 4 Oct 2023 12:00:52 -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 S245305AbjJDTAr (ORCPT + 99 others); Wed, 4 Oct 2023 15:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245123AbjJDS6p (ORCPT ); Wed, 4 Oct 2023 14:58:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAA67126; Wed, 4 Oct 2023 11:55:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0708C433C9; Wed, 4 Oct 2023 18:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445715; bh=RJedcd0N98toISTDqRYwkieG7DCuEBxX78QaIUnOLeU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LIpqcTRN62xrhkjIbLLz2L5StBxlBAS6QjkkRpksfZLILlsDF5Y1iMh1sjUXQpi9s /mxPT62/A7H2T8d3yVaJOWAEytMWPJKivHyhhOUiVLxiLcAhLE0bhjQEY824M+mGNE v4f/9XvNhLFAdF36oeEVwUrtWhOot+Ve/zgk7DO3J/THA9r7ePsR2n053AtWoTanZ1 mabWOHb054ld9hMnBO3xrAECZpkGB50kQx9TRmg8w1jaCh+HsMpaw2GxjoT6RQ4O7S i8t2xdchuR7xJDU7RTOJCztNiP32xus6djW7UIHisF/ri1hVTp59rC5Kr/XXTTVIEB pK0inceO1ntTQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 74/89] udf: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:59 -0400 Message-ID: <20231004185347.80880-72-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=-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]); Wed, 04 Oct 2023 12:00:53 -0700 (PDT) Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/udf/ialloc.c | 4 ++-- fs/udf/inode.c | 38 ++++++++++++++++++++++---------------- fs/udf/namei.c | 16 ++++++++-------- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 6b558cbbeb6b..5f1f969f4134 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c @@ -100,8 +100,8 @@ 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_set_ctime_current(inode); - iinfo->i_crtime = inode->i_mtime; + simple_inode_init_ts(inode); + iinfo->i_crtime = inode_get_mtime(inode); if (unlikely(insert_inode_locked(inode) < 0)) { make_bad_inode(inode); iput(inode); diff --git a/fs/udf/inode.c b/fs/udf/inode.c index a17a6184cc39..d8493449d4c5 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1296,7 +1296,7 @@ int udf_setsize(struct inode *inode, loff_t newsize) goto out_unlock; } update_time: - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); if (IS_SYNC(inode)) udf_sync_inode(inode); else @@ -1327,7 +1327,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; + struct timespec64 ts; reread: if (iloc->partitionReferenceNum >= sbi->s_partitions) { @@ -1504,10 +1504,12 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << (inode->i_sb->s_blocksize_bits - 9); - 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(&ctime, fe->attrTime); - inode_set_ctime_to_ts(inode, ctime); + udf_disk_stamp_to_time(&ts, fe->accessTime); + inode_set_atime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, fe->modificationTime); + inode_set_mtime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, fe->attrTime); + inode_set_ctime_to_ts(inode, ts); iinfo->i_unique = le64_to_cpu(fe->uniqueID); iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); @@ -1519,11 +1521,13 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << (inode->i_sb->s_blocksize_bits - 9); - 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(&ts, efe->accessTime); + inode_set_atime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, efe->modificationTime); + inode_set_mtime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, efe->attrTime); + inode_set_ctime_to_ts(inode, ts); udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); - 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); @@ -1798,8 +1802,8 @@ static int udf_update_inode(struct inode *inode, int do_sync) inode->i_sb->s_blocksize - sizeof(struct fileEntry)); fe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); - 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->accessTime, inode_get_atime(inode)); + udf_time_to_disk_stamp(&fe->modificationTime, inode_get_mtime(inode)); 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); @@ -1829,12 +1833,14 @@ static int udf_update_inode(struct inode *inode, int do_sync) cpu_to_le32(inode->i_sb->s_blocksize); } - udf_adjust_time(iinfo, inode->i_atime); - udf_adjust_time(iinfo, inode->i_mtime); + udf_adjust_time(iinfo, inode_get_atime(inode)); + udf_adjust_time(iinfo, inode_get_mtime(inode)); 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->accessTime, + inode_get_atime(inode)); + udf_time_to_disk_stamp(&efe->modificationTime, + inode_get_mtime(inode)); udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); udf_time_to_disk_stamp(&efe->attrTime, inode_get_ctime(inode)); diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ae55ab8859b6..3508ac484da3 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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, 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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, 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); - dir->i_mtime = inode_set_ctime_to_ts(dir, - inode_set_ctime_current(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode))); mark_inode_dirty(dir); ret = 0; end_rmdir: @@ -555,7 +555,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) set_nlink(inode, 1); } udf_fiiter_delete_entry(&iter); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); inode_dec_link_count(inode); udf_add_fid_counter(dir->i_sb, false, -1); @@ -748,7 +748,7 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir, udf_add_fid_counter(dir->i_sb, false, 1); inode_set_ctime_current(inode); mark_inode_dirty(inode); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); ihold(inode); d_instantiate(dentry, inode); @@ -866,8 +866,8 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir, udf_add_fid_counter(old_dir->i_sb, S_ISDIR(new_inode->i_mode), -1); } - old_dir->i_mtime = inode_set_ctime_current(old_dir); - new_dir->i_mtime = inode_set_ctime_current(new_dir); + inode_set_mtime_to_ts(old_dir, inode_set_ctime_current(old_dir)); + inode_set_mtime_to_ts(new_dir, inode_set_ctime_current(new_dir)); mark_inode_dirty(old_dir); mark_inode_dirty(new_dir); -- 2.41.0