-#ifndef DATA_FOR_LLITE_IS_LIST
-#define ll_d_hlist_node hlist_node
-#define ll_d_hlist_empty(list) hlist_empty(list)
-#define ll_d_hlist_entry(ptr, type, name) hlist_entry(ptr.first, type, name)
-#define ll_d_hlist_for_each(tmp, i_dentry) hlist_for_each(tmp, i_dentry)
-# ifdef HAVE_HLIST_FOR_EACH_3ARG
-# define ll_d_hlist_for_each_entry(dentry, p, i_dentry) \
- p = NULL; hlist_for_each_entry(dentry, i_dentry, d_alias)
-# else
-# define ll_d_hlist_for_each_entry(dentry, p, i_dentry) \
- hlist_for_each_entry(dentry, p, i_dentry, d_alias)
-# endif
-#define DECLARE_LL_D_HLIST_NODE_PTR(name) struct ll_d_hlist_node *name
-#else
-#define ll_d_hlist_node list_head
-#define ll_d_hlist_empty(list) list_empty(list)
-#define ll_d_hlist_entry(ptr, type, name) list_entry(ptr.next, type, name)
-#define ll_d_hlist_for_each(tmp, i_dentry) list_for_each(tmp, i_dentry)
-#define ll_d_hlist_for_each_entry(dentry, p, i_dentry) \
- list_for_each_entry(dentry, i_dentry, d_alias)
-#define DECLARE_LL_D_HLIST_NODE_PTR(name) /* nothing */
-#endif /* !DATA_FOR_LLITE_IS_LIST */
-
-#ifndef QUOTA_OK
-# define QUOTA_OK 0
-#endif
-#ifndef NO_QUOTA
-# define NO_QUOTA (-EDQUOT)
-#endif
-
-#ifndef SEEK_DATA
-#define SEEK_DATA 3 /* seek to the next data */
-#endif
-#ifndef SEEK_HOLE
-#define SEEK_HOLE 4 /* seek to the next hole */
-#endif
-
-#ifndef FMODE_UNSIGNED_OFFSET
-#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
-#endif
-
-#if !defined(_ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_) && !defined(ext2_set_bit)
-# define ext2_set_bit __test_and_set_bit_le
-# define ext2_clear_bit __test_and_clear_bit_le
-# define ext2_test_bit test_bit_le
-# define ext2_find_first_zero_bit find_first_zero_bit_le
-# define ext2_find_next_zero_bit find_next_zero_bit_le
-#endif
-
-#ifdef ATTR_TIMES_SET
-# define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)
-#else
-# define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET)
-#endif
-
-#ifndef XATTR_NAME_POSIX_ACL_ACCESS
-# define XATTR_NAME_POSIX_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
-#endif
-
-#ifndef XATTR_NAME_POSIX_ACL_DEFAULT
-# define XATTR_NAME_POSIX_ACL_DEFAULT POSIX_ACL_XATTR_DEFAULT
-#endif
-
-#ifndef HAVE_LM_XXX_LOCK_MANAGER_OPS
-# define lm_compare_owner fl_compare_owner
-#endif
-
-/*
- * After 3.1, kernel's nameidata.intent.open.flags is different
- * with lustre's lookup_intent.it_flags, as lustre's it_flags'
- * lower bits equal to FMODE_xxx while kernel doesn't transliterate
- * lower bits of nameidata.intent.open.flags to FMODE_xxx.
- * */
-#include <linux/version.h>
-static inline int ll_namei_to_lookup_intent_flag(int flag)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
- flag = (flag & ~O_ACCMODE) | OPEN_FMODE(flag);
-#endif
- return flag;
-}
-
-#include <linux/fs.h>
-#ifndef HAVE_PROTECT_I_NLINK
-static inline void set_nlink(struct inode *inode, unsigned int nlink)