Re: [PATCH 1/5] block: new sector copy api

Keith Busch
2025-05-28T22:42:01Z

On Wed, May 28, 2025 at 12:46:03AM -0700, Christoph Hellwig wrote:
> On Tue, May 27, 2025 at 11:45:26AM -0600, Keith Busch wrote:
> > Just fyi, the initial user I was planning to target with the block
> > layer's copy fallback isn't in kernel yet. Just an RFC at this moment on
> > btrfs:
> >
> > https://lore.kernel.org/linux-btrfs/20250515163641.3449017-10-maharmstone@fb.com/
> >
> > The blk-lib function could easily replace that patch's "do_copy()"
> > without to much refactoring on the btrfs side.
>
> Well, that code would be much better off using a long living buffer,
> because the frequent allocations are worse.

No argument against that. I'm just adding context for where this blk lib
patch was targeted. I'm happy to help on both sides to make it more
usable, though refactoring other block copy implementations (splice,
kcopyd, xfs gc) to a common api looks like a much longer term project.