Whamcloud - gitweb
LU-2675 cleanup: remove User Mode Linux specific code
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 31 Jan 2013 19:55:54 +0000 (13:55 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 10 Feb 2013 03:42:35 +0000 (22:42 -0500)
The UML specific code has been uncompilable for some time and no one
has complained so it goes.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ie91c6e4484fee64fec4a2e38effd8a1021e8cddb
Reviewed-on: http://review.whamcloud.com/5175
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
14 files changed:
autoMakefile.am
build/Rules.in
build/autoconf/lustre-build-linux.m4
ldiskfs/configure.ac
libcfs/include/libcfs/libcfs_debug.h
libcfs/include/libcfs/linux/portals_compat25.h
libcfs/libcfs/linux/linux-debug.c
libcfs/libcfs/linux/linux-prim.c
lustre/include/obd_support.h
lustre/obdclass/lustre_handles.c
lustre/tests/replay-ost-single.sh
lustre/tests/sanity-gss.sh
lustre/tests/sanity.sh
lustre/tests/sanityn.sh

index 77d9889..36d1610 100644 (file)
@@ -78,7 +78,7 @@ if LINUX
 all-am: modules
 
 modules: $(DEP) all-sources
-       $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ)                \
+       $(MAKE) CC="$(CC)" -C $(LINUX_OBJ)                           \
        -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
         LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -I$$(srctree)/arch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include $(CONFIG_INCLUDE)' \
        $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
index 9f353d3..1ac462e 100644 (file)
@@ -35,7 +35,7 @@ else
 include @LINUX_CONFIG@
 
 EXTRA_CFLAGS := $(EXTRA_PRE_CFLAGS)
-EXTRA_CFLAGS += @EXTRA_KCFLAGS@ @UML_CFLAGS@ @CFLAGS@
+EXTRA_CFLAGS += @EXTRA_KCFLAGS@ @CFLAGS@
 EXTRA_CFLAGS += $(EXTRA_POST_CFLAGS)
 
 obj-m := $(patsubst %,%.o,$(MODULES))
index 0ea5b1a..db58704 100644 (file)
@@ -255,7 +255,6 @@ if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
 fi
 
 # this is needed before we can build modules
-LB_LINUX_UML
 LB_LINUX_VERSION
 
 # --- check that we can build modules at all
@@ -324,32 +323,6 @@ fi
 AC_SUBST(MODPOST_ARGS)
 ])
 
-#
-# LB_LINUX_UML
-#
-# check for a uml kernel
-#
-AC_DEFUN([LB_LINUX_UML],
-[ARCH_UM=
-UML_CFLAGS=
-
-AC_MSG_CHECKING([if you are running user mode linux for $target_cpu])
-if test -e $LINUX/include/asm-um ; then
-       if test  X`ls -id $LINUX/include/asm/ 2>/dev/null | awk '{print [$]1}'` = X`ls -id $LINUX/include/asm-um 2>/dev/null | awk '{print [$]1}'` ; then
-               ARCH_UM='ARCH=um'
-               # see notes in Rules.in
-               UML_CFLAGS='-O0'
-               AC_MSG_RESULT(yes)
-       else
-               AC_MSG_RESULT([no])
-       fi
-else
-       AC_MSG_RESULT([no (asm-um missing)])
-fi
-AC_SUBST(ARCH_UM)
-AC_SUBST(UML_CFLAGS)
-])
-
 # these are like AC_TRY_COMPILE, but try to build modules against the
 # kernel, inside the build directory
 
@@ -377,7 +350,7 @@ $2
 AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
 rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
-AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/arch/`echo $target_cpu|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
+AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/arch/`echo $target_cpu|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
        [$4],
        [_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$5],[$5])dnl])
