[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] LVM2 ./WHATS_NEW_DM libdm/ioctl/libdm-iface.c ...



Dne 1.6.2010 18:08, prajnoha sourceware org napsal(a):
CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha 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.

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]