Linux: bdi doesn't always have a name
[openafs.git] / src / cf / linux-test4.m4
index 05e872b..2420b7b 100644 (file)
@@ -1217,3 +1217,17 @@ _t.ctl_name = 0;],
     AC_DEFINE([STRUCT_CTL_TABLE_HAS_CTL_NAME], 1, [define if struct ctl_table has a ctl_name member])
   fi])
 
+AC_DEFUN([LINUX_STRUCT_BDI_HAS_NAME], [
+  AC_MSG_CHECKING([if struct backing_dev_info has name])
+  AC_CACHE_VAL([ac_cv_linux_struct_bdi_has_name], [
+    AC_TRY_KBUILD(
+[#include <linux/backing-dev.h>],
+[struct backing_dev_info _bdi;
+_bdi.name = NULL;],
+      ac_cv_linux_struct_bdi_has_name=yes,
+      ac_cv_linux_struct_bdi_has_name=no)])
+  AC_MSG_RESULT($ac_cv_linux_struct_bdi_has_name)
+  if test "x$ac_cv_linux_struct_bdi_has_name" = "xyes"; then
+    AC_DEFINE([STRUCT_BDI_HAS_NAME], 1, [define if struct backing_dev_info has a name member])
+  fi])
+