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 56E3DC6FD1C for ; Sat, 25 Mar 2023 08:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231477AbjCYIbt (ORCPT ); Sat, 25 Mar 2023 04:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbjCYIbs (ORCPT ); Sat, 25 Mar 2023 04:31:48 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F401018156 for ; Sat, 25 Mar 2023 01:31:47 -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=2IG6NNBm2XMz3pHc4KRttKqCAgXAJxU1IebDuHDQFcg=; b=rVFsbOhbk3H7pZdvwhPz4pQrXE DA0fU2AL3ZZfoFZZXG5xexp2r0KoyRZUI6zZjwrwvJSOCuOBnJ6HYLFbp6d16hHdgbbweV8f1jqBz m+L/YiZIYSwzxVeb0iPL2B0B6nh3dfwKCvLgtyhrKMCr4/fz+gWNDVLMdUaPXVp9sFFDzxnZQgkUc dGxrTdpO6MbivdohMShBHMqqAprpi/LAY7QmDzpMjTvq6JYT87TE05b3466YSHssiU3DLl26KlTmS AZ2T4QtM7H+1FwtinnfaApB3GwqsR7+jfnkMiO9aPRPT+6a57uo6158X16sLqetkgOufvycfS0uWU 4+fIzBfA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pfzJS-006SAD-0X; Sat, 25 Mar 2023 08:31:46 +0000 Date: Sat, 25 Mar 2023 01:31:46 -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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9581646d-380f-2b55-07ac-2abd37822577@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:21:41PM +0800, Qu Wenruo wrote: > No big deal, I can go with the extra fs_info parameter for btrfs_bio_init() > and btrfs_bio_alloc(). 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. > The main reason I go with the duplicated allocate is to remove the need for > nr_vecs, but that's pretty minor, thus not a critical one. Passing nr_vecs might actually make sense. There is no need to always allocated all of them for existing callers either, so we can do additional optimizations based on that later.