Skip to contentSkip to conversation

block: add copy offload support

PATCH Christoph Hellwig 1 participant 1 message Jun 6, 2024

Subsystems (5)
lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw
Quoted 11 lines · Nitesh Shetty
Quoted 11 lines

Review

Quoted 6 lines
(quoted diff) +6 -0
+	if (!cio)
+		return -ENOMEM;
+	atomic_set(&cio->refcount, 1);
+	cio->waiter = current;
+	cio->endio = endio;
+	cio->private = private;

For the main use this could be allocated on-stack. Is there any good reason to not let callers that really want an async version to implement the async behavior themselves using suitable helpers?

Quoted 6 lines

We cannot do on-stack allocation of cio as we use it in endio handler. cio will be used to track partial IO completion as well. Callers requiring async implementation would need to manage all this bookkeeping themselves, leading to duplication of code. We felt it is better to do it here onetime.
Do you see it any differently ?

We don't really to these async variants for other in-kernel I/O, so unless we have a really good reason I'd not do here. The usual approach is to just have a submission helper for async in-kernel special bios types, and the let the caller handle the rest.