summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorNed Bass <[email protected]>2014-12-12 18:07:39 -0800
committerBrian Behlendorf <[email protected]>2015-01-06 16:53:24 -0800
commit49ee64e5e6ec7240bc63d96064f2feeb8f84ed9d (patch)
treeafba44d079cb1f7006bb4232781d9795bb986ec3 /module
parent74328ee18f94d27f9c802d29fdd311018dab2adf (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #2953
Diffstat (limited to 'module')
-rw-r--r--module/zfs/arc.c6
-rw-r--r--module/zfs/dbuf.c1
-rw-r--r--module/zfs/dmu_tx.c1
-rw-r--r--module/zfs/dnode.c1
-rw-r--r--module/zfs/dsl_pool.c1
-rw-r--r--module/zfs/trace.c8
-rw-r--r--module/zfs/txg.c1
-rw-r--r--module/zfs/zfs_acl.c1
-rw-r--r--module/zfs/zil.c1
-rw-r--r--module/zfs/zrlock.c1
10 files changed, 17 insertions, 5 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 5b90d9a9f..48b8942d2 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -147,6 +147,7 @@
#include <sys/dmu_tx.h>
#include <zfs_fletcher.h>
#include <sys/arc_impl.h>
+#include <sys/trace_arc.h>
#ifndef _KERNEL
/* set with ZFS_DEBUG=watch, to enable watchpoints on frozen buffers */
@@ -625,11 +626,6 @@ typedef struct l2arc_read_callback {
enum zio_compress l2rcb_compress; /* applied compress */
} l2arc_read_callback_t;
-typedef struct l2arc_write_callback {
- l2arc_dev_t *l2wcb_dev; /* device info */
- arc_buf_hdr_t *l2wcb_head; /* head of write buflist */
-} l2arc_write_callback_t;
-
struct l2arc_buf_hdr {
/* protected by arc_buf_hdr mutex */
l2arc_dev_t *b_dev; /* L2ARC device */
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
index b2a105efb..3484527da 100644
--- a/module/zfs/dbuf.c
+++ b/module/zfs/dbuf.c
@@ -43,6 +43,7 @@
#include <sys/zfeature.h>
#include <sys/blkptr.h>
#include <sys/range_tree.h>
+#include <sys/trace_dbuf.h>
struct dbuf_hold_impl_data {
/* Function arguments */
diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c
index 4f2fae2fc..ae39aebaa 100644
--- a/module/zfs/dmu_tx.c
+++ b/module/zfs/dmu_tx.c
@@ -38,6 +38,7 @@
#include <sys/sa_impl.h>
#include <sys/zfs_context.h>
#include <sys/varargs.h>
+#include <sys/trace_dmu.h>
typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn,
uint64_t arg1, uint64_t arg2);
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
index 20fce9a2d..0a87aa9b1 100644
--- a/module/zfs/dnode.c
+++ b/module/zfs/dnode.c
@@ -36,6 +36,7 @@
#include <sys/zio.h>
#include <sys/dmu_zfetch.h>
#include <sys/range_tree.h>
+#include <sys/trace_dnode.h>
static kmem_cache_t *dnode_cache;
/*
diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c
index aa2f743b1..100d04532 100644
--- a/module/zfs/dsl_pool.c
+++ b/module/zfs/dsl_pool.c
@@ -45,6 +45,7 @@
#include <sys/zfeature.h>
#include <sys/zil_impl.h>
#include <sys/dsl_userhold.h>
+#include <sys/trace_txg.h>
/*
* ZFS Write Throttle
diff --git a/module/zfs/trace.c b/module/zfs/trace.c
index 54ca2b2b4..470cf18bf 100644
--- a/module/zfs/trace.c
+++ b/module/zfs/trace.c
@@ -37,3 +37,11 @@
#define CREATE_TRACE_POINTS
#include <sys/trace.h>
+#include <sys/trace_acl.h>
+#include <sys/trace_arc.h>
+#include <sys/trace_dbuf.h>
+#include <sys/trace_dmu.h>
+#include <sys/trace_dnode.h>
+#include <sys/trace_txg.h>
+#include <sys/trace_zil.h>
+#include <sys/trace_zrlock.h>
diff --git a/module/zfs/txg.c b/module/zfs/txg.c
index a10261846..4693762b8 100644
--- a/module/zfs/txg.c
+++ b/module/zfs/txg.c
@@ -32,6 +32,7 @@
#include <sys/dsl_pool.h>
#include <sys/dsl_scan.h>
#include <sys/callb.h>
+#include <sys/trace_txg.h>
/*
* ZFS Transaction Groups
diff --git a/module/zfs/zfs_acl.c b/module/zfs/zfs_acl.c
index f3eb6c3dd..7357bfa5c 100644
--- a/module/zfs/zfs_acl.c
+++ b/module/zfs/zfs_acl.c
@@ -52,6 +52,7 @@
#include <sys/dnode.h>
#include <sys/zap.h>
#include <sys/sa.h>
+#include <sys/trace_acl.h>
#include "fs/fs_subr.h"
#define ALLOW ACE_ACCESS_ALLOWED_ACE_TYPE
diff --git a/module/zfs/zil.c b/module/zfs/zil.c
index d515a9524..6ee6c9868 100644
--- a/module/zfs/zil.c
+++ b/module/zfs/zil.c
@@ -39,6 +39,7 @@
#include <sys/dmu_tx.h>
#include <sys/dsl_pool.h>
#include <sys/metaslab.h>
+#include <sys/trace_zil.h>
/*
* The zfs intent log (ZIL) saves transaction records of system calls
diff --git a/module/zfs/zrlock.c b/module/zfs/zrlock.c
index 84123f988..144e72eb4 100644
--- a/module/zfs/zrlock.c
+++ b/module/zfs/zrlock.c
@@ -37,6 +37,7 @@
* function calls.
*/
#include <sys/zrlock.h>
+#include <sys/trace_zrlock.h>
/*
* A ZRL can be locked only while there are zero references, so ZRL_LOCKED is