From: yangsheng Date: Tue, 25 Oct 2011 02:29:26 +0000 (+0800) Subject: LU-766 Fix sops->statfs() autoconf check X-Git-Tag: 2.1.53~7 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=befe9c673b23ef4f776615d9a6de12ad8b65bbcf LU-766 Fix sops->statfs() autoconf check Building with RHEL6.2 beta (kernel-2.6.32-204) exposed that the HAVE_STATFS_DENTRY_PARAM autoconf check was incorrect. The test was setup to check the first argument of vfs_statfs() function. However, the conditional code itself doesn't use the vfs_statfs() function it registers a function with the sops->statfs() callback. Historically, this always worked because both of these prototypes were changed in a single upstream kernel commit (726c3342). However, as of RHEL6.2 the vfs_statfs() function changed again and the sops->statfs() callback stayed the same. The vfs_statfs() function now takes a path structure as the first parameter. This was fixed by simply updating the autoconf test to check the prototype of the function were going to actually use. Change-Id: I0cf36e758fd9c85609c47c13dbdf249321664b26 Signed-off-by: Yang Sheng Signed-off-by: Brian Behlendorf Reviewed-on: http://review.whamcloud.com/1527 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Niu Yawei Reviewed-by: Andreas Dilger --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index de554d4..69371f7 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -965,22 +965,27 @@ LB_LINUX_TRY_COMPILE([ # # LC_STATFS_DENTRY_PARAM -# starting from 2.6.18 linux kernel uses dentry instead of -# super_block for first vfs_statfs argument +# starting from 2.6.18 linux kernel uses dentry instead of super_block +# for the first parameter of the super_operations->statfs() callback. +# # AC_DEFUN([LC_STATFS_DENTRY_PARAM], -[AC_MSG_CHECKING([first vfs_statfs parameter is dentry]) +[AC_MSG_CHECKING([if super_ops.statfs() first parameter is dentry]) +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-Werror" LB_LINUX_TRY_COMPILE([ #include ],[ - int vfs_statfs(struct dentry *, struct kstatfs *); + struct super_operations *sop = NULL; + sop->statfs((struct dentry *)0, (struct kstatfs*)0); ],[ AC_DEFINE(HAVE_STATFS_DENTRY_PARAM, 1, - [first parameter of vfs_statfs is dentry]) + [super_ops.statfs() first parameter is dentry]) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) +EXTRA_KCFLAGS="$tmp_flags" ]) #