Whamcloud - gitweb
LU-2800 autoconf: remove LIBCFS_HAVE_IS_COMPAT_TASK test 93/5393/5
authorJames Simmons <uja.ornl@gmail.com>
Wed, 10 Jul 2013 19:51:55 +0000 (15:51 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 23 Jul 2013 05:24:27 +0000 (05:24 +0000)
is_compat_task has been defined on all arches since v2.6.29.
We can remove the test and dead code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ieffc3b32611e00f2a19aa2645205ec6e1cf57a20
Reviewed-on: http://review.whamcloud.com/5393
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-export-64bit-name-hash.patch
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/curproc.h
libcfs/libcfs/linux/linux-curproc.c
lustre/llite/llite_internal.h

index f916733..f3982bd 100644 (file)
@@ -1,19 +1,8 @@
 diff -urp linux-stage.orig/fs/ext4/dir.c linux-stage/fs/ext4/dir.c
 --- linux-stage.orig/fs/ext4/dir.c     2012-06-21 10:26:23.000000000 -0400
 +++ linux-stage/fs/ext4/dir.c  2012-06-21 10:37:39.000000000 -0400
-@@ -247,22 +247,63 @@ out:
-       return ret;
- }
+@@ -247,20 +247,52 @@ out:
 
-+static inline int is_32bit_api(void)
-+{
-+#ifdef HAVE_IS_COMPAT_TASK
-+        return is_compat_task();
-+#else
-+        return (BITS_PER_LONG == 32);
-+#endif
-+}
-+
  /*
   * These functions convert from the major/minor hash to an f_pos
 - * value.
@@ -35,7 +24,7 @@ diff -urp linux-stage.orig/fs/ext4/dir.c linux-stage/fs/ext4/dir.c
 +static inline loff_t hash2pos(struct file *filp, __u32 major, __u32 minor)
 +{
 +      if ((filp->f_mode & FMODE_32BITHASH) ||
-+          (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api()))
++          (!(filp->f_mode & FMODE_64BITHASH) && is_compat_task()))
 +              return major >> 1;
 +      else
 +              return ((__u64)(major >> 1) << 32) | (__u64)minor;
@@ -44,7 +33,7 @@ diff -urp linux-stage.orig/fs/ext4/dir.c linux-stage/fs/ext4/dir.c
 +static inline __u32 pos2maj_hash(struct file *filp, loff_t pos)
 +{
 +      if ((filp->f_mode & FMODE_32BITHASH) ||
-+          (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api()))
++          (!(filp->f_mode & FMODE_64BITHASH) && is_compat_task()))
 +              return (pos << 1) & 0xffffffff;
 +      else
 +              return ((pos >> 32) << 1) & 0xffffffff;
@@ -53,7 +42,7 @@ diff -urp linux-stage.orig/fs/ext4/dir.c linux-stage/fs/ext4/dir.c
 +static inline __u32 pos2min_hash(struct file *filp, loff_t pos)
 +{
 +      if ((filp->f_mode & FMODE_32BITHASH) ||
-+          (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api()))
++          (!(filp->f_mode & FMODE_64BITHASH) && is_compat_task()))
 +              return 0;
 +      else
 +              return pos & 0xffffffff;
@@ -68,7 +57,7 @@ diff -urp linux-stage.orig/fs/ext4/dir.c linux-stage/fs/ext4/dir.c
 +static inline loff_t ext4_get_htree_eof(struct file *filp)
 +{
 +      if ((filp->f_mode & FMODE_32BITHASH) ||
-+          (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api()))
++          (!(filp->f_mode & FMODE_64BITHASH) && is_compat_task()))
 +              return EXT4_HTREE_EOF_32BIT;
 +      else
 +              return EXT4_HTREE_EOF_64BIT;
index 654aa9d..e6d7e5d 100644 (file)
@@ -206,27 +206,6 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
-# LIBCFS_HAVE_IS_COMPAT_TASK
-#
-# Added in 2.6.17, it wasn't until 2.6.29 that all
-# Linux architectures have is_compat_task()
-#
-AC_DEFUN([LIBCFS_HAVE_IS_COMPAT_TASK],
-[AC_MSG_CHECKING([if is_compat_task() is declared])
-LB_LINUX_TRY_COMPILE([
-        #include <linux/compat.h>
-],[
-        int i __attribute__ ((unused));
-        i = is_compat_task();
-],[
-        AC_MSG_RESULT([yes])
-        AC_DEFINE(HAVE_IS_COMPAT_TASK, 1, [is_compat_task() is available])
-],[
-        AC_MSG_RESULT([no])
-])
-])
-
-#
 # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
 #
 # 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
@@ -387,8 +366,6 @@ AC_DEFUN([LIBCFS_PROG_LINUX],
 LIBCFS_CONFIG_PANIC_DUMPLOG
 
 LIBCFS_U64_LONG_LONG_LINUX
-# 2.6.18
-LIBCFS_HAVE_IS_COMPAT_TASK
 # 2.6.24
 LIBCFS_SYSCTL_UNNUMBERED
 LIBCFS_FUNC_DUMP_TRACE
index 33c2a02..2c7f413 100644 (file)
@@ -58,7 +58,6 @@ void   cfs_curproc_groups_dump(gid_t *array, int size);
 mode_t cfs_curproc_umask(void);
 char  *cfs_curproc_comm(void);
 
-
 /*
  * Plus, platform-specific constant
  *
@@ -68,9 +67,6 @@ char  *cfs_curproc_comm(void);
  *
  * cfs_kernel_cap_t
  */
