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 X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6C20C433F5 for ; Tue, 7 Sep 2021 08:53:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B42A60F70 for ; Tue, 7 Sep 2021 08:53:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244548AbhIGIya (ORCPT ); Tue, 7 Sep 2021 04:54:30 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:56644 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244735AbhIGIyT (ORCPT ); Tue, 7 Sep 2021 04:54:19 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 42C591FE03; Tue, 7 Sep 2021 08:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631004793; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ME0aIBYcYc1+7Ur+yxutEhpgbu4JA+PKtibcSK+TvFM=; b=HLrAlKH5HM8TxFMdtxzPnpRjRk5JJmtL587bKCGx3FljdZGF6rowiL7x4PF7KTqahQDIbi V44x1pNfXvRme1NRFxz+nKz4GjQRzCWxApoSrXbWn267PztwcVslfmo6mDWw4zLpyqTD6x KDjmrNqxolC3arZTJY1OBqbsaPJV+sI= Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 1D55212FF9; Tue, 7 Sep 2021 08:53:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id 6MyvBHkoN2GRJwAAGKfGzw (envelope-from ); Tue, 07 Sep 2021 08:53:13 +0000 Subject: Re: [PATCH 1/3] btrfs: rename btrfs_io_bio_alloc() to btrfs_bio_alloc_iovecs() To: Qu Wenruo , linux-btrfs@vger.kernel.org References: <20210907074242.103438-1-wqu@suse.com> <20210907074242.103438-2-wqu@suse.com> From: Nikolay Borisov Message-ID: Date: Tue, 7 Sep 2021 11:53:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210907074242.103438-2-wqu@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 7.09.21 г. 10:42, Qu Wenruo wrote: > Function btrfs_io_bio_alloc() is pretty similar to btrfs_bio_alloc(), > the only major difference is the number of iovecs, and whether bi_sector > is initialized. > > Thus there is no need to add the extra "_io", which is only going to > cause confusion. > > Rename it to btrfs_bio_alloc_iovecs() to be easier to read. The only difference between those 2 function is the fact that the latter sets bio->bi_iter.bi_sector. So I'd say those should be turned into 1 function which takes the vecs as parameter as well as the bi_sector. I've checked all callers of io_bio_alloc and we always have the sector when allocating the bio. And this can simply be renamed to btrfs_bio_alloc and be done with it.