• NeilBrown's avatar
    rbd: use bio_clone_fast() instead of bio_clone() · f856dc36
    NeilBrown authored
    bio_clone() makes a copy of the bi_io_vec, but rbd never changes that,
    so there is no need for a copy.
    bio_clone_fast() can be used instead, which avoids making the copy.
    
    This requires that we provide a bio_set.  bio_clone() uses fs_bio_set,
    but it isn't, in general, safe to use the same bio_set at different
    levels of the stack, as that can lead to deadlocks.  As filesystems
    use fs_bio_set, block devices shouldn't.
    
    As rbd never stacks, it is safe to have a single global bio_set for
    all rbd devices to use.  So allocate that when the module is
    initialised, and use it with bio_clone_fast().
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    f856dc36
rbd.c 167 KB