Re: [dm-devel] [PATCH v14 03/11] block: add copy offload support

2023-08-14 Thread Nitesh Shetty
On Sat, Aug 12, 2023 at 3:10 AM Bart Van Assche wrote: > > 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 s

Re: [dm-devel] [PATCH v14 03/11] block: add copy offload support

2023-08-14 Thread Nitesh Shetty
On 23/08/11 03:06PM, Bart Van Assche wrote: On 8/11/23 03:52, Nitesh Shetty wrote: + if (rem != chunk) + atomic_inc(&cio->refcount); This code will be easier to read if the above if-test is left out and if the following code is added below the for-loop:

Re: [dm-devel] [PATCH v14 03/11] block: add copy offload support

2023-08-11 Thread Bart Van Assche
On 8/11/23 03:52, Nitesh Shetty wrote: + if (rem != chunk) + atomic_inc(&cio->refcount); This code will be easier to read if the above if-test is left out and if the following code is added below the for-loop: if (atomic_dec_and_test(&cio->refcount))

Re: [dm-devel] [PATCH v14 03/11] block: add copy offload support

2023-08-11 Thread Bart Van Assche
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. + *

[dm-devel] [PATCH v14 03/11] block: add copy offload support

2023-08-11 Thread Nitesh Shetty
Introduce blkdev_copy_offload to perform copy offload. Issue REQ_OP_COPY_SRC with source info along with taking a plug. This flows till request layer and waits for dst bio to arrive. Issue REQ_OP_COPY_DST with destination info and this bio reaches request layer and merges with src request. For any