Skip to contentSkip to conversation

LVM2 ./WHATS_NEW_DM libdm/ioctl/libdm-iface.c ...

PATCH [email protected] 3 participants 3 messages Jun 1, 2010 – Jun 2, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: prajnoha at sourceware.org 2010-06-01 16:08:14

Modified files:

	.              : WHATS_NEW_DM 
	libdm/ioctl    : libdm-iface.c 
	libdm/misc     : dm-ioctl.h 

Log message:
Add support for dm-mod module autoload.

A kernel patch is on its way for 2.6.35 adding support for dm-mod module autoload. Udev v155 and higher is able to read static node information given in modules.devname (extracted by depmod before) and will create such nodes at its start. The first access to such node will load the module automatically (directly in kernel) before the actual read/write operation is processed.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.375&r2=1.376
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/misc/dm-ioctl.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5

WHATS_NEW_DM +1 -0
@@ -1,5 +1,6 @@
 Version 1.02.49 - 
 ================================
+  Add support for dm-mod module autoload.
   Document 'clear' in dmsetup man page.
   Use expected union semun for arguments in selected semaphore operations.
 
libdm/ioctl/libdm-iface.c +81 -14

143 lines not on this page · raw message

libdm/misc/dm-ioctl.h +1 -0
@@ -13,6 +13,7 @@
 #endif
 
 #define DM_DIR "mapper"		/* Slashes not supported */
+#define DM_CONTROL_NODE "control"
 #define DM_MAX_TYPE_NAME 16
 #define DM_NAME_LEN 128
 #define DM_UUID_LEN 129
#1 lore raw

Dne 1.6.2010 18:08, prajnoha at sourceware.org napsal(a):

Quoted 14 lines

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: prajnoha at sourceware.org 2010-06-01 16:08:14

Modified files:

	.              : WHATS_NEW_DM
	libdm/ioctl    : libdm-iface.c
	libdm/misc     : dm-ioctl.h

Log message:
Add support for dm-mod module autoload.

/*

libdm/ioctl/libdm-iface.c line 310

Quoted 8 lines
libdm/ioctl/libdm-iface.c +2 -1
@@ -279,7 +304,8 @@
  	 * Assume 2.4 kernels are patched not to.
  	 * FIXME Check _dm_version and _dm_version_minor if 2.6 changes this.
  	 */
-	if (!strncmp(uts.release, "2.6.", 4))
+	if (KERNEL_VERSION(_kernel_major, _kernel_minor, _kernel_release)>=
+	    KERNEL_VERSION(2, 6, 0))
  		_dm_multiple_major_support = 0;
 

I think slightly better API would be here - to call some function like:

int is_kernel_version_higher(major, minor,relase);

Returns 1 if the kernel version is > than given argument. And keep _kernel_major local static in this function.

Zdenek

#2 lore raw
Quoted 6 lines · Zdenek Kabelac

libdm/ioctl/libdm-iface.c line 309

Quoted 4 lines
libdm/ioctl/libdm-iface.c +2 -0
+    if (KERNEL_VERSION(_kernel_major, _kernel_minor, _kernel_release)>=
+        KERNEL_VERSION(2, 6, 0))
          _dm_multiple_major_support = 0;
Quoted 6 lines

I think slightly better API would be here - to call some function like:

int is_kernel_version_higher(major, minor,relase);

Returns 1 if the kernel version is > than given argument. And keep _kernel_major local static in this function.

Yeah, exactly, I have this in my mind too :) I'll just gather all uses of uname throughout the code and see what else we need and then I'll probably try to export it, so it's central and we don't need to do these uname calls and checks here and there...

Peter