lkml.org 
[lkml]   [2010]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] block: make sure FSEQ_DATA request has the same rq_disk as the original
    Hi Tejun,

    On 09/03/2010 06:33 PM +0900, Tejun Heo wrote:
    > On 09/03/2010 07:47 AM, Kiyoshi Ueda wrote:
    >> By the way, I had been considering a block-layer interface which remaps
    >> struct request and its bios to a block device such as:
    >> void blk_remap_request(struct request *rq, struct block_device *bdev)
    >> {
    >> rq->rq_disk = bdev->bd_disk;
    >>
    >> __rq_for_each_bio(bio, rq) {
    >> bio->bi_bdev = bdev->bd_disk;
    >> }
    >> }
    >>
    >> If there is such an interface and remapping drivers use it, then these
    >> kind of issues may be avoided in the future.
    >
    > I think the problem is more with request initialization. After all,
    > once bios are packed into a request, they are (or at least should be)
    > just data containers. We now have multiple request init paths in
    > block layer and different ones initialize different subsets and it's
    > not very clear which fields are supposed to be initialized to what by
    > whom.
    >
    > But yeah I agree removing discrepancy between request and bio would be
    > nice to have too. It's not really remapping tho. Maybe just
    > blk_set_rq_q() or something like that (it should also set rq->q)?

    Thank you for pointing it.
    Yes, the interface should also set rq->q.

    About the naming of the interface, blk_set_<something> sounds
    reasonable to me.
    But does blk_set_rq_q() take request and queue as arguments?
    Then, I'm afraid we can't find bdev for bio from given queue.

    Thanks,
    Kiyoshi Ueda


    \
     
     \ /
      Last update: 2010-09-03 12:35    [W:0.021 / U:124.188 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site