Re: [PATCH v2 2/7] iomap: factor out iomap length helper

Brian Foster
2025-01-28T13:51:19Z

On Mon, Jan 27, 2025 at 09:26:15PM -0800, Christoph Hellwig wrote:
> > +static inline u64 iomap_length_trim(const struct iomap_iter *iter, loff_t pos,
> > + u64 len)
> > +{
> > + u64 end = iter->iomap.offset + iter->iomap.length;
> > +
> > + if (iter->srcmap.type != IOMAP_HOLE)
> > + end = min(end, iter->srcmap.offset + iter->srcmap.length);
> > + return min(len, end - pos);
>
> Does this helper warrant a kerneldoc comment similar to iomap_length?
>

Can't hurt I suppose. I'll add one.

> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>

Thanks.

Brian