[PATCH 1/5] block: new sector copy api
Christoph Hellwig
hch at infradead.org
Fri May 23 05:45:10 PDT 2025
On Wed, May 21, 2025 at 03:31:03PM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch at kernel.org>
>
> Provide a basic block level api to copy a range of a block device's
> sectors to a new destination on the same device. This just reads the
> source data into host memory, then writes it back out to the device at
> the requested destination.
As someone who recently spent a lot of time on optimizing such loops:
having a general API that allocates a buffer for each copy is a bad
idea. You'll want some kind of caller provided longer living allocation
if you do regularly do such copies.
Maybe having common code is good to avoid copies, but I suspect most
real users would want their own.
More information about the Linux-nvme
mailing list