From patchwork Thu Sep 28 11:02: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: 146018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3237434vqu; Thu, 28 Sep 2023 04:27:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3JYHoV18JZ8546BdHFzNhhXQz74cDOx8IsqTHMcOJeSm9rVSVbaDyAvHvfeTsQAwxr64c X-Received: by 2002:a05:6358:27aa:b0:140:fbfe:d941 with SMTP id l42-20020a05635827aa00b00140fbfed941mr825937rwb.20.1695900455644; Thu, 28 Sep 2023 04:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900455; cv=none; d=google.com; s=arc-20160816; b=Xziw+i8ZyMrs1b9VvjWFH+wS130byZShlcJ5Q62x5Ak0/iCSfZahA75ULynTqLGSwn k8M1OTlz5RAE+1syBEf27k4s/2p0U9GDJ9pYO832PjU+8h7WE/KAOecYw49TaApgvlYo tox8zd2FmAZufRFjD04CoGTkaVTaEWrvdfmDM5hc/AyMvi+bmFjnPp4ZMD6+dQrwgeFv sNFZmvHUVKBI5rGgQIV2LF/s1T8a4q5V19Amp6b57rsOd8FGAyiEENem/elot6xWdOgP qbGfkJgroMRNaTSvAIAz2tqIZFL9cFGcxgPIM6uELDEGLEjxRMDEFaH7jTy0o4wNKek4 0m1g== 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=QtKdQ9M0/pqVWBFUaFdQlyRQOagAJkWrN2dXv9VKoJk=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=eEMX2jk/a1u7ZnOfpongVwKPKkQjxsPertWI8pghEuynsqsbOtlzhP46CStW7SrQeo wu1QRsPnYYTlYBIOkv2JVC2USoOsU/1zkKViixF0WSjCIIpOPJkRPlhEWxh9VUFP0uHL cYGBwxEEWVxTmHr68jSboQDLzFielK9zdkR7YBsQx2Bv2+c1pwQHfFMquPYOkSR6o3jt aLPgCkzFoTO//jXKdSWGoY2xhnQZ+VLyFKmelx0MG1TDVouFNR76p/FL53ahOgYR7iDV P4I4B3Ia7l1UI+qHaEbSTdZeu+T26NOKvyoBnLdCRtRoGL5DYP050kNC+QXDBpLm6WUr XPVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fW92e0ov; 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id w14-20020a63474e000000b00578da80ac3dsi18217806pgk.80.2023.09.28.04.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:27:35 -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=fW92e0ov; 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 B0F218135CE0; Thu, 28 Sep 2023 04:07:28 -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 S232115AbjI1LFq (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbjI1LEj (ORCPT ); Thu, 28 Sep 2023 07:04:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7818819B; Thu, 28 Sep 2023 04:04:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8B67C433C7; Thu, 28 Sep 2023 11:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899076; bh=3cft9/flkVHUeMw9oc2cUluGTl+0HKBhpa4Y5IShJPM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fW92e0ov/UsBwbEllL296kPvjipgHX0QL4oDw5l4I8eIsGr3umCLYYBFg/SfTaHpQ TRsUhiBLgzLKbvl0+01RGJ6Rf5cl+XE/7KOnRn9GE+O32HgPTn2TBOiDatU/4hrbsw ZbJkKPXpeg1lbNZ4lQ6jpsgYV3d5f1TN7QKN9HvFHyWFQK6fzPsodB6PUEOznLYFpG xRqXpWrYfKXpNecLkxrxYy75abMoEJQES8JpsbvItDsC/2pqEMxoRQulAcPgDJBlDR EfL2vrf4PUtMWTymrQ5JgJzRSGp36OLxnH5fjINiZjl9w1+lrVdeUwPQu2W8ySh7Qr p43bjC1RmTeTw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/87] fs/bfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:30 -0400 Message-ID: <20230928110413.33032-20-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 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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]); Thu, 28 Sep 2023 04:07:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280516021480437 X-GMAIL-MSGID: 1778280516021480437 Signed-off-by: Jeff Layton --- fs/bfs/dir.c | 9 +++++---- fs/bfs/inode.c | 10 ++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 12b8af04dcb3..fbc4ae80a4b2 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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_blocks = 0; inode->i_op = &bfs_file_inops; inode->i_fop = &bfs_file_operations; @@ -187,7 +187,7 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry) } de->ino = 0; mark_buffer_dirty_inode(bh, dir); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); inode_dec_link_count(inode); @@ -240,7 +240,7 @@ static int bfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, goto end_rename; } old_de->ino = 0; - old_dir->i_mtime = inode_set_ctime_current(old_dir); + inode_set_mtime_to_ts(old_dir, inode_set_ctime_current(old_dir)); mark_inode_dirty(old_dir); if (new_inode) { inode_set_ctime_current(new_inode); @@ -294,7 +294,8 @@ static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) dir->i_size += BFS_DIRENT_SIZE; inode_set_ctime_current(dir); } - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, + 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 e6a76ae9eb44..1de3b3611ba6 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -80,11 +80,9 @@ struct inode *bfs_iget(struct super_block *sb, unsigned long ino) set_nlink(inode, le32_to_cpu(di->i_nlink)); inode->i_size = BFS_FILESIZE(di); 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_set_atime(inode, le32_to_cpu(di->i_atime), 0); + inode_set_mtime(inode, le32_to_cpu(di->i_mtime), 0); inode_set_ctime(inode, le32_to_cpu(di->i_ctime), 0); - inode->i_atime.tv_nsec = 0; - inode->i_mtime.tv_nsec = 0; brelse(bh); unlock_new_inode(inode); @@ -140,8 +138,8 @@ static int bfs_write_inode(struct inode *inode, struct writeback_control *wbc) di->i_uid = cpu_to_le32(i_uid_read(inode)); di->i_gid = cpu_to_le32(i_gid_read(inode)); 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_atime = cpu_to_le32(inode_get_atime(inode).tv_sec); + di->i_mtime = cpu_to_le32(inode_get_mtime(inode).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);