1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Export dm_task_update_nodes.

Use names instead of numbers in messages when ioctls fail.
This commit is contained in:
Alasdair Kergon 2005-12-01 23:11:41 +00:00
parent 842392c23c
commit 774ed5fc39
4 changed files with 28 additions and 10 deletions

View File

@ -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
=============================

View File

@ -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

View File

@ -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;

View File

@ -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
*/