Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26006724rwd; Mon, 3 Jul 2023 04:18:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlHvq9FFl0s5gos7r97rv+Yn1wbD9GNZqANWWN2e/ZbnUcr+ANROK38A9GEuXfikCKfq5a4i X-Received: by 2002:a17:902:7888:b0:1b7:f654:7bc7 with SMTP id q8-20020a170902788800b001b7f6547bc7mr8905842pll.68.1688383136290; Mon, 03 Jul 2023 04:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688383136; cv=none; d=google.com; s=arc-20160816; b=LcKHSOmoTLdo+wM2fEfQMMc+CJPaKMcUDjpOT+n0t3I4QV8XQlfI32FWzdz9zOaL3q z33IM9crxmvoRMdi3EmDwxh5H5gVS5OATz7iB7gzh/Dlhlzf7Apenx2HKNyZ6Xr5F/Rm SzuCgklTQ8y4eNsoCzKYkrSris8nYBppQ5FF1gmcVLBzSdB1Qd5S+ecGiEb7Yimz7WEJ WKTddeZT9r3N+TRMcSIULM/DRXVe+VV6ODU+1OlF1hNS1bHm9/RCVSC7lytuPetcK886 CYyHfAtwCnd8uH8vHsWMn55pWOG5Kv6p1jyKgP1m0mlSmn22r61ni7LZR2KRAp52KMVo 7qpw== 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; bh=aDNpIPc1p3lU8fDsNPgKJACYno4spnBsmFrr40SXJHI=; fh=tHeKaiyxT+0bH8IP+crKFiNgxNPMFbxkB2PGKUMrAkw=; b=MNJJqo6kAKlPHiVjM9h1AzSG34F3LQjRN5UEz3+qZEqpo4/auQkjdHCk7rwLx+2T3c MbecgIfQ+EVz6G6qncTBXR2mnokdoB91oS/T8Xjehf1w+/0Xv81xkRnFzmIS4FwkFSxH yWLs2hBNkGOhk2FRJwXyR9IhUaZq/fAdrNHMTHtUuknIG0Lr4Y4VEUHFNheIl566Fktb RkVEedrQ9U+tL99MoNB6U2JCTcNtFh2IwCuVBEeu3Wb7BQ6mhwPTvkpWHwoLflTTgm3G sAajpCe64s5h23L4esZroDaociJm4jf4XNBTELl9lji5bs3D1UdMuhfgg0Ow3MPdgpwc PhHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RkiF4/UP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a170902708c00b001ac94b7f2f0si17368624plk.523.2023.07.03.04.18.44; Mon, 03 Jul 2023 04:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b="RkiF4/UP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231233AbjGCK6A (ORCPT + 99 others); Mon, 3 Jul 2023 06:58:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjGCK57 (ORCPT ); Mon, 3 Jul 2023 06:57:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCD53C4; Mon, 3 Jul 2023 03:57:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 52C4D60EE1; Mon, 3 Jul 2023 10:57:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27ADFC433C7; Mon, 3 Jul 2023 10:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688381877; bh=X6NTHK1V9hQ3u5YQ6AjJYZg0fYXUZsJMcSevMRkdaj8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RkiF4/UPjK3AQx1uvID62TrA4kyplMqx9JwcK/quxoavokz+xAC4L2Zl3HdEDWC1s DsSLBHqEqj3O/j6bf+32TgKkTcmVygdacEwoxqfrxjIQL9hqRtyTH24Ggj7rl6J/Et P7+jORQrXGcdIJyaGY84kfOQSlrXgblO/qxS6cbqv/zGnr5ahmAKWL9JhvzWo3KBP5 cgx0LpM61tekxfVkTXMRgb2pcAF89WKlDabTXQPtOn1NQYAn5aLa8jTTqDbcQ1Ab2N DBWxurZIT4/ZWZ4inYg898H/g0ZDPjTgIMqmA1PFEeTDpZAsmyHJ6hD37Nfd+Pv9f0 Hb0pieczgkV9g== Date: Mon, 3 Jul 2023 12:57:53 +0200 From: Christian Brauner To: Jeff Layton Cc: Kara , "Tigran A. Aivazian" , Al Viro , linux-kernel@vger.kernel.org, "damien.lemoal" , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 15/79] bfs: switch to new ctime accessors Message-ID: <20230703-tauschen-kriegen-b0acf3b1f11f@brauner> References: <20230621144735.55953-1-jlayton@kernel.org> <20230621144735.55953-14-jlayton@kernel.org> <20230621164808.5lhujni7qb36hhtk@quack3> <646b7283ede4945b335ad16aea5ff60e1361241e.camel@kernel.org> <20230622123050.thpf7qdnmidq3thj@quack3> <20230622145747.lokguccxtrrpgb3b@quack3> <20230623-kaffee-volumen-014cfa91a2ee@brauner> <20230703-gebucht-improvisieren-6c9b66612f07@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Jul 03, 2023 at 06:46:33AM -0400, Jeff Layton wrote: > On Mon, 2023-07-03 at 12:12 +0200, Christian Brauner wrote: > > On Fri, Jun 23, 2023 at 02:33:26PM +0200, Christian Brauner wrote: > > > On Thu, Jun 22, 2023 at 04:57:47PM +0200, Jan Kara wrote: > > > > On Thu 22-06-23 08:51:58, Jeff Layton wrote: > > > > > On Thu, 2023-06-22 at 14:30 +0200, Jan Kara wrote: > > > > > > On Wed 21-06-23 12:57:19, Jeff Layton wrote: > > > > > > > On Wed, 2023-06-21 at 18:48 +0200, Jan Kara wrote: > > > > > > > > On Wed 21-06-23 10:45:28, Jeff Layton wrote: > > > > > > > > > In later patches, we're going to change how the ctime.tv_nsec field is > > > > > > > > > utilized. Switch to using accessor functions instead of raw accesses of > > > > > > > > > inode->i_ctime. > > > > > > > > > > > > > > > > > > Signed-off-by: Jeff Layton > > > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > > > > diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c > > > > > > > > > index 1926bec2c850..c964316be32b 100644 > > > > > > > > > --- a/fs/bfs/inode.c > > > > > > > > > +++ b/fs/bfs/inode.c > > > > > > > > > @@ -82,10 +82,10 @@ struct inode *bfs_iget(struct super_block *sb, unsigned long ino) > > > > > > > > > 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->i_ctime.tv_sec = le32_to_cpu(di->i_ctime); > > > > > > > > > + inode_ctime_set_sec(inode, le32_to_cpu(di->i_ctime)); > > > > > > > > > inode->i_atime.tv_nsec = 0; > > > > > > > > > inode->i_mtime.tv_nsec = 0; > > > > > > > > > - inode->i_ctime.tv_nsec = 0; > > > > > > > > > + inode_ctime_set_nsec(inode, 0); > > > > > > > > > > > > > > > > So I'm somewhat wondering here - in other filesystem you construct > > > > > > > > timespec64 and then use inode_ctime_set(). Here you use > > > > > > > > inode_ctime_set_sec() + inode_ctime_set_nsec(). What's the benefit? It > > > > > > > > seems these two functions are not used that much some maybe we could just > > > > > > > > live with just inode_ctime_set() and constructing timespec64 when needed? > > > > > > > > > > > > > > > > Honza > > > > > > > > > > > > > > The main advantage is that by using that, I didn't need to do quite so > > > > > > > much of this conversion by hand. My coccinelle skills are pretty > > > > > > > primitive. I went with whatever conversion was going to give minimal > > > > > > > changes, to the existing accesses for the most part. > > > > > > > > > > > > > > We could certainly do it the way you suggest, it just means having to > > > > > > > re-touch a lot of this code by hand, or someone with better coccinelle > > > > > > > chops suggesting a way to declare a temporary variables in place. > > > > > > > > > > > > Well, maybe temporary variables aren't that convenient but we could provide > > > > > > function setting ctime from sec & nsec value without having to declare > > > > > > temporary timespec64? Attached is a semantic patch that should deal with > > > > > > that - at least it seems to handle all the cases I've found. > > > > > > > > > > > > > > > > Ok, let me try respinning this with your cocci script and see how it > > > > > looks. > > > > > > > > > > Damien also suggested in a reply to the zonefs patch a preference for > > > > > the naming style you have above. Should I also rename these like? > > > > > > > > > > inode_ctime_peek -> inode_get_ctime > > > > > inode_ctime_set -> inode_set_ctime > > > > > > > > > > This would be the time to change it if that's preferred. > > > > > > > > I don't really care much so whatever you decide is better :) > > > > > > I have a mild preference for inode_{get,set}_ctime(). > > > > Jeff, did you plan on sending a v2 with this renamed or do you want me > > to pick this up now? > > I'm working on a new set that I'll send out in a few days. Sorry it has > taken a while, I spent quite a bit of time trying to improve my > coccinelle chops for this. Absolutely no problem of course. I just wanted to check that I didn't pointlessly delay you by not taking care of this. Thanks!