Date: Tue, 31 Mar 2009 18:58:00 GMT From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 160067 for review Message-ID: <200903311858.n2VIw0lg050364@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=160067 Change 160067 by trasz@trasz_victim7 on 2009/03/31 18:57:14 Reduce ugliness by removing re#definitions. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/common/acl/acl_common.c#3 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/common/acl/acl_common.h#3 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/acl_compat.c#6 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#17 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h#3 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/sys/acl_impl.h#2 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/common/acl/acl_common.c#3 (text+ko) ==== @@ -424,6 +424,8 @@ #endif } +#if !defined(_KERNEL) + acl_t * acl_alloc(enum acl_type type) { @@ -1725,3 +1727,4 @@ return (error); #endif } +#endif /* _KERNEL */ ==== //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/common/acl/acl_common.h#3 (text+ko) ==== @@ -46,6 +46,7 @@ extern int ace_trivial_common(void *, int, uint64_t (*walk)(void *, uint64_t, int aclcnt, uint16_t *, uint16_t *, uint32_t *mask)); +#if !defined(_KERNEL) extern acl_t *acl_alloc(acl_type_t); extern void acl_free(acl_t *aclp); extern int acl_translate(acl_t *aclp, int target_flavor, @@ -53,6 +54,7 @@ void ksort(caddr_t v, int n, int s, int (*f)()); int cmp2acls(void *a, void *b); +#endif /* _KERNEL */ #ifdef __cplusplus } ==== //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/acl_compat.c#6 (text+ko) ==== @@ -25,23 +25,12 @@ * */ -#define acl_t _zfs_acl_t -#define acl_type_t _zfs_acl_type_t - -/* XXX: Somewhere in these includes must be bzero(9). */ #include <sys/param.h> #include <sys/systm.h> -#include <sys/stat.h> -#include <sys/mount.h> -#include <sys/vnode.h> -#include <sys/types.h> -#include <sys/event.h> -#include <sys/extattr.h> /* XXX: Most of these isn't needed either. */ #include <sys/types.h> #include <sys/time.h> -#include <sys/systm.h> #include <sys/sysmacros.h> #include <sys/resource.h> #include <sys/vfs.h> @@ -78,9 +67,6 @@ #include <sys/sf_buf.h> #include <sys/sched.h> -#undef acl_t -#undef acl_type_t - /* * Pull FreeBSD sys/acl.h, not the ZFS one. */ ==== //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#17 (text+ko) ==== @@ -25,9 +25,6 @@ /* Portions Copyright 2007 Jeremy Teo */ -#define acl_t _zfs_acl_t -#define acl_type_t _zfs_acl_type_t - #include <sys/types.h> #include <sys/param.h> #include <sys/time.h> @@ -70,9 +67,6 @@ #include <sys/sf_buf.h> #include <sys/sched.h> -#undef acl_t -#undef acl_type_t - /* * Pull FreeBSD sys/acl.h, not the ZFS one. */ ==== //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h#3 (text+ko) ==== @@ -31,6 +31,14 @@ #include <sys/types.h> #include <sys/acl_impl.h> +/* + * When compiling OpenSolaris code, this file is getting included instead + * of FreeBSD one. Pull the original sys/acl.h as well. + */ +#undef _SYS_ACL_H +#include "../../../../../../sys/acl.h" +#define _SYS_ACL_H + #ifdef __cplusplus extern "C" { #endif @@ -49,7 +57,9 @@ uint16_t a_type; /* allow or deny */ } ace_t; +#if !defined(_KERNEL) typedef struct acl_info acl_t; +#endif /* * The following are Defined types for an aclent_t. ==== //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/sys/acl_impl.h#2 (text+ko) ==== @@ -44,10 +44,10 @@ typedef enum acl_type { ACLENT_T = 0, ACE_T = 1 -} acl_type_t; +} zfs_acl_type_t; struct acl_info { - acl_type_t acl_type; /* style of acl */ + zfs_acl_type_t acl_type; /* style of acl */ int acl_cnt; /* number of acl entries */ int acl_entry_size; /* sizeof acl entry */ int acl_flags; /* special flags about acl */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903311858.n2VIw0lg050364>