From: wangdi Date: Thu, 1 Jun 2006 08:04:36 +0000 (+0000) Subject: Branch: b1_5 X-Git-Tag: v1_7_100~1^90~8^2~172 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=36a27be22d11628a53bc3f123bf763bb5807e963;p=fs%2Flustre-release.git Branch: b1_5 Few fixes about fc5 build according to Andreas's advices --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index bc9079f..1d8694a 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -490,6 +490,26 @@ LB_LINUX_TRY_COMPILE([ ]) # +# LC_POSIX_ACL_XATTR +# +# If we have xattr_acl.h +# +AC_DEFUN([LC_XATTR_ACL], +[LB_CHECK_FILE([$LINUX/include/linux/xattr_acl.h],[ + AC_MSG_CHECKING([if xattr_acl.h can be compiled]) + LB_LINUX_TRY_COMPILE([ + #include + ],[],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_XATTR_ACL, 1, [Kernel has xattr_acl]) + ],[ + AC_MSG_RESULT([no]) + ]) +], +[]) +]) + +# # LC_PROG_LINUX # # Lustre linux kernel checks @@ -517,6 +537,7 @@ LC_FUNC_PAGE_MAPPED LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL LC_FILEMAP_POPULATE LC_D_ADD_UNIQUE +LC_XATTR_ACL ]) # diff --git a/lustre/include/linux/lustre_mds.h b/lustre/include/linux/lustre_mds.h index 449b63f..6c58556 100644 --- a/lustre/include/linux/lustre_mds.h +++ b/lustre/include/linux/lustre_mds.h @@ -18,10 +18,10 @@ # include # include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) -#include -#else +#ifdef HAVE_XATTR_ACL #include +#else +#include #endif #endif diff --git a/lustre/include/lustre_mds.h b/lustre/include/lustre_mds.h index d91274b..85da7a4 100644 --- a/lustre/include/lustre_mds.h +++ b/lustre/include/lustre_mds.h @@ -88,12 +88,12 @@ struct mds_file_data { /* ACL */ #ifdef CONFIG_FS_POSIX_ACL -# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) -# define MDS_XATTR_NAME_ACL_ACCESS POSIX_ACL_XATTR_ACCESS -# define mds_xattr_acl_size(entry) posix_acl_xattr_size(entry) -# else +#ifdef HAVE_XATTR_ACL # define MDS_XATTR_NAME_ACL_ACCESS XATTR_NAME_ACL_ACCESS # define mds_xattr_acl_size(entry) xattr_acl_size(entry) +# else +# define MDS_XATTR_NAME_ACL_ACCESS POSIX_ACL_XATTR_ACCESS +# define mds_xattr_acl_size(entry) posix_acl_xattr_size(entry) # endif # define LUSTRE_POSIX_ACL_MAX_ENTRIES (32) # define LUSTRE_POSIX_ACL_MAX_SIZE \ diff --git a/lustre/mds/mds_lib.c b/lustre/mds/mds_lib.c index 5d6145b..a0f0a7a 100644 --- a/lustre/mds/mds_lib.c +++ b/lustre/mds/mds_lib.c @@ -115,11 +115,8 @@ static int mds_setattr_unpack(struct ptlrpc_request *req, int offset, LTIME_S(attr->ia_atime) = rec->sa_atime; LTIME_S(attr->ia_mtime) = rec->sa_mtime; LTIME_S(attr->ia_ctime) = rec->sa_ctime; -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,14)) - attr->ia_attr_flags = rec->sa_attr_flags; -#else - #warning "fix it later for fc5" -#endif + r->ur_flags = rec->sa_attr_flags; + LASSERT_REQSWAB (req, offset + 1); if (lustre_msg_bufcount(req->rq_reqmsg) > offset + 1) { r->ur_eadata = lustre_msg_buf(req->rq_reqmsg, offset + 1, 0); diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index c35d15b..8b4b3c9 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -572,13 +572,8 @@ static int mds_reint_setattr(struct mds_update_record *rec, int offset, GOTO(cleanup, rc); if (rec->ur_iattr.ia_valid & ATTR_ATTR_FLAG) { /* ioctl */ - -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,14)) rc = fsfilt_iocontrol(obd, inode, NULL, EXT3_IOC_SETFLAGS, - (long)&rec->ur_iattr.ia_attr_flags); -#else - #warning "fix it later for fc5" -#endif + (long)&rec->ur_flags); } else if (rec->ur_iattr.ia_valid) { /* setattr */ rc = fsfilt_setattr(obd, de, handle, &rec->ur_iattr, 0); /* journal chown/chgrp in llog, just like unlink */