lkml.org 
[lkml]   [2009]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 7/8] blk-map: let blk_rq_map_user_iov() support null mapping
    Date
    Impact: API expansion

    Till now, only blk_rq_map() supported null mapping. Add null mapping
    support to blk_rq_map_user_iov() by moving BIO_NULL_MAPPED setting to
    bio_copy_user_iov().

    Signed-off-by: Tejun Heo <tj@kernel.org>
    ---
    block/blk-map.c | 3 ---
    fs/bio.c | 4 +++-
    2 files changed, 3 insertions(+), 4 deletions(-)

    diff --git a/block/blk-map.c b/block/blk-map.c
    index 6718021..ac1961d 100644
    --- a/block/blk-map.c
    +++ b/block/blk-map.c
    @@ -63,9 +63,6 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq,
    if (IS_ERR(bio))
    return PTR_ERR(bio);

    - if (map_data && map_data->null_mapped)
    - bio->bi_flags |= (1 << BIO_NULL_MAPPED);
    -
    orig_bio = bio;
    blk_queue_bounce(q, &bio);

    diff --git a/fs/bio.c b/fs/bio.c
    index 8ad9784..728bef9 100644
    --- a/fs/bio.c
    +++ b/fs/bio.c
    @@ -869,7 +869,9 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
    /*
    * success
    */
    - if (!write_to_vm && (!map_data || !map_data->null_mapped)) {
    + if (unlikely(map_data && map_data->null_mapped))
    + bio->bi_flags |= (1 << BIO_NULL_MAPPED);
    + else if (!write_to_vm) {
    ret = __bio_copy_iov(bio, bio->bi_io_vec, iov, iov_count, 0, 0);
    if (ret)
    goto cleanup;
    --
    1.6.0.2


    \
     
     \ /
      Last update: 2009-04-01 13:11    [W:4.160 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site