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 B51F6C433EF for ; Wed, 18 May 2022 08:46:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233521AbiERIqJ (ORCPT ); Wed, 18 May 2022 04:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233512AbiERIqE (ORCPT ); Wed, 18 May 2022 04:46:04 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B95E205C2 for ; Wed, 18 May 2022 01:46:03 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 964AD68AFE; Wed, 18 May 2022 10:46:00 +0200 (CEST) Date: Wed, 18 May 2022 10:46:00 +0200 From: Christoph Hellwig To: Johannes Thumshirn Cc: Christoph Hellwig , Chris Mason , Josef Bacik , David Sterba , Qu Wenruo , "linux-btrfs@vger.kernel.org" Subject: Re: [PATCH 05/15] btrfs: add a helper to iterate through a btrfs_bio with sector sized chunks Message-ID: <20220518084600.GD6933@lst.de> References: <20220517145039.3202184-1-hch@lst.de> <20220517145039.3202184-6-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Tue, May 17, 2022 at 03:27:35PM +0000, Johannes Thumshirn wrote: > On 17/05/2022 16:51, Christoph Hellwig wrote: > > +/* > > + * Iterate through a btrfs_bio (@bbio) on a per-sector basis. > > + */ > > +#define btrfs_bio_for_each_sector(fs_info, bvl, bbio, iter, bio_offset) \ > > + for ((iter) = (bbio)->iter, (bio_offset) = 0; \ > > + (iter).bi_size && \ > > + (((bvl) = bio_iter_iovec((&(bbio)->bio), (iter))), 1); \ > > + (bio_offset) += fs_info->sectorsize, \ > > + bio_advance_iter_single(&(bbio)->bio, &(iter), \ > > + (fs_info)->sectorsize)) > > + > > + > > This is first used in patch 12 why not move there? Because it is a logically separate change that doesn't really have anything to do with the repair code, except that it happens to be the first user?