[dm-devel] Replacement for dm_dispatch_request for older request based targets

Tariq Mustafa tmustafa at hotmail.com
Wed Nov 1 18:54:20 UTC 2017


Sorry, here is a correction to my last comment;


.map_rq would be returning DM_MAPIO_SUBMITTED for this IO

________________________________
From: dm-devel-bounces at redhat.com <dm-devel-bounces at redhat.com> on behalf of Tariq Mustafa <tmustafa at hotmail.com>
Sent: Wednesday, November 1, 2017 11:10:58 AM
To: Mike Snitzer
Cc: dm-devel at redhat.com
Subject: Re: [dm-devel] Replacement for dm_dispatch_request for older request based targets


Thanks Mike. I was looking at the request based crypt, and saw the following code;


static void req_crypt_dec_pending_encrypt(struct req_dm_crypt_io *io)
{
        int error = 0;
        struct request *clone = NULL;

        if (io) {
                error = io->error;
                if (io->cloned_request) {
                        clone = io->cloned_request;
                } else {
                ....

                }
        } else {

                ....
        }

        atomic_dec(&io->pending);

        if (error < 0)
                dm_kill_unmapped_request(clone, error);
        else
                dm_dispatch_request(clone);    <----
}


Here I think the request is being sent to the underlying device below the target (I think the .map_rq would be returning DM_MAPIO_REMAPPED for this IO). Now with "dm_dispatch_request()" deprecated, how would this be done now?


Additional question:

Also for bio based targets, there is a facility within target to allocate some space using the "per_bio_data_size", and then use that in the "map" callback using the "dm_per_bio_data()", do we have an equivalent mechanism for request based targets. I saw some patch where there are there is something about letting request based targets to use this ("per_io_data_size"), but I did not see anything the version of kernel that I have - Ubuntu 16.04 (4.4.0-92).


Thank you!

________________________________
From: Mike Snitzer <snitzer at redhat.com>
Sent: Wednesday, November 1, 2017 9:08:57 AM
To: Tariq Mustafa
Cc: dm-devel at redhat.com
Subject: Re: Replacement for dm_dispatch_request for older request based targets

On Wed, Nov 01 2017 at  2:23am -0400,
Tariq Mustafa <tmustafa at hotmail.com> wrote:

>    Hello,
>
>    I am trying to figure out what would be the appropriate replacement for
>    "dm_dispatch_request()" on the newer kernel? This export has been removed
>    (by commit - [1][dbf978]), what would be an equivalent call to submit the
>    request.

dm_dispatch_request was renamed to dm_dispatch_clone_request (IIRC).

But are you asking what is the new export?  There isn't one.  There
should be no need for anything other than DM core (dm-rq.c) to call
these interfaces that are no longer exported.

Please explain what you're trying to do if you need more help.

Thanks,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20171101/39b3b801/attachment.htm>


More information about the dm-devel mailing list