]> git.proxmox.com Git - mirror_zfs.git/commit
Remove duplicate typedefs from trace.h
authorNed Bass <bass6@llnl.gov>
Sat, 13 Dec 2014 02:07:39 +0000 (18:07 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 7 Jan 2015 00:53:24 +0000 (16:53 -0800)
commit49ee64e5e6ec7240bc63d96064f2feeb8f84ed9d
treeafba44d079cb1f7006bb4232781d9795bb986ec3
parent74328ee18f94d27f9c802d29fdd311018dab2adf
Remove duplicate typedefs from trace.h

Older versions of GCC (e.g. GCC 4.4.7 on RHEL6) do not allow duplicate
typedef declarations with the same type. The trace.h header contains
some typedefs to avoid 'unknown type' errors for C files that haven't
declared the type in question. But this causes build failures for C
files that have already declared the type. Newer versions of GCC (e.g.
v4.6) allow duplicate typedefs with the same type unless pedantic error
checking is in force. To support the older versions we need to remove
the duplicate typedefs.

Removal of the typedefs means we can't built tracepoints code using
those types unless the required headers have been included. To
facilitate this, all tracepoint event declarations have been moved out
of trace.h into separate headers. Each new header is explicitly included
from the C file that uses the events defined therein. The trace.h header
is still indirectly included form zfs_context.h and provides the
implementation of the dprintf(), dbgmsg(), and SET_ERROR() interfaces.
This makes those interfaces readily available throughout the code base.
The macros that redefine DTRACE_PROBE* to use Linux tracepoints are also
still provided by trace.h, so it is a prerequisite for the other
trace_*.h headers.

These new Linux implementation-specific headers do introduce a small
divergence from upstream ZFS in several core C files, but this should
not present a significant maintenance burden.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2953
22 files changed:
include/sys/Makefile.am
include/sys/arc_impl.h
include/sys/trace.h
include/sys/trace_acl.h [new file with mode: 0644]
include/sys/trace_arc.h [new file with mode: 0644]
include/sys/trace_dbgmsg.h [new file with mode: 0644]
include/sys/trace_dbuf.h [new file with mode: 0644]
include/sys/trace_dmu.h [new file with mode: 0644]
include/sys/trace_dnode.h [new file with mode: 0644]
include/sys/trace_txg.h [new file with mode: 0644]
include/sys/trace_zil.h [new file with mode: 0644]
include/sys/trace_zrlock.h [new file with mode: 0644]
module/zfs/arc.c
module/zfs/dbuf.c
module/zfs/dmu_tx.c
module/zfs/dnode.c
module/zfs/dsl_pool.c
module/zfs/trace.c
module/zfs/txg.c
module/zfs/zfs_acl.c
module/zfs/zil.c
module/zfs/zrlock.c