lkml.org 
[lkml]   [2023]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [dm-devel] [PATCH v14 03/11] block: add copy offload support
From
On 8/11/23 03:52, Nitesh Shetty wrote:
> + * Description:
> + * Copy source offset to destination offset within block device, using
> + * device's native copy offload feature.

Offloading the copy operation is not guaranteed so I think that needs to
be reflected in the above comment.

> + * We perform copy operation by sending 2 bio's.
> + * 1. We take a plug and send a REQ_OP_COPY_SRC bio along with source
> + * sector and length. Once this bio reaches request layer, we form a
> + * request and wait for dst bio to arrive.

What will happen if the queue depth of the request queue at the bottom
is one?

> + blk_start_plug(&plug);
> + dst_bio = blk_next_bio(src_bio, bdev, 0, REQ_OP_COPY_DST, gfp);

blk_next_bio() can return NULL so its return value should be checked.

> + dst_bio->bi_iter.bi_size = chunk;
> + dst_bio->bi_iter.bi_sector = pos_out >> SECTOR_SHIFT;
> + dst_bio->bi_end_io = blkdev_copy_offload_dst_endio;
> + dst_bio->bi_private = offload_io;

Thanks,

Bart.

\
 
 \ /
  Last update: 2023-08-11 23:34    [W:0.228 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site