@@ -393,7 +366,7 @@ AC_DEFUN([LB_LINUX_ARCH],
          [AC_MSG_CHECKING([Linux kernel architecture])
           AS_IF([rm -f $PWD/build/arch
                  make -s --no-print-directory echoarch -f $PWD/build/Makefile \
-                     LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX $ARCH_UM \
+                     LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX \
                      ARCHFILE=$PWD/build/arch && LINUX_ARCH=`cat $PWD/build/arch`],
                 [AC_MSG_RESULT([$LINUX_ARCH])],
                 [AC_MSG_ERROR([Could not determine the kernel architecture.])])
@@ -579,9 +552,7 @@ LB_LINUX_CONFIG([MODULES],[],[
 LB_LINUX_CONFIG([MODVERSIONS])
 
 LB_LINUX_CONFIG([KALLSYMS],[],[
-if test "x$ARCH_UM" = "x" ; then
        AC_MSG_ERROR([Lustre requires that CONFIG_KALLSYMS is enabled in your kernel.])
-fi
 ])
 
 # 2.6.28
index 1d838df..f3d64eb 100644 (file)
@@ -46,9 +46,7 @@ if test x$enable_modules = xyes ; then
        ])
        LB_LINUX_CONFIG([MODVERSIONS])
        LB_LINUX_CONFIG([KALLSYMS],[],[
-               if test "x$ARCH_UM" = "x" ; then
-                       AC_MSG_ERROR([ldiskfs requires that CONFIG_KALLSYMS is enabled in your kernel.])
-               fi
+               AC_MSG_ERROR([ldiskfs requires that CONFIG_KALLSYMS is enabled in your kernel.])
        ])
        LB_LINUX_MODPOST
 fi
index 0d1b713..0e8aaa1 100644 (file)
@@ -383,9 +383,7 @@ extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
 extern int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob,
                                    const char *knl_buffer, char *append);
 
-#if defined(__arch_um__)
-#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/r/tmp/lustre-log"
-#elif defined(__WINNT__)
+#if defined(__WINNT__)
 #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "\\SystemRoot\\temp\\lustre-log"
 #else
 #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
index 85711f5..6fa8a29 100644 (file)
@@ -63,8 +63,6 @@
 #define cfs_wait_event_interruptible_exclusive(wq, condition, ret)     \
         ret = wait_event_interruptible_exclusive(wq, condition)
 
-#define UML_PID(tsk) ((tsk)->pid)
-
 #define THREAD_NAME(comm, len, fmt, a...)                              \
         snprintf(comm, len, fmt, ## a)
 
index cc4f3a2..e046773 100644 (file)
@@ -160,18 +160,6 @@ void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msgdata)
         libcfs_run_upcall (argv);
 }
 
-#ifdef __arch_um__
-void lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
-{
-        libcfs_catastrophe = 1;
-        libcfs_debug_msg(msgdata, "LBUG - trying to dump log to %s\n",
-                         libcfs_debug_file_path);
-        libcfs_debug_dumplog();
-        libcfs_run_lbug_upcall(msgdata);
-        asm("int $3");
-        panic("LBUG");
-}
-#else
 /* coverity[+kill] */
 void lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
 {
@@ -193,7 +181,6 @@ void lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
         while (1)
                 schedule();
 }
-#endif /* __arch_um__ */
 
 #ifdef __KERNEL__
 
