diff options
Diffstat (limited to 'drivers/md/dm.h')
-rw-r--r-- | drivers/md/dm.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 8dcabb1caff1..a7663eba17e2 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h | |||
@@ -23,6 +23,13 @@ | |||
23 | #define DM_SUSPEND_NOFLUSH_FLAG (1 << 1) | 23 | #define DM_SUSPEND_NOFLUSH_FLAG (1 << 1) |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * Type of table and mapped_device's mempool | ||
27 | */ | ||
28 | #define DM_TYPE_NONE 0 | ||
29 | #define DM_TYPE_BIO_BASED 1 | ||
30 | #define DM_TYPE_REQUEST_BASED 2 | ||
31 | |||
32 | /* | ||
26 | * List of devices that a metadevice uses and should open/close. | 33 | * List of devices that a metadevice uses and should open/close. |
27 | */ | 34 | */ |
28 | struct dm_dev_internal { | 35 | struct dm_dev_internal { |
@@ -32,6 +39,7 @@ struct dm_dev_internal { | |||
32 | }; | 39 | }; |
33 | 40 | ||
34 | struct dm_table; | 41 | struct dm_table; |
42 | struct dm_md_mempools; | ||
35 | 43 | ||
36 | /*----------------------------------------------------------------- | 44 | /*----------------------------------------------------------------- |
37 | * Internal table functions. | 45 | * Internal table functions. |
@@ -51,12 +59,23 @@ void dm_table_postsuspend_targets(struct dm_table *t); | |||
51 | int dm_table_resume_targets(struct dm_table *t); | 59 | int dm_table_resume_targets(struct dm_table *t); |
52 | int dm_table_any_congested(struct dm_table *t, int bdi_bits); | 60 | int dm_table_any_congested(struct dm_table *t, int bdi_bits); |
53 | int dm_table_any_busy_target(struct dm_table *t); | 61 | int dm_table_any_busy_target(struct dm_table *t); |
62 | int dm_table_set_type(struct dm_table *t); | ||
63 | unsigned dm_table_get_type(struct dm_table *t); | ||
64 | bool dm_table_request_based(struct dm_table *t); | ||
65 | int dm_table_alloc_md_mempools(struct dm_table *t); | ||
66 | void dm_table_free_md_mempools(struct dm_table *t); | ||
67 | struct dm_md_mempools *dm_table_get_md_mempools(struct dm_table *t); | ||
54 | 68 | ||
55 | /* | 69 | /* |
56 | * To check the return value from dm_table_find_target(). | 70 | * To check the return value from dm_table_find_target(). |
57 | */ | 71 | */ |
58 | #define dm_target_is_valid(t) ((t)->table) | 72 | #define dm_target_is_valid(t) ((t)->table) |
59 | 73 | ||
74 | /* | ||
75 | * To check whether the target type is request-based or not (bio-based). | ||
76 | */ | ||
77 | #define dm_target_request_based(t) ((t)->type->map_rq != NULL) | ||
78 | |||
60 | /*----------------------------------------------------------------- | 79 | /*----------------------------------------------------------------- |
61 | * A registry of target types. | 80 | * A registry of target types. |
62 | *---------------------------------------------------------------*/ | 81 | *---------------------------------------------------------------*/ |
@@ -102,4 +121,10 @@ void dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, | |||
102 | int dm_kcopyd_init(void); | 121 | int dm_kcopyd_init(void); |
103 | void dm_kcopyd_exit(void); | 122 | void dm_kcopyd_exit(void); |
104 | 123 | ||
124 | /* | ||
125 | * Mempool operations | ||
126 | */ | ||
127 | struct dm_md_mempools *dm_alloc_md_mempools(unsigned type); | ||
128 | void dm_free_md_mempools(struct dm_md_mempools *pools); | ||
129 | |||
105 | #endif | 130 | #endif |