aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device-mapper.h
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-01-05 22:04:58 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-01-05 22:04:58 -0500
commit10d3bd09a3c25df114f74f7f86e1b58d070bef32 (patch)
treea44e2fe5ccc5950b87a1d31849e5f0ac24fdcc16 /include/linux/device-mapper.h
parentd460c65a6a9ec9e0d284864ec3a9a2d1b73f0e43 (diff)
dm: consolidate target deregistration error handling
Change dm_unregister_target to return void and use BUG() for error reporting. dm_unregister_target can only fail because of programming bug in the target driver. It can't fail because of user's behavior or disk errors. This patch changes unregister_target to return void and use BUG if someone tries to unregister non-registered target or unregister target that is in use. This patch removes code duplication (testing of error codes in all dm targets) and reports bugs in just one place, in dm_unregister_target. In some target drivers, these return codes were ignored, which could lead to a situation where bugs could be missed. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r--include/linux/device-mapper.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index c17fd334e574..89ff2df40240 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -157,8 +157,7 @@ struct dm_target {
157}; 157};
158 158
159int dm_register_target(struct target_type *t); 159int dm_register_target(struct target_type *t);
160int dm_unregister_target(struct target_type *t); 160void dm_unregister_target(struct target_type *t);
161
162 161
163/*----------------------------------------------------------------- 162/*-----------------------------------------------------------------
164 * Functions for creating and manipulating mapped devices. 163 * Functions for creating and manipulating mapped devices.
@@ -276,6 +275,9 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
276 *---------------------------------------------------------------*/ 275 *---------------------------------------------------------------*/
277#define DM_NAME "device-mapper" 276#define DM_NAME "device-mapper"
278 277
278#define DMCRIT(f, arg...) \
279 printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
280
279#define DMERR(f, arg...) \ 281#define DMERR(f, arg...) \
280 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 282 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
281#define DMERR_LIMIT(f, arg...) \ 283#define DMERR_LIMIT(f, arg...) \