summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDolev Raviv <draviv@codeaurora.org>2013-01-09 12:00:02 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:01:45 -0700
commita3c942633cb27ee8c896454a070585d236a740d0 (patch)
tree75f023aec52d53d5e5b6f9e9bea2c9f43e873394
parent28e42664db57125091cac6c9d582142135bf19d6 (diff)
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>
-rw-r--r--block/test-iosched.c2
-rw-r--r--include/linux/test-iosched.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/block/test-iosched.c b/block/test-iosched.c
index d44a4c10f437..f19945c36b91 100644
--- a/block/test-iosched.c
+++ b/block/test-iosched.c
@@ -361,6 +361,8 @@ struct test_request *test_iosched_create_test_req(int is_err_expcted,
test_rq->req_completed = false;
test_rq->req_result = -EINVAL;
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;
rq->elv.priv[0] = (void *)test_rq;
diff --git a/include/linux/test-iosched.h b/include/linux/test-iosched.h
index a4e0c9171957..fda835a6f7a4 100644
--- a/include/linux/test-iosched.h
+++ b/include/linux/test-iosched.h
@@ -38,6 +38,7 @@ typedef int (post_test_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_exit_fn) (void);
+typedef struct gendisk* (get_rq_disk_fn) (void);
/**
* enum test_state - defines the state of the test
@@ -141,6 +142,7 @@ struct test_info {
post_test_fn *post_test_fn;
get_test_case_str_fn *get_test_case_str_fn;
unsigned long test_duration;
+ get_rq_disk_fn *get_rq_disk_fn;
void *data;
};