[dm-devel] [PATCH][RFC] Use bio markers for request callback
Hannes Reinecke
hare at suse.de
Tue Sep 11 10:44:46 UTC 2007
Hi all,
this is a proposal for a different implementation of request
callbacks. The existing ->endio callback of a request is actually a
destructor function, to be called to terminate a request and free all
structures.
However, on certain occasions (like request-based multipathing) it is
desirable to have a callback function for a request which is called
right after the request is finished, ie in end_that_request_first()
before any bio->bi_endio callback is called.
So a simple solution for this is to clone the request and add a new
'marker' bio in front of the bio list of the request. This callback
will be attached a structure in bi_private which keeps a pointer to
the cloned and the original request, thus serving as a callback for
the request itself.
Proposed patch attached. As usual comments are welcome.
Cheers,
Hannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rq-marker-bio
Type: text/x-patch
Size: 38129 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20070911/cb2f190f/attachment.bin>
More information about the dm-devel
mailing list