From 9f7b6980070f4955cf4fb8db7821c28c2b16ce14 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 6 Mar 2002 19:42:23 +0000 Subject: [PATCH] Kernel functionality that returns device dependencies (ejt). --- libdm/ioctl/libdevmapper.c | 2 +- libdm/libdevmapper.h | 3 ++- tools/dmsetup.c | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libdm/ioctl/libdevmapper.c b/libdm/ioctl/libdevmapper.c index 12f511fc5..73525450c 100644 --- a/libdm/ioctl/libdevmapper.c +++ b/libdm/ioctl/libdevmapper.c @@ -291,7 +291,7 @@ int dm_task_run(struct dm_task *dmt) break; case DM_DEVICE_DEPS: - command = DM_DEP; + command = DM_DEPS; break; case DM_DEVICE_RENAME: diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index 3d3cd8e12..33beb4660 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -9,6 +9,7 @@ #include #include +#include /* * Since it is quite laborious to build the ioctl @@ -69,7 +70,7 @@ struct dm_info { struct dm_deps { unsigned int count; - dev_t device[0]; + __kernel_dev_t device[0]; }; int dm_get_library_version(char *version, size_t size); diff --git a/tools/dmsetup.c b/tools/dmsetup.c index a2da75179..b31b26764 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -283,6 +283,9 @@ static int _deps(int argc, char **argv) if (!dm_task_run(dmt)) goto out; + if (!dm_task_get_info(dmt, &info)) + goto out; + if (!(deps = dm_task_get_deps(dmt))) goto out; -- 2.43.5