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 <ys@whamcloud.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-on: http://review.whamcloud.com/1527
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
#
# 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 <linux/fs.h>
],[
- 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"
])
#