From f712bb7cf583f4db120abaf977690d8bca88d876 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 5 Dec 2008 11:23:54 -0800 Subject: [PATCH 1/4] Refresh linux-symbol-collisions --- .topdeps | 4 +--- .topmsg | 17 ++--------------- zfs/lib/libzpool/include/sys/dmu_impl.h | 3 +++ 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.topdeps b/.topdeps index 607c231780..7f16cbcdd5 100644 --- a/.topdeps +++ b/.topdeps @@ -1,3 +1 @@ -gcc-branch -fix-branch -feature-branch +zfs-branch diff --git a/.topmsg b/.topmsg index e9722e1075..1d212679f5 100644 --- a/.topmsg +++ b/.topmsg @@ -1,19 +1,6 @@ From: Brian Behlendorf -Subject: [PATCH] zfs branch +Subject: [PATCH] linux symbol collisions -Merged result of all changes which are relevant to both Solaris -and Linux builds of the ZFS code. These are changes where there -is a reasonable chance they will be accepted upstream. - -Additionally, since this is effectively the root of the linux -ZFS tree the core linux build system is added here. This -includes autogen.sh, configure.ac, m4 macros, some scripts/*, -and makefiles for all the core ZFS components. Linux-only -features which require tweaks to the build system should appear -on the relevant topic branches. All autotools products which -result from autogen.sh are commited to the linux-configure-branch. - -This branch also contains the META, ChangeLog, AUTHORS, -README, and GIT files. +Resolve Linux symbol collisions Signed-off-by: Brian Behlendorf diff --git a/zfs/lib/libzpool/include/sys/dmu_impl.h b/zfs/lib/libzpool/include/sys/dmu_impl.h index f32ab6ad71..cf167ac9ff 100644 --- a/zfs/lib/libzpool/include/sys/dmu_impl.h +++ b/zfs/lib/libzpool/include/sys/dmu_impl.h @@ -234,8 +234,11 @@ struct dmu_pool; #define DMU_CALLBACK_MAGIC 0xca11bac0ca11bacfull +/* container_of() already defined in linux kernel */ +#ifndef container_of #define container_of(ptr, type, member) \ ((type *)((char *)(ptr) - offsetof(type, member))) +#endif typedef struct dmu_callback { list_node_t dcb_node; /* linked to tx_callbacks list */ From 579f6e603f05dd155d59eb00a113c5a4808d9cb5 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 15 Dec 2008 09:29:26 -0800 Subject: [PATCH 2/4] Remove incorrect mapping from verify to assert. We should be using the more correct version in lib/libzpool/include/sys/zfs_context.h which will not optimize out the actual call in the assert based on NDEBUG --- lib/libzfs/include/libzfs.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/libzfs/include/libzfs.h b/lib/libzfs/include/libzfs.h index c650865f30..7bbb2c200e 100644 --- a/lib/libzfs/include/libzfs.h +++ b/lib/libzfs/include/libzfs.h @@ -521,15 +521,6 @@ extern int zfs_iscsi_perm_check(libzfs_handle_t *, char *, ucred_t *); extern int zfs_deleg_share_nfs(libzfs_handle_t *, char *, char *, void *, void *, int, zfs_share_op_t); -/* - * When dealing with nvlists, verify() is extremely useful - */ -#ifdef NDEBUG -#define verify(EX) ((void)(EX)) -#else -#define verify(EX) assert(EX) -#endif - /* * Utility function to convert a number to a human-readable form. */ From b62b556896736121a68100a7458575e0391a3e16 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 16 Dec 2008 10:11:41 -0800 Subject: [PATCH 3/4] Moving unused hunk to unused patch --- lib/libzfs/include/libzfs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libzfs/include/libzfs.h b/lib/libzfs/include/libzfs.h index 7bbb2c200e..c650865f30 100644 --- a/lib/libzfs/include/libzfs.h +++ b/lib/libzfs/include/libzfs.h @@ -521,6 +521,15 @@ extern int zfs_iscsi_perm_check(libzfs_handle_t *, char *, ucred_t *); extern int zfs_deleg_share_nfs(libzfs_handle_t *, char *, char *, void *, void *, int, zfs_share_op_t); +/* + * When dealing with nvlists, verify() is extremely useful + */ +#ifdef NDEBUG +#define verify(EX) ((void)(EX)) +#else +#define verify(EX) assert(EX) +#endif + /* * Utility function to convert a number to a human-readable form. */ From 1a50fc54809ac750131664115fa8127e6cceec5e Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 17 Dec 2008 12:40:17 -0800 Subject: [PATCH 4/4] Resolve collision --- module/zfs/include/sys/zfs_znode.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/zfs/include/sys/zfs_znode.h b/module/zfs/include/sys/zfs_znode.h index db40968fa2..6c4563a21f 100644 --- a/module/zfs/include/sys/zfs_znode.h +++ b/module/zfs/include/sys/zfs_znode.h @@ -114,9 +114,12 @@ extern "C" { /* * Convert mode bits (zp_mode) to BSD-style DT_* values for storing in - * the directory entries. + * the directory entries. On Linux systems this value is already + * defined correctly as part of the /usr/include/dirent.h header file. */ +#ifndef IFTODT #define IFTODT(mode) (((mode) & S_IFMT) >> 12) +#endif /* * The directory entry has the type (currently unused on Solaris) in the