1
votes

I am building my SLES 12 driver (block device driver) with 3.x kernel on SLES 12 SP2 which has kernel version 4.4.2 . Now I am facing problem with few things:

  1. struct bvec_merge_data

    is not available in kernel 4.3.0 onwards in include/linux/blkdev.h

    struct bvec_merge_data { struct block_device *bi_bdev;
    sector_t bi_sector;
    unsigned bi_size;
    unsigned long bi_rw; };

  2. from 4.2.8 onward this funtion pointer is not present. What might be the alternative method is provided in 4.3 or higher versions.

typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *, struct bio_vec *);

  1. In the request_queue structure the below structure elements are removed form 4.2.8 where these elemments are handled struct request_queue {

unprep_rq_fn *unprep_rq_fn;

merge_bvec_fn *merge_bvec_fn;

Any idea where can I look for these changes and and any alternative for those?

1

1 Answers

1
votes

Best place for such answers is git log of kernel source. Supplying -S switch will search within the diff content. Supplying -G will do same but with regular expressions.

In this case running git log -S "bvec_merge_data" shows information on changes related to this struct and, by association, merge_bvec_fn method. Here's snapshot of the top message which talks about complete removal of struct bvec_merge_data:

commit 8ae126660fddbeebb9251a174e6fa45b6ad8f932 Author: Kent Overstreet Date: Mon Apr 27 23:48:34 2015 -0700

block: kill merge_bvec_fn() completely

As generic_make_request() is now able to handle arbitrarily sized bios,
it's no longer necessary for each individual block driver to define its
own ->merge_bvec_fn() callback. Remove every invocation completely.

Other commit message preceding this one show the build up to it, which can be a good step-by-step explanation to your question.

Hope it helps :)