diff options
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index e75b1437b58b..51be53344214 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 | ||
248 | int 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 | |||
278 | out: | ||
279 | if (r) | ||
280 | dm_table_put(t); | ||
281 | |||
282 | return r; | ||
283 | } | ||
284 | EXPORT_SYMBOL_GPL(dm_create_error_table); | ||
285 | |||
286 | static void free_devices(struct list_head *devices) | 248 | static void free_devices(struct list_head *devices) |
287 | { | 249 | { |
288 | struct list_head *tmp, *next; | 250 | struct list_head *tmp, *next; |
@@ -954,7 +916,7 @@ void dm_table_presuspend_targets(struct dm_table *t) | |||
954 | if (!t) | 916 | if (!t) |
955 | return; | 917 | return; |
956 | 918 | ||
957 | return suspend_targets(t, 0); | 919 | suspend_targets(t, 0); |
958 | } | 920 | } |
959 | 921 | ||
960 | void dm_table_postsuspend_targets(struct dm_table *t) | 922 | void dm_table_postsuspend_targets(struct dm_table *t) |
@@ -962,7 +924,7 @@ void dm_table_postsuspend_targets(struct dm_table *t) | |||
962 | if (!t) | 924 | if (!t) |
963 | return; | 925 | return; |
964 | 926 | ||
965 | return suspend_targets(t, 1); | 927 | suspend_targets(t, 1); |
966 | } | 928 | } |
967 | 929 | ||
968 | int dm_table_resume_targets(struct dm_table *t) | 930 | int dm_table_resume_targets(struct dm_table *t) |