block: test-iosched: Add support for setting rq_disk
Some block devices requires the rq_disk field to be assigned. This patch exposes a new API to the block device test utility for getting the rq_disk assigned, in the created request. Change-Id: I61dc4dad50eb7600728156a6cd08bb1ee134df0d Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
This commit is contained in:
parent
28e42664db
commit
a3c942633c
2 changed files with 4 additions and 0 deletions
|
@ -361,6 +361,8 @@ struct test_request *test_iosched_create_test_req(int is_err_expcted,
|
||||||
test_rq->req_completed = false;
|
test_rq->req_completed = false;
|
||||||
test_rq->req_result = -EINVAL;
|
test_rq->req_result = -EINVAL;
|
||||||
test_rq->rq = rq;
|
test_rq->rq = rq;
|
||||||
|
if (ptd->test_info.get_rq_disk_fn)
|
||||||
|
test_rq->rq->rq_disk = ptd->test_info.get_rq_disk_fn();
|
||||||
test_rq->is_err_expected = is_err_expcted;
|
test_rq->is_err_expected = is_err_expcted;
|
||||||
rq->elv.priv[0] = (void *)test_rq;
|
rq->elv.priv[0] = (void *)test_rq;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ typedef int (post_test_fn) (struct test_data *);
|
||||||
typedef char* (get_test_case_str_fn) (struct test_data *);
|
typedef char* (get_test_case_str_fn) (struct test_data *);
|
||||||
typedef void (blk_dev_test_init_fn) (void);
|
typedef void (blk_dev_test_init_fn) (void);
|
||||||
typedef void (blk_dev_test_exit_fn) (void);
|
typedef void (blk_dev_test_exit_fn) (void);
|
||||||
|
typedef struct gendisk* (get_rq_disk_fn) (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enum test_state - defines the state of the test
|
* enum test_state - defines the state of the test
|
||||||
|
@ -141,6 +142,7 @@ struct test_info {
|
||||||
post_test_fn *post_test_fn;
|
post_test_fn *post_test_fn;
|
||||||
get_test_case_str_fn *get_test_case_str_fn;
|
get_test_case_str_fn *get_test_case_str_fn;
|
||||||
unsigned long test_duration;
|
unsigned long test_duration;
|
||||||
|
get_rq_disk_fn *get_rq_disk_fn;
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue