From e38a09e0d9545287a9fc63618ef1a4711f25b2e3 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 1 Dec 2005 23:11:41 +0000 Subject: [PATCH] Export dm_task_update_nodes. Use names instead of numbers in messages when ioctls fail. --- WHATS_NEW | 2 ++ lib/.exported_symbols | 1 + lib/ioctl/libdm-iface.c | 29 +++++++++++++++++++---------- lib/libdevmapper.h | 6 ++++++ 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 538853b..687cab4 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,7 @@ Version 1.02.02 - ============================= + Export dm_task_update_nodes. + Use names instead of numbers in messages when ioctls fail. Version 1.02.01 - 23 Nov 2005 ============================= diff --git a/lib/.exported_symbols b/lib/.exported_symbols index 898c06e..337b96d 100644 --- a/lib/.exported_symbols +++ b/lib/.exported_symbols @@ -26,6 +26,7 @@ dm_task_suppress_identical_reload dm_task_add_target dm_task_no_open_count dm_task_skip_lockfs +dm_task_update_nodes dm_task_run dm_get_next_target dm_set_dev_dir diff --git a/lib/ioctl/libdm-iface.c b/lib/ioctl/libdm-iface.c index 3f2e592..4999509 100644 --- a/lib/ioctl/libdm-iface.c +++ b/lib/ioctl/libdm-iface.c @@ -672,11 +672,13 @@ static int _dm_task_run_v1(struct dm_task *dmt) #ifdef DM_IOCTLS else if (ioctl(_control_fd, command, dmi) < 0) { if (_log_suppress) - log_verbose("device-mapper ioctl cmd %d failed: %s", - _IOC_NR(command), strerror(errno)); + log_verbose("device-mapper: %s ioctl failed: %s", + _cmd_data_v1[dmt->type].name, + strerror(errno)); else - log_error("device-mapper ioctl cmd %d failed: %s", - _IOC_NR(command), strerror(errno)); + log_error("device-mapper: %s ioctl failed: %s", + _cmd_data_v1[dmt->type].name, + strerror(errno)); goto bad; } #else /* Userspace alternative for testing */ @@ -1454,13 +1456,15 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command, dmi->flags &= ~DM_EXISTS_FLAG; /* FIXME */ else { if (_log_suppress) - log_verbose("device-mapper ioctl " - "cmd %d failed: %s", - _IOC_NR(command), strerror(errno)); + log_verbose("device-mapper: %s ioctl " + "failed: %s", + _cmd_data_v4[dmt->type].name, + strerror(errno)); else - log_error("device-mapper ioctl " - "cmd %d failed: %s", - _IOC_NR(command), strerror(errno)); + log_error("device-mapper: %s ioctl " + "failed: %s", + _cmd_data_v4[dmt->type].name, + strerror(errno)); dm_free(dmi); return NULL; } @@ -1470,6 +1474,11 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command, return dmi; } +void dm_task_update_nodes(void) +{ + update_devs(); +} + int dm_task_run(struct dm_task *dmt) { struct dm_ioctl *dmi; diff --git a/lib/libdevmapper.h b/lib/libdevmapper.h index 1a7710c..2d13ef4 100644 --- a/lib/libdevmapper.h +++ b/lib/libdevmapper.h @@ -169,6 +169,12 @@ void *dm_get_next_target(struct dm_task *dmt, */ int dm_task_run(struct dm_task *dmt); +/* + * Call this to make or remove the device nodes associated with previously + * issued commands. + */ +void dm_task_update_nodes(void); + /* * Configure the device-mapper directory */ -- 2.43.5