mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
o Allow the definition of read-only devices (ioctl interface only) (Joe)
o Add version number to ioctl structure with error on kernel/library mismatch
This commit is contained in:
parent
ba57d1f89b
commit
f1568304e0
@ -17,6 +17,7 @@ TARGETS=$(interface)/libdevmapper.so
|
||||
|
||||
include ../make.tmpl
|
||||
|
||||
|
||||
install: @interface@/libdevmapper.so
|
||||
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) $< \
|
||||
$(libdir)/libdevmapper.so.$(VERSION)
|
||||
@ -26,3 +27,18 @@ install: @interface@/libdevmapper.so
|
||||
|
||||
.PHONY: install
|
||||
|
||||
|
||||
ifeq ($(interface),ioctl)
|
||||
|
||||
ioctl/libdevmapper.o: ioctl_version
|
||||
|
||||
ioctl_version: ioctl/libdevmapper.c
|
||||
@echo Checking library version compatible with kernel version in dm-ioctl.h
|
||||
test "$(VERSION)" = \
|
||||
"$(shell $(CC) -E -dM $(INCLUDES) $(CFLAGS) \
|
||||
ioctl/libdevmapper.c | \
|
||||
awk -F '[ \t\"]+' '/DM_IOCTL_VERSION/ {print $$3}' )"
|
||||
|
||||
.PHONY: ioctl_version
|
||||
|
||||
endif
|
||||
|
@ -150,6 +150,7 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt)
|
||||
if (!(dmi = malloc(len)))
|
||||
return NULL;
|
||||
|
||||
strncpy(dmi->version, DM_IOCTL_VERSION, sizeof(dmi->version));
|
||||
dmi->data_size = len;
|
||||
strncpy(dmi->name, dmt->dev_name, sizeof(dmi->name));
|
||||
dmi->suspend = (dmt->type == DM_DEVICE_SUSPEND) ? 1 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user