fi
])
+# LC_MODULE_LOADING
+# after 2.6.28 CONFIG_KMOD is removed, and only CONFIG_MODULES remains
+# so we test if request_module is implemented or not
+AC_DEFUN([LC_MODULE_LOADING],
+[AC_MSG_CHECKING([if kernel module loading is possible])
+LB_LINUX_TRY_MAKE([
+ #include <linux/kmod.h>
+],[
+ int myretval=ENOSYS ;
+ return myretval;
+],[
+ $makerule LUSTRE_KERNEL_TEST=conftest.i
+],[
+ grep request_module build/conftest.i | grep -v `grep "int myretval=" build/conftest.i | cut -d= -f2 | cut -d" " -f1` >/dev/null
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MODULE_LOADING_SUPPORT, 1,
+ [kernel module loading is possible])
+],[
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([])
+ AC_MSG_WARN([Kernel module loading support is highly recommended.])
+ AC_MSG_WARN([])
+])
+])
+
+# LC_MODULE_LOADING
+# after 2.6.28 CONFIG_KMOD is removed, and only CONFIG_MODULES remains
+# so we test if request_module is implemented or not
+AC_DEFUN([LC_MODULE_LOADING],
+[AC_MSG_CHECKING([if kernel module loading is possible])
+LB_LINUX_TRY_MAKE([
+ #include <linux/kmod.h>
+],[
+ int myretval=ENOSYS ;
+ return myretval;
+],[
+ $makerule LUSTRE_KERNEL_TEST=conftest.i
+],[
+ grep request_module build/conftest.i | grep -v `grep "int myretval=" build/conftest.i | cut -d= -f2 | cut -d" " -f1` >/dev/null
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MODULE_LOADING_SUPPORT, 1,
+ [kernel module loading is possible])
+],[
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([])
+ AC_MSG_WARN([Kernel module loading support is highly recommended.])
+ AC_MSG_WARN([])
+])
+])
#
# LB_PROG_LINUX
fi
])
-LB_LINUX_CONFIG([KMOD],[],[
- AC_MSG_WARN([])
- AC_MSG_WARN([Kernel module loading support is highly recommended.])
- AC_MSG_WARN([])
-])
+# 2.6.28
+LC_MODULE_LOADING
#LB_LINUX_CONFIG_BIG_STACK
CERROR("Can't load LND %s, module %s, rc=%d\n",
libcfs_lnd2str(lnd_type),
libcfs_lnd2modname(lnd_type), rc);
-#ifndef CONFIG_KMOD
+#ifndef HAVE_MODULE_LOADING_SUPPORT
LCONSOLE_ERROR_MSG(0x104, "Your kernel must be "
- "compiled with CONFIG_KMOD set for "
- "automatic module loading.");
+ "compiled with kernel module "
+ "loading support.");
#endif
goto failed;
}
])
])
+# 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
+AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
+[AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+],[
+ blk_queue_logical_block_size(NULL, 0);
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1,
+ [blk_queue_logical_block_size is defined])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
#
# LC_PROG_LINUX
#
LC_D_OBTAIN_ALIAS
LC_BLKDEV_PUT_2ARGS
LC_DENTRY_OPEN_4ARGS
+
+ # 2.6.31
+ LC_BLK_QUEUE_LOG_BLK_SIZE
])
#
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
#endif /* !atomic_inc_not_zero */
+#ifndef HAVE_BLK_QUEUE_LOG_BLK_SIZE /* added in 2.6.31 */
+#define blk_queue_logical_block_size(q, sz) blk_queue_hardsect_size(q, sz)
+#endif
+
#endif /* __KERNEL__ */
#endif /* _COMPAT25_H */
* using unsigned type cast instead of unsigned short cast in order
* to avoid truncate of CFS_PAGE_SIZE (= 2**16) value
*/
- blk_queue_hardsect_size(lo->lo_queue,
- min_t(unsigned, CFS_PAGE_SIZE, 16384));
+ blk_queue_logical_block_size(lo->lo_queue,
+ min_t(unsigned, CFS_PAGE_SIZE, 16384));
blk_queue_max_sectors(lo->lo_queue,
LLOOP_MAX_SEGMENTS << (CFS_PAGE_SHIFT - 9));
blk_queue_max_phys_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS);
{
struct obd_type *type = class_search_type(name);
-#ifdef CONFIG_KMOD
+#ifdef HAVE_MODULE_LOADING_SUPPORT
if (!type) {
const char *modname = name;
if (strcmp(modname, LUSTRE_MDT_NAME) == 0)