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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EE8AC7619A for ; Mon, 27 Mar 2023 03:36:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbjC0Dgo (ORCPT ); Sun, 26 Mar 2023 23:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjC0Dgm (ORCPT ); Sun, 26 Mar 2023 23:36:42 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 017CE199C for ; Sun, 26 Mar 2023 20:36:40 -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=hn2FXKgVJAgIPZE8PPUwZQbaTR4JsRAar0l6Pioz3Xs=; b=IjsQ6MMsymbdDfnQex1b46pQRj 2iQDRgGnhKmbGStQqyw2XiG8dcAGODs+hUAZIAT65q6FB2YUKcrINBiMeEtNHkZTUw+OhDWR1mMOS GJa4j3VJLfAqZ0nX3aDlHc53Db+kfEUBwjCz1TG0PQzMK/eVMuYd5XdbCBMZC/ehxSON5TEPfuEfL tXBZXetpZPrey4eXp5eHdCJ3EFgs/W5/pIoL2JyWscncDdjTe41v2RH2BmBNmNiZrpBVsRxJu9Fqy sO0b1mzKZrDX8uz5lGxFfUnIfTYQMs093wFVs9odUTwlof6+W54bUo7u116QlmB635hiAlAhk4Ljf z8xLsORg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pgdew-009fyJ-2H; Mon, 27 Mar 2023 03:36:38 +0000 Date: Sun, 26 Mar 2023 20:36:38 -0700 From: Christoph Hellwig To: Qu Wenruo Cc: Christoph Hellwig , Qu Wenruo , linux-btrfs@vger.kernel.org Subject: Re: [PATCH v3 02/12] btrfs: introduce a new helper to submit bio for scrub Message-ID: References: <0ee1de5c-9cb2-cecf-c4be-02cc16bd505c@gmx.com> <9581646d-380f-2b55-07ac-2abd37822577@gmx.com> <1698cfcc-8beb-7211-2e4f-2e8e5e363ece@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1698cfcc-8beb-7211-2e4f-2e8e5e363ece@gmx.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Sat, Mar 25, 2023 at 04:48:40PM +0800, Qu Wenruo wrote: > > I'd be tempted to just initialize it in the callers given that it's > > an optional field now. I wonder if the same might also make sense > > for ->file_offset. > > In that case, I'm not sure if adding more and more arguments while almost > all of them can be optional is a good idea... > > Shouldn't we only pass mandatory arguments, then let the caller to populate > the optional ones? Yes, that's what I tried to suggest above. Right now inode and file_offset are mandatory, but with your changes they stop being so, so we should stop passing them to the allocation helpers.