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
# 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)
# 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;
#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);
/*
- * linux/fs/ldiskfs/hash.c
- *
* Copyright (C) 2002 by Theodore Ts'o
*
* This file is released under the GPL v2.
* 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/ldiskfs_fs.h>
+#ifdef HAVE_SERVER_SUPPORT
+# include <linux/ldiskfs_fs.h>
+#else
+# include <obd_class.h>
+#endif
#define DELTA 0x9E3779B9
*/
#define DEBUG_SUBSYSTEM S_CLASS
+#include <obd_class.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 <obd_class.h>
#include <obd.h>
#endif
#include <lprocfs_status.h>
#ifdef __KERNEL__
#include <linux/jbd.h>
+#ifdef HAVE_SERVER_SUPPORT
/* LDISKFS_SB() */
#include <linux/ldiskfs_fs.h>
#endif
+#endif
static int mea_last_char_hash(int count, char *name, int namelen)
{
unsigned int c;
#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>