])
])
+AC_DEFUN([LC_S_TIME_GRAN],
+[AC_MSG_CHECKING([if super block has s_time_gran member])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ struct super_block sb;
+
+ return sb.s_time_gran;
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+AC_DEFUN([LC_SB_TIME_GRAN],
+[AC_MSG_CHECKING([if kernel has old get_sb_time_gran])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ return get_sb_time_gran(NULL);
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_SB_TIME_GRAN, 1, [kernel has old get_sb_time_gran])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+
+# ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
+AC_DEFUN([LC_RW_TREE_LOCK],
+[AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ struct address_space a;
+
+ write_lock(&a.tree_lock);
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+AC_DEFUN([LC_CONST_ACL_SIZE],
+[AC_MSG_CHECKING([calc acl size])
+tmp_flags="$CFLAGS"
+CFLAGS="$CFLAGS -I $LINUX/include $EXTRA_KCFLAGS"
+AC_TRY_RUN([
+#include <linux/autoconf.h>
+#include <linux/types.h>
+// block include
+#define __LINUX_POSIX_ACL_H
+
+# ifdef CONFIG_FS_POSIX_ACL
+# ifdef HAVE_XATTR_ACL
+# include <linux/xattr_acl.h>
+# endif
+# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+# include <linux/posix_acl_xattr.h>
+# endif
+# endif
+
+#include <linux/lustre_acl.h>
+
+#include <stdio.h>
+
+main(void)
+{
+ int size = mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES);
+ FILE *f = fopen("acl.size","w+");
+ fprintf(f,"%d", size);
+ fclose(f);
+}
+
+],[
+ acl_size=`cat acl.size`
+ AC_MSG_RESULT([ACL size $acl_size])
+ AC_DEFINE_UNQUOTED(XATTR_ACL_SIZE, AS_TR_SH([$acl_size]), [size of xattr acl])
+],[
+ AC_ERROR([ACL size can't computed])
+])
+CFLAGS="$tmp_flags"
+])
+
+
#
# LC_PROG_LINUX
#
LC_CONFIG_HEALTH_CHECK_WRITE
LC_CONFIG_LRU_RESIZE
+
LC_TASK_PPTR
# RHEL4 patches
LC_EXPORT_TRUNCATE_COMPLETE
LC_FILEMAP_POPULATE
LC_D_ADD_UNIQUE
LC_BIT_SPINLOCK_H
+
LC_XATTR_ACL
-LC_STRUCT_INTENT_FILE
LC_POSIX_ACL_XATTR_H
+LC_CONST_ACL_SIZE
+
+LC_STRUCT_INTENT_FILE
+
LC_FUNC_SET_FS_PWD
LC_CAPA_CRYPTO
LC_CONFIG_GSS
# does the kernel have VFS intent patches?
LC_VFS_INTENT_PATCHES
+# ~2.6.11
+LC_S_TIME_GRAN
+LC_SB_TIME_GRAN
+
+# 2.6.12
+LC_RW_TREE_LOCK
+
# 2.6.15
LC_INODE_I_MUTEX
# include <linux/fs.h>
# include <linux/dcache.h>
# ifdef CONFIG_FS_POSIX_ACL
-# include <linux/xattr_acl.h>
+# ifdef HAVE_XATTR_ACL
+# include <linux/xattr_acl.h>
+# endif
+# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+# include <linux/posix_acl_xattr.h>
+# endif
+# endif
+# ifndef HAVE_VFS_INTENT_PATCHES
+# include <linux/lustre_intent.h>
# endif
#endif
# define LUSTRE_POSIX_ACL_MAX_ENTRIES (32)
-# ifdef __KERNEL__
-# define LUSTRE_POSIX_ACL_MAX_SIZE \
- (sizeof(xattr_acl_header) + \
- LUSTRE_POSIX_ACL_MAX_ENTRIES * \
- sizeof(xattr_acl_entry))
-# else /* __KERNEL__ */
-# define LUSTRE_POSIX_ACL_MAX_SIZE 0
-# endif /* __KERNEL__ */
+# define LUSTRE_POSIX_ACL_MAX_SIZE XATTR_ACL_SIZE
#else /* CONFIG_FS_POSIX_ACL */
# define LUSTRE_POSIX_ACL_MAX_SIZE 0
#define p_pptr parent
#endif
+#ifndef HAVE_SB_TIME_GRAN
+#ifndef HAVE_S_TIME_GRAN
+#error Need s_time_gran patch!
+#endif
+static inline u32 get_sb_time_gran(struct super_block *sb)
+{
+ return sb->s_time_gran;
+}
+#endif
+
+#ifdef HAVE_RW_TREE_LOCK
+#define TREE_READ_LOCK_IRQ(mapping) read_lock_irq(&(mapping)->tree_lock)
+#define TREE_READ_UNLOCK_IRQ(mapping) read_unlock_irq(&(mapping)->tree_lock)
+#else
+#define TREE_READ_LOCK_IRQ(mapping) spin_lock_irq(&(mapping)->tree_lock)
+#define TREE_READ_UNLOCK_IRQ(mapping) spin_unlock_irq(&(mapping)->tree_lock)
+#endif
+
#endif /* __KERNEL__ */
#endif /* _COMPAT25_H */
/*
* Attr of this object.
*/
-static inline const __u32 lu_object_attr(const struct lu_object *o)
+static inline __u32 lu_object_attr(const struct lu_object *o)
{
LASSERT(lu_object_exists(o) > 0);
return o->lo_header->loh_attr;
# include <linux/fs.h>
# include <linux/dcache.h>
# ifdef CONFIG_FS_POSIX_ACL
-# include <linux/xattr_acl.h>
+# ifdef HAVE_XATTR_ACL
+# include <linux/xattr_acl.h>
+# endif
+# ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+# include <linux/posix_acl_xattr.h>
+# endif
# endif
#endif
#include <lustre_handles.h>
struct page *page;
int found;
- spin_lock_irq(&mapping->tree_lock);
+ TREE_READ_LOCK_IRQ(mapping);
found = radix_tree_gang_lookup(&mapping->page_tree,
(void **)&page, offset, 1);
if (found > 0) {
struct lu_dirpage *dp;
page_cache_get(page);
- spin_unlock_irq(&mapping->tree_lock);
+ TREE_READ_UNLOCK_IRQ(mapping);
/*
* In contrast to find_lock_page() we are sure that directory
* page cannot be truncated (while DLM lock is held) and,
}
} else {
- spin_unlock_irq(&mapping->tree_lock);
+ TREE_READ_UNLOCK_IRQ(mapping);
page = NULL;
}
return page;
}
}
-/* Quota stuff */
-extern quota_interface_t *quota_interface;
-
/* mdc/mdc_locks.c */
int mdc_set_lock_data(struct obd_export *exp,
__u64 *lockh, void *data);
* do_gettimeofday() goes backwards sometimes :(. Usethe TSC
*/
unsigned long long ret;
- extern unsigned long cpu_khz;
rdtscll(ret);
do_div(ret, cpu_khz / 1000);
#include <lustre_req_layout.h>
#include <linux/lustre_acl.h>
-#if __KERNEL__
-#define __POSIX_ACL_MAX_SIZE \
- (sizeof(xattr_acl_header) + 32 * sizeof(xattr_acl_entry))
-#else
-#define __POSIX_ACL_MAX_SIZE 0
-#endif
-
/*
* empty set of fields... for suitable definition of emptiness.
*/
const struct req_msg_field RMF_EADATA = DEFINE_MSGF("eadata", 0, -1, NULL);
EXPORT_SYMBOL(RMF_EADATA);
-const struct req_msg_field RMF_ACL = DEFINE_MSGF("acl", 0,
- __POSIX_ACL_MAX_SIZE, NULL);
+const struct req_msg_field RMF_ACL =
+ DEFINE_MSGF("acl", 0, LUSTRE_POSIX_ACL_MAX_SIZE, NULL);
EXPORT_SYMBOL(RMF_ACL);
const struct req_msg_field RMF_LOGCOOKIES =