Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp828684rwl; Wed, 12 Apr 2023 04:51:12 -0700 (PDT) X-Google-Smtp-Source: AKy350YofKEvS8B1Hi1a6dwg0A0oz49wzCJgosZwCH+e2bjxB1bFqmUK39T2BVIoftL3GCS19J/3 X-Received: by 2002:a17:902:ce8b:b0:1a6:4a64:4d27 with SMTP id f11-20020a170902ce8b00b001a64a644d27mr11758857plg.40.1681300271825; Wed, 12 Apr 2023 04:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681300271; cv=none; d=google.com; s=arc-20160816; b=FWyWjHTwSA5R5CTyhAYWnNweIzkNkjik1ijYy4nfBGmuqBPvNE6yeHkYv+/Kw7RizN D56XhzxPVZeQ1szmNP0+00Kh3JIccxqzrKbWUMXe12X9K+1+UCiYPIlQQlAf8Gb7zAJE uChb9kW01tRANa5ujA0ac1TKWBo4BP021CMbOT+9gZSxcrAlKPVsiD1hhpKTGz2twWGo w2Uc4MLRW7Lx084lYZyI6eF1LqJHLCsaqfj5eFuapsclp2D9cy6BDoGPCEPmDIaDnc1s 5lBMRs0UUglf7rmCsY8VChfmRKmWncSsEVm7nXeyoruzyzry2uXy2xsN3cNUTv0zWY5x EAjA== 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=4RDlPZj6huWQXf9wPO/8vbSDC05lQlt4BDA+orp3WvQ=; b=zvyzLXvon18RRWDJktXKKqtQ0RLVGZyJkEaXrWq9O/g1GYISDiLYF0e3krxVwsd5JU ukYLuGcozWP1qJs10uCeeKHgjPiAD/kd4RlmfFcO/NdDFB+RgT15qXXGBU6uOr3udQ5G 0fG9/kFYYgEDSbUViiXFCMqB6w6XWeHs9RGxRrHSOqDMc9+QVagBKc7rh4gKR7M18hCc JcKezuM6Rdlv6kp0IZ5Mc5HNUYfcf52WDQ2eVnmFKUIyFF2ctawJAJKwG/lzuGN6iWGB rnutPkOLntfxVKsk+R+O3o24rNdkr+d5iqmUxQaJBbfN8yNu0erfD1nrTSmZFvqUGXjd 6nPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4rqqYiKp; 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 c22-20020a170902849600b00195f4f578fasi15520881plo.564.2023.04.12.04.50.55; Wed, 12 Apr 2023 04:51:11 -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=@infradead.org header.s=bombadil.20210309 header.b=4rqqYiKp; 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 S230294AbjDLLn0 (ORCPT + 99 others); Wed, 12 Apr 2023 07:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbjDLLnW (ORCPT ); Wed, 12 Apr 2023 07:43:22 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD6F11A2; Wed, 12 Apr 2023 04:43:04 -0700 (PDT) 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=4RDlPZj6huWQXf9wPO/8vbSDC05lQlt4BDA+orp3WvQ=; b=4rqqYiKp1rLMovByAJ2i1MjUMe ibOx+uLL7mmqLmrkuiiqoy7wrqH7DJUq/X10wu1BgKRNFq2b0nLjl5zKMV5UG3CwhmpkF+qpdZzyW QIn88UxNVdzA0d1DqkeyfMtPsctBaFrxH9+TsmY+diXuTi7kT7lANxEBbL0liHML+xQNxtBlOdNza QZ1j5NHGmoya2Mz885ynLaM8GSxwfMTzR7squgmI+DnibVUtdQ1ia0HQ2QN0bCV5zPPMkGTy/lJow xft6750JrQaam/4gZmKny5R0c1phSzxjJa8BpSHMS7iSbHL9zxlFb3aJm5bz72rv1sgQLjR5Vzin4 ZJSk5Srg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pmYsR-002vMZ-0A; Wed, 12 Apr 2023 11:43:03 +0000 Date: Wed, 12 Apr 2023 04:43:03 -0700 From: Christoph Hellwig To: Matthew Wilcox Cc: Christoph Hellwig , "Ritesh Harjani (IBM)" , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara , "Darrick J . Wong" , Ojaswin Mujoo Subject: Re: [RFCv2 2/8] libfs: Add __generic_file_fsync_nolock implementation Message-ID: References: <6fad2ec25bccbbb9b3effbd18c2d6d6965b9a33c.1681188927.git.ritesh.list@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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-ext4@vger.kernel.org On Tue, Apr 11, 2023 at 01:33:17PM +0100, Matthew Wilcox wrote: > On Mon, Apr 10, 2023 at 10:27:10PM -0700, Christoph Hellwig wrote: > > On Tue, Apr 11, 2023 at 10:51:50AM +0530, Ritesh Harjani (IBM) wrote: > > > +/** > > > + * __generic_file_fsync_nolock - generic fsync implementation for simple > > > + * filesystems with no inode lock > > > > No reallz need for the __ prefix in the name. > > It kind of makes sense though. > > generic_file_fsync does the flush > __generic_file_fsync doesn't do the flush > __generic_file_fsync_nolock doesn't do the flush and doesn't lock/unlock Indeed. Part of it is that the naming is a bit horrible. Maybe it should move to buffer.c and be called generic_buffer_fsync, or generic_block_fsync which still wouldn't be perfect but match the buffer.c naming scheme. > > > > +extern int __generic_file_fsync_nolock(struct file *, loff_t, loff_t, int); > > > > No need for the extern. And at least I personally prefer to spell out > > the parameter names to make the prototype much more readable. > > Agreed, although I make an exception for the 'struct file *'. Naming that > parameter adds no value, but a plain int is just obscene. > > int __generic_file_fsync_nolock(struct file *, loff_t start, loff_t end, > bool datasync); While I agree that it's not needed for the file, leaving it out is a bit silly. > (yes, the other variants don't use a bool for datasync, but they should) .. including the ->fsync prototype to make it work ..