Whamcloud - gitweb
Branch HEAD
authorfanyong <fanyong>
Tue, 18 Dec 2007 04:27:30 +0000 (04:27 +0000)
committerfanyong <fanyong>
Tue, 18 Dec 2007 04:27:30 +0000 (04:27 +0000)
b=13814
i=oleg.drokin
i=sheng.yang

(1) Difine some macros and variables if "disable-server" when configure.
(2) Support to compile patchless client on HEAD.
(3) Comment for some code copy issue.

lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_acl.h
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/obdclass/hash.c
lustre/obdclass/mea.c
lustre/tests/statmany.c

index 5f789c1..37cb836 100644 (file)
@@ -1350,6 +1350,7 @@ CFLAGS="$tmp_flags"
 AC_DEFUN([LC_PROG_LINUX],
          [LC_LUSTRE_VERSION_H
          if test x$enable_server = xyes ; then
 AC_DEFUN([LC_PROG_LINUX],
          [LC_LUSTRE_VERSION_H
          if test x$enable_server = xyes ; then
+             AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])
              LC_CONFIG_BACKINGFS
          fi
          LC_CONFIG_PINGER
              LC_CONFIG_BACKINGFS
          fi
          LC_CONFIG_PINGER
index bbf6471..0583ea4 100644 (file)
 #  define MDS_XATTR_NAME_ACL_ACCESS XATTR_NAME_ACL_ACCESS
 #  define mds_xattr_acl_size(entry) xattr_acl_size(entry)
 # else /* HAVE_XATTR_ACL */
 #  define MDS_XATTR_NAME_ACL_ACCESS XATTR_NAME_ACL_ACCESS
 #  define mds_xattr_acl_size(entry) xattr_acl_size(entry)
 # else /* HAVE_XATTR_ACL */
-#  define MDS_XATTR_NAME_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
-#  define mds_xattr_acl_size(entry) posix_acl_xattr_size(entry)
+#  ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+#   define MDS_XATTR_NAME_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
+#   define mds_xattr_acl_size(entry) posix_acl_xattr_size(entry)
+#  endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
 # endif /* HAVE_XATTR_ACL */
 
 # define LUSTRE_POSIX_ACL_MAX_ENTRIES   (32)
 # endif /* HAVE_XATTR_ACL */
 
 # define LUSTRE_POSIX_ACL_MAX_ENTRIES   (32)
index ba0d89e..5bc3c47 100644 (file)
@@ -17,6 +17,9 @@
 # include <linux/smp_lock.h>
 # include <linux/proc_fs.h>
 # include <linux/mount.h>
 # include <linux/smp_lock.h>
 # include <linux/proc_fs.h>
 # include <linux/mount.h>
+# ifndef HAVE_VFS_INTENT_PATCHES
+#  include <linux/lustre_intent.h>
+# endif
 #endif
 
 typedef spinlock_t client_obd_lock_t;
 #endif
 
 typedef spinlock_t client_obd_lock_t;
index 550d5b5..c7869cc 100644 (file)
 #include <linux/timer.h>
 #endif
 
 #include <linux/timer.h>
 #endif
 
+#ifdef __KERNEL__
+# ifndef HAVE_SERVER_SUPPORT
+
+/* hash info structure used by the directory hash */
+#  define LDISKFS_DX_HASH_LEGACY        0
+#  define LDISKFS_DX_HASH_HALF_MD4      1
+#  define LDISKFS_DX_HASH_TEA           2
+#  define LDISKFS_DX_HASH_R5            3
+#  define LDISKFS_DX_HASH_SAME          4
+#  define LDISKFS_DX_HASH_MAX           4
+
+/* hash info structure used by the directory hash */
+struct ldiskfs_dx_hash_info
+{
+        u32     hash;
+        u32     minor_hash;
+        int     hash_version;
+        u32     *seed;
+};
+
+#  define LDISKFS_HTREE_EOF     0x7fffffff
+
+int ldiskfsfs_dirhash(const char *name, int len, struct ldiskfs_dx_hash_info *hinfo);
+
+# endif /* HAVE_SERVER_SUPPORT */
+#endif /* __KERNEL__ */
+
 void obd_zombie_impexp_init(void);
 void obd_zombie_impexp_cull(void);
 extern void (*obd_zombie_impexp_notify)(void);
 void obd_zombie_impexp_init(void);
 void obd_zombie_impexp_cull(void);
 extern void (*obd_zombie_impexp_notify)(void);
index 4775939..5165e7c 100644 (file)
@@ -1,6 +1,4 @@
 /*
 /*
- *  linux/fs/ldiskfs/hash.c
- *
  * Copyright (C) 2002 by Theodore Ts'o
  *
  * This file is released under the GPL v2.
  * Copyright (C) 2002 by Theodore Ts'o
  *
  * This file is released under the GPL v2.
@@ -9,10 +7,20 @@
  * License.
  */
 
  * License.
  */
 
+/*
+ * obdclass/hash.c is copied from ldiskfs/hash.c.
+ * ldiskfs is used by server only.
+ * obdclass is shared by both client and server, it should not depend on ldiskfs.
+ */
+
 #include <linux/fs.h>
 #include <linux/jbd.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/jbd.h>
 #include <linux/sched.h>
-#include <linux/ldiskfs_fs.h>
+#ifdef HAVE_SERVER_SUPPORT
+# include <linux/ldiskfs_fs.h>
+#else
+# include <obd_class.h>
+#endif
 
 #define DELTA 0x9E3779B9
 
 
 #define DELTA 0x9E3779B9
 
index 10ab6ca..15f15d8 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
+#include <obd_class.h>
 #ifdef __KERNEL__
 #include <linux/kmod.h>   /* for request_module() */
 #include <linux/module.h>
 #ifdef __KERNEL__
 #include <linux/kmod.h>   /* for request_module() */
 #include <linux/module.h>
-#include <obd_class.h>
 #include <linux/random.h>
 #include <linux/slab.h>
 #include <linux/pagemap.h>
 #else
 #include <liblustre.h>
 #include <linux/random.h>
 #include <linux/slab.h>
 #include <linux/pagemap.h>
 #else
 #include <liblustre.h>
-#include <obd_class.h>
 #include <obd.h>
 #endif
 #include <lprocfs_status.h>
 #include <obd.h>
 #endif
 #include <lprocfs_status.h>
 
 #ifdef __KERNEL__
 #include <linux/jbd.h>
 
 #ifdef __KERNEL__
 #include <linux/jbd.h>
+#ifdef HAVE_SERVER_SUPPORT
 /* LDISKFS_SB() */
 #include <linux/ldiskfs_fs.h>
 #endif
 /* LDISKFS_SB() */
 #include <linux/ldiskfs_fs.h>
 #endif
+#endif
 static int mea_last_char_hash(int count, char *name, int namelen)
 {
         unsigned int c;
 static int mea_last_char_hash(int count, char *name, int namelen)
 {
         unsigned int c;
index 63a13ad..476aed9 100644 (file)
@@ -11,9 +11,6 @@
 #include <limits.h>
 #include <sys/ioctl.h>
 
 #include <limits.h>
 #include <sys/ioctl.h>
 
-#if 0
-#include <linux/ldiskfs_fs.h>
-#endif
 #include <liblustre.h>
 #include <lustre_lib.h>
 #include <obd.h>
 #include <liblustre.h>
 #include <lustre_lib.h>
 #include <obd.h>