aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-table.c38
-rw-r--r--include/linux/device-mapper.h6
2 files changed, 0 insertions, 44 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index fc261c81d73..51be5334421 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -245,44 +245,6 @@ int dm_table_create(struct dm_table **result, int mode,
245 return 0; 245 return 0;
246} 246}
247 247
248int dm_create_error_table(struct dm_table **result, struct mapped_device *md)
249{
250 struct dm_table *t;
251 sector_t dev_size = 1;
252 int r;
253
254 /*
255 * Find current size of device.
256 * Default to 1 sector if inactive.
257 */
258 t = dm_get_table(md);
259 if (t) {
260 dev_size = dm_table_get_size(t);
261 dm_table_put(t);
262 }
263
264 r = dm_table_create(&t, FMODE_READ, 1, md);
265 if (r)
266 return r;
267
268 r = dm_table_add_target(t, "error", 0, dev_size, NULL);
269 if (r)
270 goto out;
271
272 r = dm_table_complete(t);
273 if (r)
274 goto out;
275
276 *result = t;
277
278out:
279 if (r)
280 dm_table_put(t);
281
282 return r;
283}
284EXPORT_SYMBOL_GPL(dm_create_error_table);
285
286static void free_devices(struct list_head *devices) 248static void free_devices(struct list_head *devices)
287{ 249{
288 struct list_head *tmp, *next; 250 struct list_head *tmp, *next;
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index a68829e274f..ad3b787479a 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -252,12 +252,6 @@ void dm_table_event(struct dm_table *t);
252 */ 252 */
253int dm_swap_table(struct mapped_device *md, struct dm_table *t); 253int dm_swap_table(struct mapped_device *md, struct dm_table *t);
254 254
255/*
256 * Prepare a table for a device that will error all I/O.
257 * To make it active, call dm_suspend(), dm_swap_table() then dm_resume().
258 */
259int dm_create_error_table(struct dm_table **result, struct mapped_device *md);
260
261/*----------------------------------------------------------------- 255/*-----------------------------------------------------------------
262 * Macros. 256 * Macros.
263 *---------------------------------------------------------------*/ 257 *---------------------------------------------------------------*/