2 * Internal header file for device mapper
4 * Copyright (C) 2016 Red Hat, Inc. All rights reserved.
6 * This file is released under the LGPL.
9 #ifndef DM_RQ_INTERNAL_H
10 #define DM_RQ_INTERNAL_H
12 #include <linux/bio.h>
13 #include <linux/kthread.h>
20 * One of these is allocated per request.
22 struct dm_rq_target_io
{
23 struct mapped_device
*md
;
25 struct request
*orig
, *clone
;
26 struct kthread_work work
;
29 struct dm_stats_aux stats_aux
;
30 unsigned long duration_jiffies
;
35 * For request-based dm - the bio clones we allocate are embedded in these
38 * We allocate these with bio_alloc_bioset, using the front_pad parameter when
39 * the bioset is created - this means the bio has to come at the end of the
42 struct dm_rq_clone_bio_info
{
44 struct dm_rq_target_io
*tio
;
48 bool dm_use_blk_mq_default(void);
49 bool dm_use_blk_mq(struct mapped_device
*md
);
51 int dm_old_init_request_queue(struct mapped_device
*md
);
52 int dm_mq_init_request_queue(struct mapped_device
*md
, struct dm_table
*t
);
53 void dm_mq_cleanup_mapped_device(struct mapped_device
*md
);
55 void dm_start_queue(struct request_queue
*q
);
56 void dm_stop_queue(struct request_queue
*q
);
58 void dm_mq_kick_requeue_list(struct mapped_device
*md
);
60 unsigned dm_get_reserved_rq_based_ios(void);
62 ssize_t
dm_attr_rq_based_seq_io_merge_deadline_show(struct mapped_device
*md
, char *buf
);
63 ssize_t
dm_attr_rq_based_seq_io_merge_deadline_store(struct mapped_device
*md
,
64 const char *buf
, size_t count
);