From: Jeff Moyer <jmoyer@redhat.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>,
linux-kernel@vger.kernel.org,
device-mapper development <dm-devel@redhat.com>,
Boaz Harrosh <bharrosh@panasas.com>,
"Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
Subject: Re: [PATCH block#for-2.6.31] block: add request clone interface (v2)
Date: Thu, 11 Jun 2009 08:53:42 -0400 [thread overview]
Message-ID: <x49vdn3lynd.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20090611110903.GO11363@kernel.dk> (Jens Axboe's message of "Thu, 11 Jun 2009 13:09:03 +0200")
Jens Axboe <jens.axboe@oracle.com> writes:
> On Thu, Jun 11 2009, Kiyoshi Ueda wrote:
>> Hi Jens,
>>
>> This patch adds the following 2 interfaces for request-stacking drivers:
>>
>> - blk_rq_prep_clone(struct request *clone, struct request *orig,
>> struct bio_set *bs, gfp_t gfp_mask,
>> int (*bio_ctr)(struct bio *, struct bio*, void *),
>> void *data)
>> * Clones bios in the original request to the clone request
>> (bio_ctr is called for each cloned bios.)
>> * Copies attributes of the original request to the clone request.
>> The actual data parts (e.g. ->cmd, ->buffer, ->sense) are not
>> copied.
>>
>> - blk_rq_unprep_clone(struct request *clone)
>> * Frees cloned bios from the clone request.
>>
>> Request stacking drivers (e.g. request-based dm) need to make a clone
>> request for a submitted request and dispatch it to other devices.
>>
>> To allocate request for the clone, request stacking drivers may not
>> be able to use blk_get_request() because the allocation may be done
>> in an irq-disabled context.
>> So blk_rq_prep_clone() takes a request allocated by the caller
>> as an argument.
>>
>> For each clone bio in the clone request, request stacking drivers
>> should be able to set up their own completion handler.
>> So blk_rq_prep_clone() takes a callback function which is called
>> for each clone bio, and a pointer for private data which is passed
>> to the callback.
>>
>> NOTE:
>> blk_rq_prep_clone() doesn't copy any actual data of the original
>> request. Pages are shared between original bios and cloned bios.
>> So caller must not complete the original request before the clone
>> request.
>
> This looks good to me now, I've applied it.
Is blk_rq_unprep_clone really the best name?
^^^^^^
Cheers,
Jeff
next prev parent reply other threads:[~2009-06-11 12:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 3:10 Kiyoshi Ueda
2009-06-11 11:09 ` Jens Axboe
2009-06-11 12:53 ` Jeff Moyer [this message]
2009-06-12 13:30 ` Jens Axboe
2009-06-12 14:33 ` Jeff Moyer
2009-06-15 3:31 ` Kiyoshi Ueda
2009-06-15 9:30 ` Boaz Harrosh
2009-06-16 3:02 ` Kiyoshi Ueda
2009-06-16 8:02 ` Boaz Harrosh
2009-06-16 12:35 ` Jeff Moyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x49vdn3lynd.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=bharrosh@panasas.com \
--cc=dm-devel@redhat.com \
--cc=j-nomura@ce.jp.nec.com \
--cc=jens.axboe@oracle.com \
--cc=k-ueda@ct.jp.nec.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®