From: Christoph Hellwig Date: Tue, 10 Aug 2021 09:13:41 +0200 Subject: [Cluster-devel] [PATCH 19/30] iomap: switch iomap_bmap to use iomap_iter In-Reply-To: <20210810063951.GH3601443@magnolia> References: <20210809061244.1196573-1-hch@lst.de> <20210809061244.1196573-20-hch@lst.de> <20210810063951.GH3601443@magnolia> Message-ID: <20210810071341.GB16590@lst.de> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Aug 09, 2021 at 11:39:51PM -0700, Darrick J. Wong wrote: > Can't this at least be rephrased as: > > const uint bno_shift = (mapping->host->i_blkbits - SECTOR_SHIFT); > > while ((ret = iomap_iter(&iter, ops)) > 0) { > if (iter.iomap.type == IOMAP_MAPPED) > bno = iomap_sector(iomap, iter.pos) << bno_shift; > /* leave iter.processed unset to stop iteration */ > } > > to make the loop exit more explicit? Sure.