Re: [PATCH 03/10] iomap: convert misc simple ops to incremental advance

Christoph Hellwig
2025-02-13T06:54:43Z

> + u64 length = iomap_length(iter);
> +
> switch (iomap->type) {
> case IOMAP_MAPPED:
> case IOMAP_UNWRITTEN:
> @@ -132,7 +134,8 @@ static loff_t iomap_swapfile_iter(const struct iomap_iter *iter,
> return error;
> memcpy(&isi->iomap, iomap, sizeof(isi->iomap));
> }
> - return iomap_length(iter);
> +
> + return iomap_iter_advance(iter, &length);

I notice that for many of these callers passing in the length as in/out
argument isn't all that great. Not sure that's worth changing now (or
adding another helper?). The conversion itself looks good.