Whamcloud - gitweb
b=21500 2.6.31-fc12 patchless client support
authorRahul Deshmukh <Rahul.Deshmukh@Sun.COM>
Thu, 4 Mar 2010 01:03:31 +0000 (17:03 -0800)
committerRobert Read <rread@sun.com>
Thu, 4 Mar 2010 01:03:31 +0000 (17:03 -0800)
i=adilger
i=brian
i=sheng.yang

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/cl_lock.c
lustre/obdclass/genops.c

index 186a175..17ec83e 100644 (file)
@@ -512,6 +512,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
@@ -536,11 +587,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 4d3fd1a..5c335b4 100644 (file)
@@ -1003,10 +1003,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 fdc02db..2f2ba80 100644 (file)
@@ -1815,6 +1815,39 @@ AC_DEFUN([LC_LINUX_FIEMAP_H],
 [])
 ])
 
+# LC_LOCK_MAP_ACQUIRE
+# after 2.6.27 lock_map_acquire replaces lock_acquire
+AC_DEFUN([LC_LOCK_MAP_ACQUIRE],
+[AC_MSG_CHECKING([if lock_map_acquire is defined])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/lockdep.h>
+],[
+        lock_map_acquire(NULL);
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_LOCK_MAP_ACQUIRE, 1,
+                [lock_map_acquire is defined])
+],[
+        AC_MSG_RESULT(no)
+])
+])
+
+# 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
 #
@@ -1955,6 +1988,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_QUOTA_ON_5ARGS
          LC_QUOTA_OFF_3ARGS
          LC_VFS_DQ_OFF
+         LC_LOCK_MAP_ACQUIRE
 
          # 2.6.27.15-2 sles11
          LC_BI_HW_SEGMENTS
@@ -1962,6 +1996,9 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_VFS_SYMLINK_5ARGS
          LC_SB_ANY_QUOTA_ACTIVE
          LC_SB_HAS_QUOTA_ACTIVE
+
+         # 2.6.31
+         LC_BLK_QUEUE_LOG_BLK_SIZE
 ])
 
 #
index fe7a720..4d70eb7 100644 (file)
@@ -795,5 +795,9 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount)
                 return -ENOSYS;
 }
 
+#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 4f56ef9..7dc924a 100644 (file)
@@ -541,7 +541,7 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
         lo->lo_queue->unplug_fn = loop_unplug;
 
         /* queue parameters */
-        blk_queue_hardsect_size(lo->lo_queue, CFS_PAGE_SIZE);
+        blk_queue_logical_block_size(lo->lo_queue, CFS_PAGE_SIZE);
         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 3e8b004..575a54d 100644 (file)
@@ -158,9 +158,13 @@ static void cl_lock_lockdep_acquire(const struct lu_env *env,
                                     struct cl_lock *lock, __u32 enqflags)
 {
         cl_lock_counters(env, lock)->ctc_nr_locks_acquired++;
+#ifdef HAVE_LOCK_MAP_ACQUIRE
+        lock_map_acquire(&lock->dep_map);
+#else  /* HAVE_LOCK_MAP_ACQUIRE */
         lock_acquire(&lock->dep_map, !!(enqflags & CEF_ASYNC),
                      /* try: */ 0, lock->cll_descr.cld_mode <= CLM_READ,
                      /* check: */ 2, RETIP);
+#endif /* HAVE_LOCK_MAP_ACQUIRE */
 }
 
 static void cl_lock_lockdep_release(const struct lu_env *env,
index 853dd86..a8c6c34 100644 (file)
@@ -117,7 +117,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 (!cfs_request_module("%s", modname)) {