Whamcloud - gitweb
LU-4961 lustre: remove liblustre.h and obd.h from userspace 94/10194/4
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 1 May 2014 21:26:41 +0000 (16:26 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 8 May 2014 22:35:12 +0000 (22:35 +0000)
In lustre/tests/ and lustre/utils/ replace inclusion of liblustre.h
and obd.h with libcfs/libcfs.h and lustre/lustre_idl.h. In obd.h raise
a preprocessod error if being compiled in userspace. Replace the
contents of liblustre.h with a single preprocessor error moving what
few functions were still in use to their files of use.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I778b3207ce561d8adef6f7ecbbc899654c23b9d6
Reviewed-on: http://review.whamcloud.com/10194
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Robert Read <robert.read@intel.com>
36 files changed:
libcfs/include/libcfs/user-prim.h
libcfs/libcfs/fail.c
lustre/include/liblustre.h
lustre/include/lustre/lustre_lfsck_user.h
lustre/include/lustre_update.h
lustre/include/obd.h
lustre/ldlm/interval_tree.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/wiretest.c
lustre/tests/check_fhandle_syscalls.c
lustre/tests/ll_dirstripe_verify.c
lustre/tests/lp_utils.c
lustre/tests/mpi/mdsrate.c
lustre/tests/rwv.c
lustre/tests/statmany.c
lustre/tests/statone.c
lustre/tests/test_brw.c
lustre/utils/l_getidentity.c
lustre/utils/lctl.c
lustre/utils/lfs.c
lustre/utils/libiam.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_hsm.c
lustre/utils/liblustreapi_json.c
lustre/utils/liblustreapi_nodemap.c
lustre/utils/ll_decode_filter_fid.c
lustre/utils/ll_recover_lost_found_objs.c
lustre/utils/llog_reader.c
lustre/utils/lustre_cfg.c
lustre/utils/mount_lustre.c
lustre/utils/obd.c
lustre/utils/obdctl.h
lustre/utils/req-layout.c
lustre/utils/wirecheck.c
lustre/utils/wirehdr.c
lustre/utils/wiretest.c

index ec121d6..ceef624 100644 (file)
@@ -122,6 +122,9 @@ void cond_resched(void);
 
 static inline void schedule(void)                      {}
 static inline void schedule_timeout(int64_t t) {}
 
 static inline void schedule(void)                      {}
 static inline void schedule_timeout(int64_t t) {}
+static inline void set_current_state(int state)
+{
+}
 
 /*
  * Lproc
 
 /*
  * Lproc
index 3d1d3a0..4315bb3 100644 (file)
  * Lustre is a trademark of Oracle Corporation, Inc.
  */
 
  * Lustre is a trademark of Oracle Corporation, Inc.
  */
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#else
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs.h>
-#endif
 
 unsigned long cfs_fail_loc = 0;
 unsigned int cfs_fail_val = 0;
 
 unsigned long cfs_fail_loc = 0;
 unsigned int cfs_fail_val = 0;
index 815b96b..2fb7cce 100644 (file)
  * User-space Lustre headers.
  */
 
  * User-space Lustre headers.
  */
 
-#ifndef LIBLUSTRE_H__
-#define LIBLUSTRE_H__
-
-/** \defgroup liblustre liblustre
- *
- * @{
- */
-#include <fcntl.h>
-#include <endian.h>
-#include <sys/queue.h>
-
-#ifdef __KERNEL__
-#error Kernel files should not #include <liblustre.h>
-#endif
-
-#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
-
-/* definitions for liblustre */
-
-#ifdef __CYGWIN__
-
-#define loff_t long long
-#define ERESTART 2001
-typedef unsigned short umode_t;
-
-#endif
-
-#ifndef page_private
-#define page_private(page) ((page)->private)
-#define set_page_private(page, v) ((page)->private = (v))
-#endif
-
-/* bits ops */
-
-/* a long can be more than 32 bits, so use BITS_PER_LONG
- * to allow the compiler to adjust the bit shifting accordingly
- */
-
-static inline int ext2_set_bit(int nr, void *addr)
-{
-#if __BYTE_ORDER == __BIG_ENDIAN
-       return set_bit((nr ^ ((BITS_PER_LONG - 1) & ~0x7)), addr);
-#else
-       return set_bit(nr, addr);
-#endif
-}
-
-static inline int ext2_clear_bit(int nr, void *addr)
-{
-#if __BYTE_ORDER == __BIG_ENDIAN
-       return clear_bit((nr ^ ((BITS_PER_LONG - 1) & ~0x7)), addr);
-#else
-       return clear_bit(nr, addr);
-#endif
-}
-
-static inline int ext2_test_bit(int nr, const void *addr)
-{
-#if __BYTE_ORDER == __BIG_ENDIAN
-       const unsigned char *tmp = addr;
-       return (tmp[nr >> 3] >> (nr & 7)) & 1;
-#else
-       return test_bit(nr, addr);
-#endif
-}
-
-/* module initialization */
-extern int init_obdclass(void);
-extern int ptlrpc_init(void);
-extern int ldlm_init(void);
-extern int osc_init(void);
-extern int lov_init(void);
-extern int mdc_init(void);
-extern int lmv_init(void);
-extern int mgc_init(void);
-
-/* general stuff */
-
-#ifndef min
-#define min(x,y) ((x)<(y) ? (x) : (y))
-#endif
-
-#ifndef max
-#define max(x,y) ((x)>(y) ? (x) : (y))
-#endif
-
-#ifndef min_t
-#define min_t(type,x,y) \
-        ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-#endif
-#ifndef max_t
-#define max_t(type,x,y) \
-        ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
-#endif
-
-#define simple_strtol strtol
-
-#ifdef HZ
-#undef HZ
-#endif
-#define HZ 1
-
-/* random */
-
-void cfs_get_random_bytes(void *ptr, int size);
-
-/* memory */
-
-/* memory size: used for some client tunables */
-#define totalram_pages  (256 * 1024) /* 1GB */
-#define NUM_CACHEPAGES totalram_pages
-
-
-/* VFS stuff */
-#define ATTR_MODE       0x0001
-#define ATTR_UID        0x0002
-#define ATTR_GID        0x0004
-#define ATTR_SIZE       0x0008
-#define ATTR_ATIME      0x0010
-#define ATTR_MTIME      0x0020
-#define ATTR_CTIME      0x0040
-#define ATTR_ATIME_SET  0x0080
-#define ATTR_MTIME_SET  0x0100
-#define ATTR_FORCE      0x0200  /* Not a change, but a change it */
-#define ATTR_ATTR_FLAG  0x0400
-#define ATTR_RAW        0x0800  /* file system, not vfs will massage attrs */
-#define ATTR_FROM_OPEN  0x1000  /* called from open path, ie O_TRUNC */
-#define ATTR_CTIME_SET  0x2000
-#define ATTR_BLOCKS     0x4000
-#define ATTR_KILL_SUID  0
-#define ATTR_KILL_SGID  0
-#define ATTR_FILE       0
-
-struct iattr {
-       unsigned int    ia_valid;
-       umode_t         ia_mode;
-       uid_t           ia_uid;
-       gid_t           ia_gid;
-       loff_t          ia_size;
-       time_t          ia_atime;
-       time_t          ia_mtime;
-       time_t          ia_ctime;
-       unsigned int    ia_attr_flags;
-};
-
-/* defined in kernel header include/linux/namei.h */
-#define INTENT_MAGIC 0x19620323
-
-struct lustre_intent_data {
-        int       it_disposition;
-        int       it_status;
-        __u64     it_lock_handle;
-        int       it_lock_mode;
-       int       it_remote_lock_mode;
-       __u64     it_remote_lock_handle;
-        void     *it_data;
-
-       unsigned int    it_lock_set:1;
-};
-
-struct lookup_intent {
-       int     it_magic;
-       void    (*it_op_release)(struct lookup_intent *);
-       int     it_op;
-       int     it_create_mode;
-       __u64   it_flags;
-       union {
-               struct lustre_intent_data lustre;
-       } d;
-};
-
-static inline int it_disposition(const struct lookup_intent *it, int flag)
-{
-       return it->d.lustre.it_disposition & flag;
-}
-
-static inline void it_set_disposition(struct lookup_intent *it, int flag)
-{
-       it->d.lustre.it_disposition |= flag;
-}
-
-static inline void it_clear_disposition(struct lookup_intent *it, int flag)
-{
-       it->d.lustre.it_disposition &= ~flag;
-}
-
-#undef  LL_TASK_CL_ENV
-#define LL_TASK_CL_ENV          cl_env
-
-struct task_struct {
-        int state;
-        char comm[32];
-        int uid;
-        int gid;
-        int pid;
-        int fsuid;
-        int fsgid;
-        int max_groups;
-        int ngroups;
-        gid_t *groups;
-        void  *cl_env;
-        __u32 cap_effective;
-};
-
-
-#define current_pid()       (current->pid)
-#define current_comm()      (current->comm)
-#define current_fsuid()     (current->fsuid)
-#define current_fsgid()     (current->fsgid)
-#define current_umask()     ({ mode_t mask = umask(0); umask(mask); mask; })
-
-extern struct task_struct *current;
-int in_group_p(gid_t gid);
-
-#define set_current_state(foo) do { current->state = foo; } while (0)
-
-#define wait_event_interruptible(wq, condition)                         \
-{                                                                       \
-       struct l_wait_info lwi;                                         \
-       int timeout = 100000000;/* forever */                           \
-       int ret;                                                        \
-                                                                       \
-       lwi = LWI_TIMEOUT(timeout, NULL, NULL);                         \
-       ret = l_wait_event(NULL, condition, &lwi);                      \
-                                                                       \
-       ret;                                                            \
-}
-
-#define call_usermodehelper(path, argv, envp, wait) (0)
-
-#if HZ != 1
-#error "liblustre's jiffies currently expects HZ to be 1"
-#endif
-#define jiffies                                 \
-({                                              \
-        unsigned long _ret = 0;                 \
-        struct timeval tv;                      \
-        if (gettimeofday(&tv, NULL) == 0)       \
-                _ret = tv.tv_sec;               \
-        _ret;                                   \
-})
-#define get_jiffies_64()  (__u64)jiffies
-
-#ifndef likely
-#define likely(exp) (exp)
-#endif
-#ifndef unlikely
-#define unlikely(exp) (exp)
-#endif
-
-#define might_sleep()
-#define might_sleep_if(c)
-#define smp_mb()
-
-/* FIXME sys/capability will finally included linux/fs.h thus
- * cause numerous trouble on x86-64. as temporary solution for
- * build broken at Cray, we copy definition we need from capability.h
- * FIXME
- */
-struct _cap_struct;
-typedef struct _cap_struct *cap_t;
-typedef int cap_value_t;
-typedef enum {
-    CAP_EFFECTIVE=0,
-    CAP_PERMITTED=1,
-    CAP_INHERITABLE=2
-} cap_flag_t;
-typedef enum {
-    CAP_CLEAR=0,
-    CAP_SET=1
-} cap_flag_value_t;
-
-cap_t   cap_get_proc(void);
-int     cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
-
-struct liblustre_wait_callback {
-        cfs_list_t              llwc_list;
-        const char             *llwc_name;
-        int                   (*llwc_fn)(void *arg);
-        void                   *llwc_arg;
-};
-
-void *liblustre_register_wait_callback(const char *name,
-                                       int (*fn)(void *arg), void *arg);
-void liblustre_deregister_wait_callback(void *notifier);
-int liblustre_wait_event(int timeout);
-
-void *liblustre_register_idle_callback(const char *name,
-                                       int (*fn)(void *arg), void *arg);
-void liblustre_deregister_idle_callback(void *notifier);
-void liblustre_wait_idle(void);
-
-struct file_lock {
-        struct file_lock *fl_next;  /* singly linked list for this inode  */
-        cfs_list_t fl_link;   /* doubly linked list of all locks */
-        cfs_list_t fl_block;  /* circular list of blocked processes */
-       void *fl_owner;
-       unsigned int fl_pid;
-       wait_queue_head_t fl_wait;
-       struct file *fl_file;
-        unsigned char fl_flags;
-        unsigned char fl_type;
-        loff_t fl_start;
-        loff_t fl_end;
-
-        void (*fl_notify)(struct file_lock *);  /* unblock callback */
-        void (*fl_insert)(struct file_lock *);  /* lock insertion callback */
-        void (*fl_remove)(struct file_lock *);  /* lock removal callback */
-
-        void *fl_fasync; /* for lease break notifications */
-        unsigned long fl_break_time;    /* for nonblocking lease breaks */
-};
-
-#define flock_type(fl)                 ((fl)->fl_type)
-#define flock_set_type(fl, type)       do { (fl)->fl_type = (type); } while (0)
-#define flock_pid(fl)                  ((fl)->fl_pid)
-#define flock_set_pid(fl, pid)         do { (fl)->fl_pid = (pid); } while (0)
-#define flock_start(fl)                        ((fl)->fl_start)
-#define flock_set_start(fl, st)                do { (fl)->fl_start = (st); } while (0)
-#define flock_end(fl)                  ((fl)->fl_end)
-#define flock_set_end(fl, end)         do { (fl)->fl_end = (end); } while (0)
-
-#ifndef OFFSET_MAX
-#define INT_LIMIT(x)    (~((x)1 << (sizeof(x)*8 - 1)))
-#define OFFSET_MAX      INT_LIMIT(loff_t)
-#endif
-
-#define i_atime                     i_stbuf.st_atime
-#define i_mtime                     i_stbuf.st_mtime
-#define i_ctime                     i_stbuf.st_ctime
-/* use i_size_read() i_size_write() to access i_stbuf.st_size */
-#define i_blocks                    i_stbuf.st_blocks
-#define i_blksize                   i_stbuf.st_blksize
-#define i_mode                      i_stbuf.st_mode
-#define i_uid                       i_stbuf.st_uid
-#define i_gid                       i_stbuf.st_gid
-
-/* XXX: defined in kernel */
-#define FL_POSIX        1
-#define FL_SLEEP        128
-
-/* quota */
-#define QUOTA_OK 0
-#define NO_QUOTA 1
-
-/* ACL */
-typedef struct {
-        __u16           e_tag;
-        __u16           e_perm;
-        __u32           e_id;
-} posix_acl_xattr_entry;
-
-struct posix_acl {
-       atomic_t                a_refcount;
-       unsigned int            a_count;
-       posix_acl_xattr_entry   a_entries[0];
-};
-
-typedef struct {
-        __u32                 a_version;
-        posix_acl_xattr_entry a_entries[0];
-} posix_acl_xattr_header;
-
-static inline size_t posix_acl_xattr_size(int count)
-{
-        return sizeof(posix_acl_xattr_header) + count *
-               sizeof(posix_acl_xattr_entry);
-}
-
-static inline
-struct posix_acl * posix_acl_from_xattr(const void *value, size_t size)
-{
-        return NULL;
-}
-
-/* The kernel version takes 3 arguments, so strip that off first. */
-#define posix_acl_from_xattr(a,b,c)    posix_acl_from_xattr(b,c)
-#define posix_acl_to_xattr(a,b,c)      posix_acl_to_xattr(b,c)
-
-static inline
-int posix_acl_valid(const struct posix_acl *acl)
-{
-        return 0;
-}
-
-static inline
-void posix_acl_release(struct posix_acl *acl)
-{
-}
-
-#if defined(LIBLUSTRE_POSIX_ACL) && !defined(CONFIG_FS_POSIX_ACL)
-# define CONFIG_FS_POSIX_ACL 1
-#endif
-
-#ifndef ENOTSUPP
-#define ENOTSUPP ENOTSUP
-#endif
-
-typedef int mm_segment_t;
-
-#define S_IRWXUGO       (S_IRWXU|S_IRWXG|S_IRWXO)
-#define S_IALLUGO       (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
-
-#include <obd_support.h>
-#include <lustre/lustre_idl.h>
-#include <lustre_lib.h>
-#include <lustre_import.h>
-#include <lustre_export.h>
-#include <lustre_net.h>
-
-/** @} liblustre */
-
-#endif
+#error "do not include <liblustre.h>"
index 5d4e3cc..4c4654d 100644 (file)
@@ -32,6 +32,7 @@
 
 #ifndef _LUSTRE_LFSCK_USER_H
 # define _LUSTRE_LFSCK_USER_H
 
 #ifndef _LUSTRE_LFSCK_USER_H
 # define _LUSTRE_LFSCK_USER_H
+# include <lustre/lustre_user.h>
 
 enum lfsck_param_flags {
        /* Reset LFSCK iterator position to the device beginning. */
 
 enum lfsck_param_flags {
        /* Reset LFSCK iterator position to the device beginning. */
index d99e141..b65e00d 100644 (file)
@@ -30,6 +30,7 @@
 
 #ifndef _LUSTRE_UPDATE_H
 #define _LUSTRE_UPDATE_H
 
 #ifndef _LUSTRE_UPDATE_H
 #define _LUSTRE_UPDATE_H
+#include <lustre_net.h>
 
 #define OUT_UPDATE_INIT_BUFFER_SIZE    8192
 #define OUT_UPDATE_REPLY_SIZE  8192
 
 #define OUT_UPDATE_INIT_BUFFER_SIZE    8192
 #define OUT_UPDATE_REPLY_SIZE  8192
index 6edb1d3..9967577 100644 (file)
@@ -36,6 +36,9 @@
 
 #ifndef __OBD_H
 #define __OBD_H
 
 #ifndef __OBD_H
 #define __OBD_H
+#ifndef __KERNEL__
+# error "userspace should not include <obd.h>"
+#endif
 
 #if defined(__linux__)
 #include <linux/obd.h>
 
 #if defined(__linux__)
 #include <linux/obd.h>
index 1318562..b052766 100644 (file)
@@ -41,7 +41,7 @@
 #ifdef __KERNEL__
 # include <lustre_dlm.h>
 #else
 #ifdef __KERNEL__
 # include <lustre_dlm.h>
 #else
-# include <liblustre.h>
+# include <libcfs/libcfs.h>
 #endif
 #include <obd_support.h>
 #include <interval_tree.h>
 #endif
 #include <obd_support.h>
 #include <interval_tree.h>
index 8a861ee..af36c72 100644 (file)
 #include <lustre/lustre_idl.h>
 /* obd2cli_tgt() (required by DEBUG_REQ()) */
 #include <obd.h>
 #include <lustre/lustre_idl.h>
 /* obd2cli_tgt() (required by DEBUG_REQ()) */
 #include <obd.h>
+#include <lustre_debug.h>
+#include <lustre_update.h>
+#endif /* !__REQ_LAYOUT_USER__ */
 
 
-/* __REQ_LAYOUT_USER__ */
-#endif
 /* struct ptlrpc_request, lustre_msg* */
 #include <lustre_req_layout.h>
 /* struct ptlrpc_request, lustre_msg* */
 #include <lustre_req_layout.h>
-#include <lustre_update.h>
 #include <lustre_acl.h>
 #include <lustre_acl.h>
-#include <lustre_debug.h>
 
 /*
  * RQFs (see below) refer to two struct req_msg_field arrays describing the
 
 /*
  * RQFs (see below) refer to two struct req_msg_field arrays describing the
index 8c91793..ee48eec 100644 (file)
@@ -54,8 +54,9 @@ void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux deva 2.6.32-358.18.1.el6_lustre.gdf685d2.x86_64 #1 SMP Sat Aug 31 20:41:4
-         * with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)  */
+         * running on Linux u 2.6.32-431.5.1.el6.lustre.x86_64 #1 SMP Wed Feb 12 11:01:08 CST 2014 x8
+         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)  */
+
 
        /* Constants... */
        LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
 
        /* Constants... */
        LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
@@ -4050,36 +4051,6 @@ void lustre_assert_wire_constants(void)
        CLASSERT(FIEMAP_EXTENT_MERGED == 0x00001000);
        CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
        CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
        CLASSERT(FIEMAP_EXTENT_MERGED == 0x00001000);
        CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
        CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
-#ifdef LIBLUSTRE_POSIX_ACL
-
-       /* Checks for type posix_acl_xattr_entry */
-       LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
-                (long long)(int)sizeof(posix_acl_xattr_entry));
-       LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
-       LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
-       LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
-       LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
-       LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
-       LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
-
-       /* Checks for type posix_acl_xattr_header */
-       LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n",
-                (long long)(int)sizeof(posix_acl_xattr_header));
-       LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_header, a_version));
-       LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
-       LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_header, a_entries));
-       LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
-#endif
 
        /* Checks for struct link_ea_header */
        LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",
 
        /* Checks for struct link_ea_header */
        LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",
