[lvm-devel] [PATCH] Workaround for kernel 3.0 & uname

Alasdair G Kergon agk at redhat.com
Thu Jun 9 14:32:06 UTC 2011


On Sat, Jun 04, 2011 at 09:03:35PM +0200, Milan Broz wrote:
> +		_kernel_release = 0;

Let's move those (noops) out of the way to the initialisation,
  static int _kernel_major = 0;

Then the if test can be simplified:
	/* Kernels with a major number of 2 always had 3 parts. */
	if (parts < 1 || (_kernel_major < 3 && parts < 3))

>  		log_error("Could not determine kernel version used.");
>  		return 0;
>  	}

Alasdair




More information about the lvm-devel mailing list