From e63be657e7803429366dedb23cafcac52db25961 Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 17 Sep 2009 00:00:16 +0000 Subject: [PATCH] b=18054 i=brian i=yangsheng o=Jim Garlick,Christopher Morrone An option to configure to use the ldiskfs that's supplied by the kernel (i.e. that's in the kernel-devel in the case of a RH kernel RPM roll). --- lustre/autoconf/lustre-core.m4 | 25 +++++++++++++++++++++++++ lustre/lvfs/fsfilt_ext3.c | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 3d84217..8193a8b 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -147,6 +147,30 @@ fi ]) # +# LC_HEADER_LDISKFS_XATTR +# +# CHAOS kernel-devel package will not include fs/ldiskfs/xattr.h +# +AC_DEFUN([LC_HEADER_LDISKFS_XATTR], +[AC_MSG_CHECKING([if ldiskfs has xattr.h header]) +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-I$LINUX/fs -I$LDISKFS_DIR -I$LDISKFS_DIR/ldiskfs" +LB_LINUX_TRY_COMPILE([ + #include +],[ + ldiskfs_xattr_get(NULL, 0, "", NULL, 0); + ldiskfs_xattr_set_handle(NULL, NULL, 0, "", NULL, 0, 0); + +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_LDISKFS_XATTR_H, 1, [ldiskfs/xattr.h found]) +],[ + AC_MSG_RESULT([no]) +]) +EXTRA_KCFLAGS="$tmp_flags" +]) + +# # LC_CONFIG_HEALTH_CHECK_WRITE # # Turn off the actual write to the disk @@ -1400,6 +1424,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_EXPORT___D_MOVE LC_EXPORT_NODE_TO_CPUMASK + LC_HEADER_LDISKFS_XATTR LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP LC_STRUCT_STATFS LC_FILEMAP_POPULATE diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index 33d417e..0e263ab 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -59,7 +59,13 @@ #include #include #include +#if defined(HAVE_EXT3_XATTR_H) #include +#else +/* ext3 xattr.h not available in rh style kernel-devel rpm */ +extern int ext3_xattr_get(struct inode *, int, const char *, void *, size_t); +extern int ext3_xattr_set_handle(handle_t *, struct inode *, int, const char *, const void *, size_t, int); +#endif #include #include -- 1.8.3.1