diff options
Diffstat (limited to 'drivers/md/dm.h')
-rw-r--r-- | drivers/md/dm.h | 75 |
1 files changed, 1 insertions, 74 deletions
diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 2901ab943191..71ddd1e23007 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h | |||
@@ -39,88 +39,16 @@ struct dm_dev { | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | struct dm_table; | 41 | struct dm_table; |
42 | struct mapped_device; | ||
43 | 42 | ||
44 | /*----------------------------------------------------------------- | 43 | /*----------------------------------------------------------------- |
45 | * Functions for manipulating a struct mapped_device. | 44 | * Internal table functions. |
46 | * Drop the reference with dm_put when you finish with the object. | ||
47 | *---------------------------------------------------------------*/ | 45 | *---------------------------------------------------------------*/ |
48 | |||
49 | /* | ||
50 | * DM_ANY_MINOR allocates any available minor number. | ||
51 | */ | ||
52 | #define DM_ANY_MINOR (-1) | ||
53 | int dm_create(int minor, struct mapped_device **md); | ||
54 | |||
55 | void dm_set_mdptr(struct mapped_device *md, void *ptr); | ||
56 | void *dm_get_mdptr(struct mapped_device *md); | ||
57 | |||
58 | /* | ||
59 | * Reference counting for md. | ||
60 | */ | ||
61 | void dm_get(struct mapped_device *md); | ||
62 | struct mapped_device *dm_get_md(dev_t dev); | ||
63 | void dm_put(struct mapped_device *md); | ||
64 | |||
65 | /* | ||
66 | * A device can still be used while suspended, but I/O is deferred. | ||
67 | */ | ||
68 | int dm_suspend(struct mapped_device *md, int with_lockfs); | ||
69 | int dm_resume(struct mapped_device *md); | ||
70 | |||
71 | /* | ||
72 | * The device must be suspended before calling this method. | ||
73 | */ | ||
74 | int dm_swap_table(struct mapped_device *md, struct dm_table *t); | ||
75 | |||
76 | /* | ||
77 | * Drop a reference on the table when you've finished with the | ||
78 | * result. | ||
79 | */ | ||
80 | struct dm_table *dm_get_table(struct mapped_device *md); | ||
81 | |||
82 | /* | ||
83 | * Event functions. | ||
84 | */ | ||
85 | uint32_t dm_get_event_nr(struct mapped_device *md); | ||
86 | int dm_wait_event(struct mapped_device *md, int event_nr); | ||
87 | |||
88 | /* | ||
89 | * Info functions. | ||
90 | */ | ||
91 | struct gendisk *dm_disk(struct mapped_device *md); | ||
92 | int dm_suspended(struct mapped_device *md); | ||
93 | |||
94 | /* | ||
95 | * Geometry functions. | ||
96 | */ | ||
97 | int dm_get_geometry(struct mapped_device *md, struct hd_geometry *geo); | ||
98 | int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo); | ||
99 | |||
100 | /*----------------------------------------------------------------- | ||
101 | * Functions for manipulating a table. Tables are also reference | ||
102 | * counted. | ||
103 | *---------------------------------------------------------------*/ | ||
104 | int dm_table_create(struct dm_table **result, int mode, | ||
105 | unsigned num_targets, struct mapped_device *md); | ||
106 | |||
107 | void dm_table_get(struct dm_table *t); | ||
108 | void dm_table_put(struct dm_table *t); | ||
109 | |||
110 | int dm_table_add_target(struct dm_table *t, const char *type, | ||
111 | sector_t start, sector_t len, char *params); | ||
112 | int dm_table_complete(struct dm_table *t); | ||
113 | void dm_table_event_callback(struct dm_table *t, | 46 | void dm_table_event_callback(struct dm_table *t, |
114 | void (*fn)(void *), void *context); | 47 | void (*fn)(void *), void *context); |
115 | void dm_table_event(struct dm_table *t); | ||
116 | sector_t dm_table_get_size(struct dm_table *t); | ||
117 | struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index); | 48 | struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index); |
118 | struct dm_target *dm_table_find_target(struct dm_table *t, sector_t sector); | 49 | struct dm_target *dm_table_find_target(struct dm_table *t, sector_t sector); |
119 | void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q); | 50 | void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q); |
120 | unsigned int dm_table_get_num_targets(struct dm_table *t); | ||
121 | struct list_head *dm_table_get_devices(struct dm_table *t); | 51 | struct list_head *dm_table_get_devices(struct dm_table *t); |
122 | int dm_table_get_mode(struct dm_table *t); | ||
123 | struct mapped_device *dm_table_get_md(struct dm_table *t); | ||
124 | void dm_table_presuspend_targets(struct dm_table *t); | 52 | void dm_table_presuspend_targets(struct dm_table *t); |
125 | void dm_table_postsuspend_targets(struct dm_table *t); | 53 | void dm_table_postsuspend_targets(struct dm_table *t); |
126 | void dm_table_resume_targets(struct dm_table *t); | 54 | void dm_table_resume_targets(struct dm_table *t); |
@@ -138,7 +66,6 @@ void dm_put_target_type(struct target_type *t); | |||
138 | int dm_target_iterate(void (*iter_func)(struct target_type *tt, | 66 | int dm_target_iterate(void (*iter_func)(struct target_type *tt, |
139 | void *param), void *param); | 67 | void *param), void *param); |
140 | 68 | ||
141 | |||
142 | /*----------------------------------------------------------------- | 69 | /*----------------------------------------------------------------- |
143 | * Useful inlines. | 70 | * Useful inlines. |
144 | *---------------------------------------------------------------*/ | 71 | *---------------------------------------------------------------*/ |