Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1011663rwl; Wed, 12 Apr 2023 07:11:49 -0700 (PDT) X-Google-Smtp-Source: AKy350YAZuSV95FAbdXZWoLOLkWJqjQW3edGPN1YctHY1JemAJil/O/Wef0mPkbTq6nqc8LVneZn X-Received: by 2002:a17:907:6e09:b0:94e:6eb1:3d6b with SMTP id sd9-20020a1709076e0900b0094e6eb13d6bmr1908537ejc.24.1681308708759; Wed, 12 Apr 2023 07:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681308708; cv=none; d=google.com; s=arc-20160816; b=MwnhPjAGxygz1hy4HdFtJMYmJGjcHtnBUUf/mEcHj7vvCWmXmfhn4h2Et0XZochieS n+FK6YmP4EpAWWgpBhO+PCFSDHLiLqMGuVPFAbmS+B8smDKUJ0lCJhZASOA//7mlHLDO PJ04bLPGHBkFC0DBmj6QY5inz1VXm36/T6vpSvzYnYuPtstnXzG+tRHOCW64axLEr/4D 0JPJ/X03WSiTqUbVT9hnDsz1i1layrQd3NjSSgC2bQnZVqrsktX1v9RktFuwzdkm718A JcHhrZuikr/3a09TJfigVQeoogsh1Pz/H2peuCybfEr7BkvW/mJQobCRCg2XvOTOYeVF tlpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:subject:cc:to:from:message-id:date :dkim-signature; bh=LfXiPKzEOSNYmq3ecIzWJmmSwndeoTw2yVUw7BNVDQk=; b=SwV5CBULBZ0I7CJd7vtBOUjkXJgsviA8tvwBjdh7I0gCujRu6Qq571T2lzIDVAvhDZ gu7xLr7sqWpteRpgj9Bgt3ZMZ/l9syhsWYvfdHvgQtbU6voujfek2YDS0ZnkRyTFPV2/ DF9SHrZOyUDRwP2nB48VVnKUovYDW5GjVmTXrDGoIMFm6fs7DqQt8UiFm+oPoLLQy0pZ fQuX0pPhTedXsN98Ee/04igKiXYzMuGe1LQJIb2Uiw4WLukLf9ubD0YnxQlJ4vtmaqlU 6u3p7f2jMguN57HGBFDyr+S1SRpsUxbcrQ0XJ8T4zD/RKPiQxOSPDDBth2xYJ9loc7ju 3dig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DJnhf3fs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a170906308e00b009473bbe627esi13364072ejv.414.2023.04.12.07.11.20; Wed, 12 Apr 2023 07:11:48 -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=@gmail.com header.s=20221208 header.b=DJnhf3fs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbjDLOCz (ORCPT + 99 others); Wed, 12 Apr 2023 10:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbjDLOCx (ORCPT ); Wed, 12 Apr 2023 10:02:53 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48C3E7ABC; Wed, 12 Apr 2023 07:02:46 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id p8so11553138plk.9; Wed, 12 Apr 2023 07:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681308166; x=1683900166; h=in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=LfXiPKzEOSNYmq3ecIzWJmmSwndeoTw2yVUw7BNVDQk=; b=DJnhf3fs41FSBzBsQ4sNxLRnb7Ikaefu3ml2kqh9buX9ZLG+RNpovZYAjkZ2+yH5mc G4MrLN5O43+BymtlqHKG93wnmFRakY0r+IinxHMyltQmrhjd1woRTgtRwV1Qk+0G3cna yCQF6lerBcHHiBL5fD73M5Mu5b2QTDDFYTUfYWhy7e+i/ZGTKd9pRpjtiM5FOdallRoF 6q90bgJV3gO9Gr65EBWEkKfdDM7d6SS459JHLUlU+DPJMLrMLH5zZ2tixBBYxGfNvRdM eGw5W9Q8BZ8VtEJhKITNgTnSpk8FKvmduTpj0zy8k4Z1bBz3Rr10vUcNA/jn9yKKEYpr XOpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681308166; x=1683900166; h=in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=LfXiPKzEOSNYmq3ecIzWJmmSwndeoTw2yVUw7BNVDQk=; b=XZIFkc1esqIFMMH73k9dwFnuCF0ys8+xeekNIUQ5j8OlnXDmYGDjCTj0yyquQZc91l IoItoVf5pFnR83ntOvpphjJ8+WRN8/A5jFOOrhGzKRt4ZUtMuokucBlEXheDzB/eaAHB xoSJBiuplu7V+oOUg3MRx0TMLUqPpC0hbAIri9vX8/LnRTJIXVy/MAOSSmI1mOEWYZde a7lA0cr2jcPPPv91wj1Iss7MeIB/1aVnzy/BcwDe8w2PmTUSfjvdLSAI7z+BT37tfL8y hMConv7ugq07Nas5v7P3QQ4sB0/Im31BaZgTU3RTmdss0QIf9Pqc8KL9TiTZDWy7VDq2 E16A== X-Gm-Message-State: AAQBX9fgjYmY5SlwZWclAHHw00yRlsrHTcBqtfuidkgCgVeHakTMopvc lWL86DDwsdT0HkoTmbxweEo= X-Received: by 2002:a17:902:7fc5:b0:1a1:cce7:94ed with SMTP id t5-20020a1709027fc500b001a1cce794edmr17725943plb.67.1681308165007; Wed, 12 Apr 2023 07:02:45 -0700 (PDT) Received: from rh-tp ([2406:7400:63:7035:9095:349e:5f0b:ded0]) by smtp.gmail.com with ESMTPSA id m18-20020a170902bb9200b0019d1f42b00csm10486254pls.17.2023.04.12.07.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:02:44 -0700 (PDT) Date: Wed, 12 Apr 2023 19:32:26 +0530 Message-Id: <87ttxlyz9p.fsf@doe.com> From: Ritesh Harjani (IBM) To: Christoph Hellwig , Matthew Wilcox Cc: Christoph Hellwig , 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 In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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-ext4@vger.kernel.org Christoph Hellwig writes: > 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. > Eventually it anyways needs some work to see if we can kill the lock variant all together. I didn't do that in this series which is focused on ext2 conversion of iomap. So, if it's not that bad, I would like to keep both function definitions at one place so that it can be worked out later. >> >> > > +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. > Sure. Will fix it. >> (yes, the other variants don't use a bool for datasync, but they should) > > .. including the ->fsync prototype to make it work .. Sure, this work should go as a seperate series. -ritesh