blob: 1eea0da641db55838912fc541f4b93506094fc9c [file] [log] [blame]
Mike Snitzer4cc96132016-05-12 16:28:10 -04001/*
2 * Internal header file for device mapper
3 *
4 * Copyright (C) 2016 Red Hat, Inc. All rights reserved.
5 *
6 * This file is released under the LGPL.
7 */
8
9#ifndef DM_RQ_INTERNAL_H
10#define DM_RQ_INTERNAL_H
11
12#include <linux/bio.h>
13#include <linux/kthread.h>
14
15#include "dm-stats.h"
16
17struct mapped_device;
18
19/*
Mike Snitzer4cc96132016-05-12 16:28:10 -040020 * For request-based dm - the bio clones we allocate are embedded in these
21 * structs.
22 *
23 * We allocate these with bio_alloc_bioset, using the front_pad parameter when
24 * the bioset is created - this means the bio has to come at the end of the
25 * struct.
26 */
27struct dm_rq_clone_bio_info {
28 struct bio *orig;
29 struct dm_rq_target_io *tio;
30 struct bio clone;
31};
32
Mike Snitzere83068a2016-05-24 21:16:51 -040033int dm_mq_init_request_queue(struct mapped_device *md, struct dm_table *t);
Mike Snitzer4cc96132016-05-12 16:28:10 -040034void dm_mq_cleanup_mapped_device(struct mapped_device *md);
35
36void dm_start_queue(struct request_queue *q);
37void dm_stop_queue(struct request_queue *q);
38
Mike Snitzere0c10752016-09-14 10:36:39 -040039void dm_mq_kick_requeue_list(struct mapped_device *md);
40
Mike Snitzer4cc96132016-05-12 16:28:10 -040041unsigned dm_get_reserved_rq_based_ios(void);
42
43ssize_t dm_attr_rq_based_seq_io_merge_deadline_show(struct mapped_device *md, char *buf);
44ssize_t dm_attr_rq_based_seq_io_merge_deadline_store(struct mapped_device *md,
45 const char *buf, size_t count);
46
47#endif