@@ -4687,3 +4658,4 @@ void lustre_assert_wire_constants(void)
        LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
 }
        LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
 }
+
index 8094774..df7104c 100644 (file)
@@ -40,7 +40,7 @@
 #include <sys/stat.h>
 #include <sys/syscall.h>
 
 #include <sys/stat.h>
 #include <sys/syscall.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 
 #define MAX_HANDLE_SZ 128
 #include <lustre/lustre_user.h>
 
 #define MAX_HANDLE_SZ 128
index ed9baec..b44c32b 100644 (file)
 #include <errno.h>
 #include <dirent.h>
 
 #include <errno.h>
 #include <dirent.h>
 
-#include <liblustre.h>
 #include <lustre/lustreapi.h>
 
 #include <lustre/lustreapi.h>
 
-#include <lnet/lnetctl.h>
-
-
 #define MAX_LOV_UUID_COUNT      1000
 union {
         struct obd_uuid uuid;
 #define MAX_LOV_UUID_COUNT      1000
 union {
         struct obd_uuid uuid;
index eb00b21..0874fac 100644 (file)
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include "lustre/lustre_user.h"
 #include "lustre/tests/lp_utils.h"
 
 #include "lustre/lustre_user.h"
 #include "lustre/tests/lp_utils.h"
 
index 896854e..beca2ff 100644 (file)
@@ -220,7 +220,7 @@ sigalrm_handler(int signum)
 #define HAVE_MDC_LOOKUP
 #elif defined(USE_MDC_LOOKUP)
 #include <config.h>
 #define HAVE_MDC_LOOKUP
 #elif defined(USE_MDC_LOOKUP)
 #include <config.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre_ioctl.h>
 
 int llapi_file_lookup(int dirfd, const char *name)
 #include <lustre_ioctl.h>
 
 int llapi_file_lookup(int dirfd, const char *name)
index e184c62..7368b52 100644 (file)
@@ -43,7 +43,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
 #include <stdlib.h>
 #include <unistd.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustreapi.h>
 
 #define ACT_NONE        0
 #include <lustre/lustreapi.h>
 
 #define ACT_NONE        0
index e33928e..92f1088 100644 (file)
@@ -45,7 +45,7 @@
 #include <limits.h>
 #include <sys/ioctl.h>
 
 #include <limits.h>
 #include <sys/ioctl.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre_ioctl.h>
 
 struct option longopts[] = {
 #include <lustre_ioctl.h>
 
 struct option longopts[] = {
index 151fb59..c53a631 100644 (file)
@@ -38,7 +38,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre_ioctl.h>
 
 int main(int argc, char **argv)
 #include <lustre_ioctl.h>
 
 int main(int argc, char **argv)
index 3d7a344..5a886c9 100644 (file)
@@ -47,7 +47,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 
 #define READ  1
 #define WRITE 2
 
 #define READ  1
 #define WRITE 2
index 3729f3f..a15eaf9 100644 (file)
@@ -48,7 +48,7 @@
 #include <libgen.h>
 #include <syslog.h>
 
 #include <libgen.h>
 #include <syslog.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 #include <lustre/lustre_idl.h>
 
 #include <lustre/lustre_user.h>
 #include <lustre/lustre_idl.h>
 
index a092901..5c6892c 100644 (file)
@@ -45,6 +45,7 @@
 #include <lnet/lnetctl.h>
 #include "obdctl.h"
 #include <libcfs/libcfsutil.h>
 #include <lnet/lnetctl.h>
 #include "obdctl.h"
 #include <libcfs/libcfsutil.h>
+#include <lustre/lustre_idl.h>
 
 static int jt_quit(int argc, char **argv) {
         Parser_quit(argc, argv);
 
 static int jt_quit(int argc, char **argv) {
         Parser_quit(argc, argv);
index 59f82e6..1c0b2fe 100644 (file)
@@ -69,7 +69,8 @@
 
 #include <lnet/lnetctl.h>
 
 
 #include <lnet/lnetctl.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
 #include <lustre/lustreapi.h>
 
 #include <libcfs/libcfsutil.h>
 #include <lustre/lustreapi.h>
 
 #include <libcfs/libcfsutil.h>
index a5f3173..9b64c61 100644 (file)
@@ -55,7 +55,6 @@
 #endif
 
 #include <libcfs/libcfs.h>
 #endif
 
 #include <libcfs/libcfs.h>
-#include <liblustre.h>
 #include <lustre/libiam.h>
 
 typedef __u32 lvar_hash_t;
 #include <lustre/libiam.h>
 
 typedef __u32 lvar_hash_t;
index 5e16e22..d3c99c6 100644 (file)
@@ -69,7 +69,7 @@
 #endif
 #include <poll.h>
 
 #endif
 #include <poll.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lnet/lnetctl.h>
 #include <lustre/lustreapi.h>
 #include <lustre_ioctl.h>
 #include <lnet/lnetctl.h>
 #include <lustre/lustreapi.h>
 #include <lustre_ioctl.h>
index 94c6ba0..47fe2ec 100644 (file)
@@ -53,8 +53,9 @@
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
 #endif
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lnet/lnetctl.h>
 #include <lnet/lnetctl.h>
+#include <lustre/lustre_idl.h>
 #include <lustre/lustreapi.h>
 #include "lustreapi_internal.h"
 
 #include <lustre/lustreapi.h>
 #include "lustreapi_internal.h"
 
index a09a1e0..b4f0882 100644 (file)
@@ -41,7 +41,7 @@
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
 #endif
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustreapi.h>
 
 /** Quick-n'-dirty JSON string escape routine.
 #include <lustre/lustreapi.h>
 
 /** Quick-n'-dirty JSON string escape routine.
index acd66e3..836b442 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustreapi.h>
 #include "lustreapi_internal.h"
 
 #include <lustre/lustreapi.h>
 #include "lustreapi_internal.h"
 
index a28b3b9..7f2e170 100644 (file)
@@ -46,7 +46,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/xattr.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/xattr.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 
 int main(int argc, char *argv[])
 #include <lustre/lustre_user.h>
 
 int main(int argc, char *argv[])
index b7250b2..3cafd7c 100644 (file)
@@ -57,7 +57,7 @@
 #include <sys/xattr.h>
 #include <sys/stat.h>
 
 #include <sys/xattr.h>
 #include <sys/stat.h>
 
-#include <liblustre.h>
+#include <lustre/lustre_idl.h>
 #include <libcfs/list.h>
 
 #define MAX_GROUPS 64
 #include <libcfs/list.h>
 
 #define MAX_GROUPS 64
index 3c994fc..2a1903b 100644 (file)
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <endian.h>
 #include <fcntl.h>
 
 #include <time.h>
 #include <fcntl.h>
 
 #include <time.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_idl.h>
 #include <lustre/lustre_idl.h>
+#include <lustre_cfg.h>
+
+static inline int ext2_test_bit(int nr, const void *addr)
+{
+#if __BYTE_ORDER == __BIG_ENDIAN
+       const unsigned char *tmp = addr;
+       return (tmp[nr >> 3] >> (nr & 7)) & 1;
+#else
+       return test_bit(nr, addr);
+#endif
+}
 
 int llog_pack_buffer(int fd, struct llog_log_hdr **llog_buf,
                      struct llog_rec_hdr ***recs, int *recs_number);
 
 int llog_pack_buffer(int fd, struct llog_log_hdr **llog_buf,
                      struct llog_rec_hdr ***recs, int *recs_number);
index fa23d5b..6c8355d 100644 (file)
@@ -49,9 +49,7 @@
 #include <ctype.h>
 #include <glob.h>
 
 #include <ctype.h>
 #include <glob.h>
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
+#include <libcfs/libcfs.h>
 #include <lustre_cfg.h>
 #include <lustre/lustre_idl.h>
 #include <lustre/lustre_build_version.h>
 #include <lustre_cfg.h>
 #include <lustre/lustre_idl.h>
 #include <lustre/lustre_build_version.h>
index f0f1f0f..7671da3 100644 (file)
@@ -53,6 +53,7 @@
 #include <lustre_ver.h>
 #include <ctype.h>
 #include <limits.h>
 #include <lustre_ver.h>
 #include <ctype.h>
 #include <limits.h>
+#include <lustre/lustre_idl.h>
 #if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 10, 51, 0)
 /*
  * LU-1783
 #if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 10, 51, 0)
 /*
  * LU-1783
index c628510..4774ac7 100644 (file)
 #include <unistd.h>
 
 #include "obdctl.h"
 #include <unistd.h>
 
 #include "obdctl.h"
-
+#include <libcfs/libcfs.h>
+#include <lnet/lnet.h>
+#include <lustre/lustre_idl.h>
+#include <lustre_cfg.h>
 #include <lustre_ioctl.h>
 #include <lustre/lustre_build_version.h>
 
 #include <lustre_ioctl.h>
 #include <lustre/lustre_build_version.h>
 
index abe2dbb..3e67e8b 100644 (file)
 #ifndef _OBDCTL_H_
 #define _OBDCTL_H_
 
 #ifndef _OBDCTL_H_
 #define _OBDCTL_H_
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
-
-#include <lustre/lustre_idl.h>
-
 #define MAX_IOC_BUFLEN 8192
 
 /* obd.c */
 #define MAX_IOC_BUFLEN 8192
 
 /* obd.c */
index ae2202a..22e1972 100644 (file)
@@ -44,7 +44,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
 #include <stdlib.h>
 #include <unistd.h>
 
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_idl.h>
 
 #define __REQ_LAYOUT_USER__ (1)
 #include <lustre/lustre_idl.h>
 
 #define __REQ_LAYOUT_USER__ (1)
index f9313dc..f27f748 100644 (file)
@@ -37,7 +37,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_disk.h>
 
 #include <lustre/lustre_idl.h>
 #include <lustre_disk.h>
 
@@ -1750,25 +1750,6 @@ check_getinfo_fid2path(void)
 }
 
 static void
 }
 
 static void
-check_posix_acl_xattr_entry(void)
-{
-       BLANK_LINE();
-       CHECK_STRUCT_TYPEDEF(posix_acl_xattr_entry);
-       CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_tag);
-       CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_perm);
-       CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_id);
-}
-
-static void
-check_posix_acl_xattr_header(void)
-{
-       BLANK_LINE();
-       CHECK_STRUCT_TYPEDEF(posix_acl_xattr_header);
-       CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
-       CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
-}
-
-static void
 check_ll_user_fiemap(void)
 {
        BLANK_LINE();
 check_ll_user_fiemap(void)
 {
        BLANK_LINE();
@@ -2471,13 +2452,6 @@ main(int argc, char **argv)
        check_getinfo_fid2path();
        check_ll_user_fiemap();
        check_ll_fiemap_extent();
        check_getinfo_fid2path();
        check_ll_user_fiemap();
        check_ll_fiemap_extent();
-       printf("#ifdef LIBLUSTRE_POSIX_ACL\n");
-#ifndef LIBLUSTRE_POSIX_ACL
-#error build generator without LIBLUSTRE_POSIX_ACL defined - produce wrong check code.
-#endif
-       check_posix_acl_xattr_entry();
-       check_posix_acl_xattr_header();
-       printf("#endif\n");
        check_link_ea_header();
        check_link_ea_entry();
        check_layout_intent();
        check_link_ea_header();
        check_link_ea_entry();
        check_layout_intent();
index f203baa..6bf14b7 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_disk.h>
 
 #include <lustre/lustre_idl.h>
 #include <lustre_disk.h>
 
index 75966e2..1138185 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_disk.h>
 
 #include <lustre/lustre_idl.h>
 #include <lustre_disk.h>
 
@@ -57,13 +57,13 @@ int main()
 
         return ret;
 }
 
         return ret;
 }
-
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux testnode 2.6.32 #3 SMP Thu Sep 13 12:42:57 PDT 2012 x86_64 x86_64 x86_64 
-         * with gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)  */
+         * running on Linux u 2.6.32-431.5.1.el6.lustre.x86_64 #1 SMP Wed Feb 12 11:01:08 CST 2014 x8
+         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)  */
+
 
        /* Constants... */
        LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
 
        /* Constants... */
        LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
@@ -4058,36 +4058,6 @@ void lustre_assert_wire_constants(void)
        CLASSERT(FIEMAP_EXTENT_MERGED == 0x00001000);
        CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
        CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
        CLASSERT(FIEMAP_EXTENT_MERGED == 0x00001000);
        CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
        CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
-#ifdef LIBLUSTRE_POSIX_ACL
-
-       /* Checks for type posix_acl_xattr_entry */
-       LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
-                (long long)(int)sizeof(posix_acl_xattr_entry));
-       LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
-       LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
-       LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
-       LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
-       LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
-       LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
-
-       /* Checks for type posix_acl_xattr_header */
-       LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n",
-                (long long)(int)sizeof(posix_acl_xattr_header));
-       LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_header, a_version));
-       LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
-       LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n",
-                (long long)(int)offsetof(posix_acl_xattr_header, a_entries));
-       LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n",
-                (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
-#endif
 
        /* Checks for struct link_ea_header */
        LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",
 
        /* Checks for struct link_ea_header */
        LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",
@@ -4695,3 +4665,4 @@ void lustre_assert_wire_constants(void)
        LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
 }
        LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
 }
+