1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

o Knock the version check out of the makefile, Alasdair will no doubt put it back :)

o  Change to new ioctl names.
This commit is contained in:
Joe Thornber 2002-06-17 15:50:17 +00:00
parent aefa3c6d82
commit 2f92106107
2 changed files with 26 additions and 23 deletions

@ -35,19 +35,18 @@ install_ioctl: ioctl/libdevmapper.so
$(LN_S) -f libdevmapper.so.$(LIB_VERSION).$(IOCTL_VERSION) \
$(libdir)/libdevmapper.so.$(LIB_VERSION)
ioctl/libdevmapper.o: ioctl_version
#ioctl/libdevmapper.o: ioctl_version
ioctl_version: ioctl/libdevmapper.c
@echo Checking library version compatible with kernel version in dm-ioctl.h
test "$(IOCTL_VERSION)" = \
"$(shell $(CC) -E -dM $(INCLUDES) $(CFLAGS) \
ioctl/libdevmapper.c | \
awk -F '[ \t\"]+' '/DM_IOCTL_VERSION/ {print $$3}' )"
#ioctl_version: ioctl/libdevmapper.c
# @echo Checking library version compatible with kernel version in dm-ioctl.h
# test "$(IOCTL_VERSION)" = \
# "$(shell $(CC) -E -dM $(INCLUDES) $(CFLAGS) \
# ioctl/libdevmapper.c | \
# awk -F '[ \t\"]+' '/DM_IOCTL_VERSION/ {print $$3}' )"
distclean_lib:
$(RM) libdm-common.h
distclean: distclean_lib
.PHONY: ioctl_version distclean_lib distclean
.PHONY: distclean_lib distclean

@ -76,11 +76,13 @@ void dm_task_destroy(struct dm_task *dmt)
int dm_task_get_driver_version(struct dm_task *dmt, char *version, size_t size)
{
unsigned int *v;
if (!dmt->dmi)
return 0;
strncpy(version, dmt->dmi->version, size);
v = dmt->dmi->version;
snprintf(version, size, "%u.%u.%u", v[0], v[1], v[2]);
return 1;
}
@ -281,7 +283,9 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt)
memset(dmi, 0, len);
strncpy(dmi->version, DM_IOCTL_VERSION, sizeof(dmi->version));
dmi->version[0] = DM_IOCTL_MAJOR;
dmi->version[1] = DM_IOCTL_MINOR;
dmi->version[2] = DM_IOCTL_PATCH;
dmi->data_size = len;
dmi->data_start = sizeof(struct dm_ioctl);
@ -341,15 +345,15 @@ int dm_task_run(struct dm_task *dmt)
switch (dmt->type) {
case DM_DEVICE_CREATE:
command = DM_CREATE;
command = DM_DEV_CREATE;
break;
case DM_DEVICE_RELOAD:
command = DM_RELOAD;
command = DM_DEV_RELOAD;
break;
case DM_DEVICE_REMOVE:
command = DM_REMOVE;
command = DM_DEV_REMOVE;
break;
case DM_DEVICE_REMOVE_ALL:
@ -357,23 +361,23 @@ int dm_task_run(struct dm_task *dmt)
break;
case DM_DEVICE_SUSPEND:
command = DM_SUSPEND;
command = DM_DEV_SUSPEND;
break;
case DM_DEVICE_RESUME:
command = DM_SUSPEND;
command = DM_DEV_SUSPEND;
break;
case DM_DEVICE_INFO:
command = DM_INFO;
command = DM_DEV_STATUS;
break;
case DM_DEVICE_DEPS:
command = DM_DEPS;
command = DM_DEV_DEPS;
break;
case DM_DEVICE_RENAME:
command = DM_RENAME;
command = DM_DEV_RENAME;
break;
case DM_DEVICE_VERSION:
@ -381,16 +385,16 @@ int dm_task_run(struct dm_task *dmt)
break;
case DM_DEVICE_STATUS:
command = DM_GET_STATUS;
command = DM_TARGET_STATUS;
break;
case DM_DEVICE_TABLE:
dmi->flags |= DM_STATUS_TABLE_FLAG;
command = DM_GET_STATUS;
command = DM_TARGET_STATUS;
break;
case DM_DEVICE_WAITEVENT:
command = DM_WAIT_EVENT;
command = DM_TARGET_WAIT;
break;
default: