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>
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.
+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;
+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;
+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;
+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;
])
#
-# 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'
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
mode_t cfs_curproc_umask(void);
char *cfs_curproc_comm(void);
-
/*
* Plus, platform-specific constant
*
*
* 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);
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)
{
EXPORT_SYMBOL(cfs_curproc_cap_pack);
EXPORT_SYMBOL(cfs_curproc_cap_unpack);
EXPORT_SYMBOL(cfs_capable);
-EXPORT_SYMBOL(cfs_curproc_is_32bit);
/*
* Local variables:
#include <lclient.h>
#include <lustre_mdc.h>
#include <linux/lustre_intent.h>
+#include <linux/compat.h>
#ifndef FMODE_EXEC
#define FMODE_EXEC 0
#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
}