From f61a7ce9e1c7edb2c6547b80d27d093a9c8ae7a6 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Jun 2010 16:43:01 -0700 Subject: [PATCH] Add fix-kstat-xuio topic branch Move xiou stat structures from a header to the dmu.c source as is done with all the other kstat interfaces. This information is local to dmu.c registered the xuio kstat and should stay that way. --- .topdeps | 1 + .topmsg | 8 ++++++++ module/zfs/dmu.c | 25 +++++++++++++++++++++++++ module/zfs/include/sys/dmu.h | 1 + module/zfs/include/sys/dmu_impl.h | 26 -------------------------- 5 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 .topdeps create mode 100644 .topmsg diff --git a/.topdeps b/.topdeps new file mode 100644 index 0000000000..1f7391f92b --- /dev/null +++ b/.topdeps @@ -0,0 +1 @@ +master diff --git a/.topmsg b/.topmsg new file mode 100644 index 0000000000..b10884cb95 --- /dev/null +++ b/.topmsg @@ -0,0 +1,8 @@ +From: Brian Behlendorf +Subject: [PATCH] fix kstat xuio + +Move xiou stat structures from a header to the dmu.c source as is +done with all the other kstat interfaces. This information is local +to dmu.c registered the xuio kstat and should stay that way. + +Signed-off-by: Brian Behlendorf diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 5b87c81c63..7ea00cf997 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -765,6 +765,31 @@ dmu_prealloc(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, */ kstat_t *xuio_ksp = NULL; +typedef struct xuio_stats { + /* loaned yet not returned arc_buf */ + kstat_named_t xuiostat_onloan_rbuf; + kstat_named_t xuiostat_onloan_wbuf; + /* whether a copy is made when loaning out a read buffer */ + kstat_named_t xuiostat_rbuf_copied; + kstat_named_t xuiostat_rbuf_nocopy; + /* whether a copy is made when assigning a write buffer */ + kstat_named_t xuiostat_wbuf_copied; + kstat_named_t xuiostat_wbuf_nocopy; +} xuio_stats_t; + +static xuio_stats_t xuio_stats = { + { "onloan_read_buf", KSTAT_DATA_UINT64 }, + { "onloan_write_buf", KSTAT_DATA_UINT64 }, + { "read_buf_copied", KSTAT_DATA_UINT64 }, + { "read_buf_nocopy", KSTAT_DATA_UINT64 }, + { "write_buf_copied", KSTAT_DATA_UINT64 }, + { "write_buf_nocopy", KSTAT_DATA_UINT64 } +}; + +#define XUIOSTAT_INCR(stat, val) \ + atomic_add_64(&xuio_stats.stat.value.ui64, (val)) +#define XUIOSTAT_BUMP(stat) XUIOSTAT_INCR(stat, 1) + int dmu_xuio_init(xuio_t *xuio, int nblk) { diff --git a/module/zfs/include/sys/dmu.h b/module/zfs/include/sys/dmu.h index 83932f467a..496321aacb 100644 --- a/module/zfs/include/sys/dmu.h +++ b/module/zfs/include/sys/dmu.h @@ -40,6 +40,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/module/zfs/include/sys/dmu_impl.h b/module/zfs/include/sys/dmu_impl.h index 22f9f5f8c8..0b8748df10 100644 --- a/module/zfs/include/sys/dmu_impl.h +++ b/module/zfs/include/sys/dmu_impl.h @@ -239,32 +239,6 @@ typedef struct dmu_xuio { iovec_t *iovp; } dmu_xuio_t; -typedef struct xuio_stats { - /* loaned yet not returned arc_buf */ - kstat_named_t xuiostat_onloan_rbuf; - kstat_named_t xuiostat_onloan_wbuf; - /* whether a copy is made when loaning out a read buffer */ - kstat_named_t xuiostat_rbuf_copied; - kstat_named_t xuiostat_rbuf_nocopy; - /* whether a copy is made when assigning a write buffer */ - kstat_named_t xuiostat_wbuf_copied; - kstat_named_t xuiostat_wbuf_nocopy; -} xuio_stats_t; - -static xuio_stats_t xuio_stats = { - { "onloan_read_buf", KSTAT_DATA_UINT64 }, - { "onloan_write_buf", KSTAT_DATA_UINT64 }, - { "read_buf_copied", KSTAT_DATA_UINT64 }, - { "read_buf_nocopy", KSTAT_DATA_UINT64 }, - { "write_buf_copied", KSTAT_DATA_UINT64 }, - { "write_buf_nocopy", KSTAT_DATA_UINT64 } -}; - -#define XUIOSTAT_INCR(stat, val) \ - atomic_add_64(&xuio_stats.stat.value.ui64, (val)) -#define XUIOSTAT_BUMP(stat) XUIOSTAT_INCR(stat, 1) - - #ifdef __cplusplus } #endif