@@ -254,12 +241,7 @@ static DUMP_TRACE_CONST struct stacktrace_ops print_trace_ops = {
 
 void libcfs_debug_dumpstack(struct task_struct *tsk)
 {
-#if defined(__arch_um__)
-        if (tsk != NULL)
-                CWARN("stack dump for pid %d (%d) requested; wake up gdb.\n",
-                      tsk->pid, UML_PID(tsk));
-        //asm("int $3");
-#elif defined(HAVE_DUMP_TRACE)
+#if defined(HAVE_DUMP_TRACE)
         /* dump_stack() */
         /* show_trace() */
         if (tsk == NULL)
index d8a9117..afb4465 100644 (file)
@@ -254,8 +254,6 @@ void cfs_enter_debugger(void)
 {
 #if defined(CONFIG_KGDB)
 //        BREAKPOINT();
-#elif defined(__arch_um__)
-        asm("int $3");
 #else
         /* nothing */
 #endif
index 7858647..e8c8b09 100644 (file)
@@ -649,15 +649,6 @@ do {                                                                             \
 #define OBD_CPT_ALLOC_PTR(ptr, cptab, cpt)                                   \
        OBD_CPT_ALLOC(ptr, cptab, cpt, sizeof *(ptr))
 
-#ifdef __arch_um__
-
-# define OBD_VMALLOC(ptr, size)                                                      \
-        OBD_ALLOC(ptr, size)
-# define OBD_CPT_VMALLOC(ptr, cptab, cpt, size)                                      \
-        OBD_CPT_ALLOC(ptr, cptab, cpt, size)
-
-#else /* !__arch_um__ */
-
 # define __OBD_VMALLOC_VEROBSE(ptr, cptab, cpt, size)                        \
 do {                                                                         \
        (ptr) = cptab == NULL ?                                               \
@@ -679,8 +670,6 @@ do {                                                                              \
 # define OBD_CPT_VMALLOC(ptr, cptab, cpt, size)                                      \
         __OBD_VMALLOC_VEROBSE(ptr, cptab, cpt, size)
 
-#endif
-
 #ifdef __KERNEL__
 
 /* Allocations above this size are considered too big and could not be done
@@ -767,16 +756,12 @@ do {                                                                            \
 #define OBD_FREE_RCU(ptr, size, handle) (OBD_FREE(ptr, size))
 #endif /* ifdef __KERNEL__ */
 
-#ifdef __arch_um__
-# define OBD_VFREE(ptr, size) OBD_FREE(ptr, size)
-#else
-# define OBD_VFREE(ptr, size)                                                 \
-do {                                                                          \
-        OBD_FREE_PRE(ptr, size, "vfreed");                                    \
-        cfs_free_large(ptr);                                                  \
-        POISON_PTR(ptr);                                                      \
-} while(0)
-#endif
+#define OBD_VFREE(ptr, size)                           \
+       do {                                            \
+               OBD_FREE_PRE(ptr, size, "vfreed");      \
+               cfs_free_large(ptr);                    \
+               POISON_PTR(ptr);                        \
+       } while (0)
 
 /* we memset() the slab object to 0 when allocation succeeds, so DO NOT
  * HAVE A CTOR THAT DOES ANYTHING.  its work will be cleared here.  we'd
index 20d8b83..4d13acc 100644 (file)
@@ -66,16 +66,7 @@ static struct handle_bucket {
        cfs_list_t      head;
 } *handle_hash;
 
-#ifdef __arch_um__
-/* For unknown reason, UML uses kmalloc rather than vmalloc to allocate
- * memory(OBD_VMALLOC). Therefore, we have to redefine the
- * HANDLE_HASH_SIZE to make the hash heads don't exceed 128K.
- */
-#define HANDLE_HASH_SIZE 4096
-#else
 #define HANDLE_HASH_SIZE (1 << 16)
-#endif /* ifdef __arch_um__ */
-
 #define HANDLE_HASH_MASK (HANDLE_HASH_SIZE - 1)
 
 /*
index a85031a..b7115a6 100755 (executable)
@@ -19,10 +19,6 @@ init_logging
 
 require_dsh_ost || exit 0
 
-# Tests that fail on uml
-CPU=`awk '/model/ {print $4}' /proc/cpuinfo`
-[ "$CPU" = "UML" ] && EXCEPT="$EXCEPT 6"
-
 # Skip these tests
 # BUG NUMBER: 
 ALWAYS_EXCEPT="$REPLAY_OST_SINGLE_EXCEPT"
index b9e8e46..550a1ff 100644 (file)
@@ -12,10 +12,6 @@ ONLY=${ONLY:-"$*"}
 ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"$SANITY_GSS_EXCEPT"}
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-# Tests that fail on uml
-CPU=`awk '/model/ {print $4}' /proc/cpuinfo`
-[ "$CPU" = "UML" ] && EXCEPT="$EXCEPT"
-
 SRCDIR=`dirname $0`
 export PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$SRCDIR/../utils/gss:$PATH:/sbin
 export NAME=${NAME:-local}
index fe49708..0095711 100644 (file)
@@ -17,11 +17,6 @@ ALWAYS_EXCEPT="                27u   42a  42b  42c  42d  45   51d   68b   $SANIT
 ALWAYS_EXCEPT="                 76     $ALWAYS_EXCEPT"
 
 
-# Tests that fail on uml
-CPU=`awk '/model/ {print $4}' /proc/cpuinfo`
-#                                    buffer i/o errs             sock spc runas
-[ "$CPU" = "UML" ] && EXCEPT="$EXCEPT 27m 27n 27o 27p 27q 27r 31d 54a  64b 99a 99b 99c 99d 99e 99f 101a"
-
 SRCDIR=$(cd $(dirname $0); echo $PWD)
 export PATH=$PATH:/sbin
 
@@ -5513,7 +5508,6 @@ test_101a() {
        local s
        local discard
        local nreads=10000
-       [ "$CPU" = "UML" ] && nreads=1000
        local cache_limit=32
 
        $LCTL set_param -n osc.*-osc*.rpc_stats 0
index 50565a7..f1c326f 100644 (file)
@@ -11,9 +11,6 @@ ALWAYS_EXCEPT="                14b  18c     19         22    28   29          35
 grep -q 'Enterprise Server 10' /etc/SuSE-release 2> /dev/null &&
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT 11    14" || true
 
-# Tests that fail on uml
-[ "$UML" = "true" ] && EXCEPT="$EXCEPT 7"
-
 # It will be ported soon.
 EXCEPT="$EXCEPT 22"