Whamcloud - gitweb
b=21500 2.6.31-fc12 patchless client support.
authoryangsheng <Sheng.Yang@Sun.COM>
Wed, 24 Mar 2010 16:24:48 +0000 (00:24 +0800)
committerJohann Lombardi <johann@sun.com>
Thu, 25 Mar 2010 13:50:34 +0000 (14:50 +0100)
i=brian
i=rahul
i=adilger

build/autoconf/lustre-build-linux.m4
lnet/lnet/api-ni.c
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/llite/lloop.c
lustre/obdclass/genops.c

index 32991cd..8e1025f 100644 (file)
@@ -539,6 +539,57 @@ else
 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
@@ -563,11 +614,8 @@ if test "x$ARCH_UM" = "x" ; then
 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
 
index 94031c3..7405622 100644 (file)
@@ -1079,10 +1079,10 @@ lnet_startup_lndnis (void)
                                 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;
                         }
index 120942a..ab2d031 100644 (file)
@@ -1719,6 +1719,22 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+# 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
 #
@@ -1871,6 +1887,9 @@ AC_DEFUN([LC_PROG_LINUX],
           LC_D_OBTAIN_ALIAS
           LC_BLKDEV_PUT_2ARGS
           LC_DENTRY_OPEN_4ARGS
+
+          # 2.6.31
+          LC_BLK_QUEUE_LOG_BLK_SIZE
 ])
 
 #
index 78ca298..468ce53 100644 (file)
@@ -654,5 +654,9 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount)
 #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 */
index 4a0e35e..736ed41 100644 (file)
@@ -503,8 +503,8 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
          * 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);
index 0bf5fd5..eab7402 100644 (file)
@@ -116,7 +116,7 @@ struct obd_type *class_get_type(const char *name)
 {
         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)