-
-/* check if task is running in compat mode.*/
-int cfs_curproc_is_32bit(void);
 #endif
 uid_t  cfs_curproc_uid(void);
 gid_t  cfs_curproc_gid(void);
index 75812eb..9ebccb8 100644 (file)
@@ -199,22 +199,6 @@ int cfs_capable(cfs_cap_t cap)
         return capable(cfs_cap_unpack(cap));
 }
 
-/* Check if task is running in 32-bit API mode, for the purpose of
- * userspace binary interfaces.  On 32-bit Linux this is (unfortunately)
- * always true, even if the application is using LARGEFILE64 and 64-bit
- * APIs, because Linux provides no way for the filesystem to know if it
- * is called via 32-bit or 64-bit APIs.  Other clients may vary.  On
- * 64-bit systems, this will only be true if the binary is calling a
- * 32-bit system call. */
-int cfs_curproc_is_32bit(void)
-{
-#ifdef HAVE_IS_COMPAT_TASK
-        return is_compat_task();
-#else
-        return (BITS_PER_LONG == 32);
-#endif
-}
-
 static int cfs_access_process_vm(struct task_struct *tsk, unsigned long addr,
                                 void *buf, int len, int write)
 {
@@ -384,7 +368,6 @@ EXPORT_SYMBOL(cfs_cap_raised);
 EXPORT_SYMBOL(cfs_curproc_cap_pack);
 EXPORT_SYMBOL(cfs_curproc_cap_unpack);
 EXPORT_SYMBOL(cfs_capable);
-EXPORT_SYMBOL(cfs_curproc_is_32bit);
 
 /*
  * Local variables:
index b0a45ef..d72fe69 100644 (file)
@@ -46,6 +46,7 @@
 #include <lclient.h>
 #include <lustre_mdc.h>
 #include <linux/lustre_intent.h>
+#include <linux/compat.h>
 
 #ifndef FMODE_EXEC
 #define FMODE_EXEC 0
@@ -656,7 +657,7 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
 #if BITS_PER_LONG == 32
         return 1;
 #else
-        return unlikely(cfs_curproc_is_32bit() || (sbi->ll_flags & LL_SBI_32BIT_API));
+       return unlikely(is_compat_task() || (sbi->ll_flags & LL_SBI_32BIT_API));
 #endif
 }