Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4837790rwb; Tue, 8 Aug 2023 15:00:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5l0XRwmO+KaMV4HRGL0qCAUqgSVDEbc3pdzfhTbLfEr5fB4scDS+txIT4vOa8MawnBkkR X-Received: by 2002:a05:6870:d38e:b0:1c0:2e8f:17fd with SMTP id k14-20020a056870d38e00b001c02e8f17fdmr1088176oag.40.1691532034393; Tue, 08 Aug 2023 15:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691532034; cv=none; d=google.com; s=arc-20160816; b=FBgm8WgKlN7LSWALWS6KIlhy1fB0J3g/zg/oW6YXPM9HX+CyWDWIP2AmB0bmcv+9LY COOQhvIRWb5o/dg764ZRPrJst+/0SQgLQvuV1PJU51CZC1kEPreyCBaxWTUHY7P1UP7j rsyaghLBU5lgQi39IwkMSazB3IWOsOOwr0Dnz6Yg0+OZpaPC6NmSCPtQS2BagZ02KON8 L8Y9Re+bNeVfKreBKuKVtM+plJ+CIg/Q7fcesPhv3a5dunf7mdCj6Gei/lcQiUFV4ny8 yEIZyTgWB/yiA5o8ZPYIxAOKzngiAgjzBOVfcqGWg/R6AHHfhCRZbfHpdEiorHRk4ctd /Emw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=b3NxAQUEhhiHtmalxt25UQpIEh3A8DobG2qOMrP77WQ=; fh=VDS1Ji1Jg94b8HYa+h+b069MTX7Y1JPYBeWAMaZH+VI=; b=Rnn7z3GaREwMkP6BnZLop4lyQ2JOKEYgDiegxISSC/Vkp3ABjrTwFN/bolLz/yKvqv b8be0nQ23tE0DYQltsdbO6f4n3BHwy5vhGnBnpnlOFZyw3eOHAJHoTgKaUDj7bl04R4u 0YNl0sR2iRvIrGUu7kleJC9VBo5+4uzXY3AbXrg6eUOHEoGq4oXTcF+0tqUmtIYLfBvj WFTFb9wuERUhwmImgTKHv60iKO43qjyrK3hEPMChVea/GTC4o4DNX2BdN/wbbFDNI2+K oymBEyRkjuN87quWO4BcelC5pV6xXzTKtX01jfMbwk23WEz27nu7srA5XYYYLk3pphth hgYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=AoaZr4oK; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a655887000000b00564336d0cacsi7750052pgu.556.2023.08.08.15.00.14; Tue, 08 Aug 2023 15:00:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=AoaZr4oK; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233804AbjHHSmj (ORCPT + 99 others); Tue, 8 Aug 2023 14:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232140AbjHHSmU (ORCPT ); Tue, 8 Aug 2023 14:42:20 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 978303213B; Tue, 8 Aug 2023 09:33:06 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DD6C222481; Tue, 8 Aug 2023 09:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1691486813; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b3NxAQUEhhiHtmalxt25UQpIEh3A8DobG2qOMrP77WQ=; b=AoaZr4oK+uPjgRe+H1N/P4OqdxMzaLQwACpyg7af2LxycPofpRJURn7+dS209wAPqvb2Pa pyguefJyN0BETiXosk+qeiLcs65x2b42r4Xs2kf58Hhxb2lmpsj3DMEMMNaki6d405++FY 0hRnLs55sh8fmVIdow8NkLHWnHGd+BI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1691486813; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b3NxAQUEhhiHtmalxt25UQpIEh3A8DobG2qOMrP77WQ=; b=fxL/rpYwL46zGUX+wz6hOBohbpcZSktGMd5XhY0mnCjlb5Vurz5pFf3PTuD19V4sOSJ9Wo YCByPZ22Ze/c5AAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A3130139E9; Tue, 8 Aug 2023 09:26:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4HStJ10K0mRsGAAAMHmgww (envelope-from ); Tue, 08 Aug 2023 09:26:53 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 1DB1BA0769; Tue, 8 Aug 2023 11:26:53 +0200 (CEST) Date: Tue, 8 Aug 2023 11:26:53 +0200 From: Jan Kara To: Jeff Layton Cc: Alexander Viro , Christian Brauner , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Chris Mason , Josef Bacik , David Sterba , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Tyler Hicks , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Greg Kroah-Hartman , Tejun Heo , Trond Myklebust , Anna Schumaker , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Kees Cook , Iurii Zaikin , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Sergey Senozhatsky , Richard Weinberger , Hans de Goede , Hugh Dickins , Andrew Morton , Amir Goldstein , "Darrick J. Wong" , Benjamin Coddington , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-mtd@lists.infradead.org, linux-mm@kvack.org, linux-unionfs@vger.kernel.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH v7 04/13] btrfs: have it use inode_update_timestamps Message-ID: <20230808092653.ma6d72b4xwa3jk3f@quack3> References: <20230807-mgctime-v7-0-d1dec143a704@kernel.org> <20230807-mgctime-v7-4-d1dec143a704@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230807-mgctime-v7-4-d1dec143a704@kernel.org> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,URIBL_BLOCKED autolearn=no 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-ext4@vger.kernel.org On Mon 07-08-23 15:38:35, Jeff Layton wrote: > In later patches, we're going to drop the "now" argument from the > update_time operation. Have btrfs_update_time use the new > inode_update_timestamps helper to fetch a new timestamp and update it > properly. > > Signed-off-by: Jeff Layton Nice cleanup! Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/btrfs/inode.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > index 29a20f828dda..d52e7d64570a 100644 > --- a/fs/btrfs/inode.c > +++ b/fs/btrfs/inode.c > @@ -6068,14 +6068,7 @@ static int btrfs_update_time(struct inode *inode, struct timespec64 *now, > if (btrfs_root_readonly(root)) > return -EROFS; > > - if (flags & S_VERSION) > - dirty |= inode_maybe_inc_iversion(inode, dirty); > - if (flags & S_CTIME) > - inode_set_ctime_to_ts(inode, *now); > - if (flags & S_MTIME) > - inode->i_mtime = *now; > - if (flags & S_ATIME) > - inode->i_atime = *now; > + dirty = inode_update_timestamps(inode, flags); > return dirty ? btrfs_dirty_inode(BTRFS_I(inode)) : 0; > } > > > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR