From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E662FC433F5 for ; Sun, 22 May 2022 21:54:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 340C28D0003; Sun, 22 May 2022 17:54:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F0718D0001; Sun, 22 May 2022 17:54:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 206918D0003; Sun, 22 May 2022 17:54:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0C0FE8D0001 for ; Sun, 22 May 2022 17:54:44 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A852E20AC2 for ; Sun, 22 May 2022 07:29:48 +0000 (UTC) X-FDA: 79492554456.03.CC827FD Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP id 47939180022 for ; Sun, 22 May 2022 07:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=D1vgKQCOzr8tyZxaNlssCNMEHDUpeBSFVtYkj+gPkKo=; b=PNFXKND4Tu3bYjfu6ohPH+JHPw HoifqEgG0ytQiNWIjiUNRqJsunMjfOzIG7F4goa4LwPPTJh7kwM1Q8cb8G6Ll2FHcSlxj8qrud2AI z3mWEnzytmgL23fMC18zOeXO3MRdaT+CZdTeBFFLDuqK24qO0DvsGJCuKNP19bM7l9r8/X9Xmn7fm BOgOVvnbclbNNClRfGsHXpIzABAQxFlJi0e/Ej6N0TncvnPw4wxHwW0z+EF+fmzUdgZVgzPcg2cL+ 3ilsr+ax/vbY08zh7k8Pz1J9nS7LT0X1ihOKJouOM2aeiJcBTNzBRjylw/3hRlMtXmtcs1v8gG6A3 P1SBgCYg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nsg25-000nUK-BE; Sun, 22 May 2022 07:29:45 +0000 Date: Sun, 22 May 2022 00:29:45 -0700 From: Christoph Hellwig To: Stefan Roesch Cc: io-uring@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com, jack@suse.cz, hch@infradead.org Subject: Re: [RFC PATCH v4 10/17] fs: Split off file_needs_update_time and __file_update_time Message-ID: References: <20220520183646.2002023-1-shr@fb.com> <20220520183646.2002023-11-shr@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520183646.2002023-11-shr@fb.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 47939180022 X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=PNFXKND4; spf=none (imf16.hostedemail.com: domain of BATV+c9e7f944c22607b8b784+6846+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+c9e7f944c22607b8b784+6846+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-Stat-Signature: kyd7iq9oao1kncoos8itm1qinxwjr7kp X-HE-Tag: 1653204575-322032 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, May 20, 2022 at 11:36:39AM -0700, Stefan Roesch wrote: > +static int file_needs_update_time(struct inode *inode, struct file *file, > + struct timespec64 *now) > { > int sync_it = 0; No need to pass both and inode and a file as the former can be trivially derived from the latter. But if I'm not misreading the patch, file is entirely unused here anyway, so can't we just drop it and rename the function to inode_needs_update_time? > +static int __file_update_time(struct inode *inode, struct file *file, > + struct timespec64 *now, int sync_mode) > +{ > + int ret = 0; > > + /* try to update time settings */ > + if (!__mnt_want_write_file(file)) { > + ret = inode_update_time(inode, now, sync_mode); > + __mnt_drop_write_file(file); > + } I'd be tempted to just open code this in the two callers, but either way works for me. If we keep the function please don't pass the inode separately.