From patchwork Thu Sep 28 11:03: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: 146076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3264966vqu; Thu, 28 Sep 2023 05:14:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGV2ksOYRqF08Ui7V0o8JHBCWWg6WZUChdEgWoHoJ0ntnBKvt/ww+u14xMWeUyfNqKLCaVL X-Received: by 2002:a17:90b:4c4a:b0:273:efde:2ea4 with SMTP id np10-20020a17090b4c4a00b00273efde2ea4mr879247pjb.42.1695903258666; Thu, 28 Sep 2023 05:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903258; cv=none; d=google.com; s=arc-20160816; b=S9FdFpn6n//HQxo4zoVZ6qRvlZjLWp0ewmOOPJFqv2C77Sj6BsjkGjczvXUhqlE992 N5deH8LAB/XizUKbWtgq6+Aky9fJc8MdBu6arP9CibnuG1sPJkN59wskv1gxDu10CMJI n1vpjEWhU63QD5TVadimTVcB+0wbDo9wKj5i2h2ln1raRTWHRH/8fD9yybihQ/wrV7Iz Pnh5VtQXMhTOx7OPuGtC4+/iV9L7VE0XSiTGJN/1mQ7q99/EYcrR13I82Ztksg3drdzg VtFaGPDw+YubstkFNxUiw1AWjJfvfZFehQeBDJ9SGfw9Rr6wEJIGFzK2bZ85ut5zDXv0 ETwA== 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=Wu9HZ5zZX9PCCltzsv6UdvLVH6PKLL1EessvGUjQMag=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=nJIZDY1f3eF9jw++y8zVRH00KQ2SPwFScYtED0mQac7URVCbIrzqZU5s8lYR26dV9z jP1LBelClihV6Dvsj+BpIj7Yfbn6ej35RFwpOALU/6JtPDIqwKD4AVVlUbfDqe6KKmne c5IM/2mQByKQto5N2Y/2v2rqZOYza0Koa5g4Usqz07R4BpHy4TjpGbjrelVKrmB70PG3 WtPwHMo1e+mZzE8J0TDgWz74CdbXz+Tz29ZzTsUJsBq2D3uzxQsTYonAl6nbGtqvQ0Mb 2k81kx5xaaTXbGLmyp0XgV/jnxnph4llhJ9rqefcoyqkoAyWUPnAHgu5V86YMFQ1gsF7 E61w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IXmIq2lN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g10-20020a17090a7d0a00b002632a1243dbsi10045879pjl.104.2023.09.28.05.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IXmIq2lN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 22BC3812A956; Thu, 28 Sep 2023 04:20:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbjI1LUG (ORCPT + 21 others); Thu, 28 Sep 2023 07:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjI1LTv (ORCPT ); Thu, 28 Sep 2023 07:19:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CDC62D4B; Thu, 28 Sep 2023 04:05:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45F98C43391; Thu, 28 Sep 2023 11:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899142; bh=9I3VHyY35UotQhyUrdlY07m/1CcXBFl8HcZX1pCcZAg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IXmIq2lNI89BP8ueuoBKzaSvH81WQbpDTUJc/EW8eTXoGoLVK8LICU3B8YGTRtzSj 1N8/xtJy/GZ/sMWvb1rhwpBD4mnmRwjk0vy5aVeiIyQ0s2D4DYY50e9Wf7s/TOrdOX PKcVbUB7Pd8uVaE1xnCFHJf7vm1ug5x7l1LHVAVJuhS0c+xN83wGgKLTAjWJoUqpd1 JHbKLr5iU8fsddqBt3+/+SBrcPtm42PIfMoT1nsMoe1N1Mo6iCizAHoDjS3zA0P6Ao 0oedckcqSp9FuAPa+yJNf6M48VlT/Hm5a2zwplR/chg2jUyISsRmcpMbooy936jDo0 l7lEoPq+UXO2w== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 75/87] fs/vboxsf: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:24 -0400 Message-ID: <20230928110413.33032-74-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=-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 (snail.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:20:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283455650867902 X-GMAIL-MSGID: 1778283455650867902 Signed-off-by: Jeff Layton --- fs/vboxsf/utils.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c index 83f20dd15522..72ac9320e6a3 100644 --- a/fs/vboxsf/utils.c +++ b/fs/vboxsf/utils.c @@ -126,12 +126,12 @@ int vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode, do_div(allocated, 512); inode->i_blocks = allocated; - inode->i_atime = ns_to_timespec64( - info->access_time.ns_relative_to_unix_epoch); + inode_set_atime_to_ts(inode, + ns_to_timespec64(info->access_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); + inode_set_mtime_to_ts(inode, + ns_to_timespec64(info->modification_time.ns_relative_to_unix_epoch)); return 0; } @@ -194,7 +194,7 @@ int vboxsf_inode_revalidate(struct dentry *dentry) struct vboxsf_sbi *sbi; struct vboxsf_inode *sf_i; struct shfl_fsobjinfo info; - struct timespec64 prev_mtime; + struct timespec64 mtime, prev_mtime; struct inode *inode; int err; @@ -202,7 +202,7 @@ int vboxsf_inode_revalidate(struct dentry *dentry) return -EINVAL; inode = d_inode(dentry); - prev_mtime = inode->i_mtime; + prev_mtime = inode_get_mtime(inode); sf_i = VBOXSF_I(inode); sbi = VBOXSF_SBI(dentry->d_sb); if (!sf_i->force_restat) { @@ -225,7 +225,8 @@ int vboxsf_inode_revalidate(struct dentry *dentry) * page-cache for it. Note this also gets triggered by our own writes, * this is unavoidable. */ - if (timespec64_compare(&inode->i_mtime, &prev_mtime) > 0) + mtime = inode_get_mtime(inode); + if (timespec64_compare(&mtime, &prev_mtime) > 0) invalidate_inode_pages2(inode->i_mapping); return 0;