Fix kstat xuio
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Aug 2010 17:26:05 +0000 (10:26 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 Aug 2010 15:38:45 +0000 (08:38 -0700)
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 <behlendorf1@llnl.gov>
module/zfs/dmu.c
module/zfs/include/sys/dmu.h
module/zfs/include/sys/dmu_impl.h

index 732742f..7f17c73 100644 (file)
@@ -831,6 +831,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)
 {
index 4580170..ad41276 100644 (file)
@@ -40,6 +40,7 @@
 #include <sys/param.h>
 #include <sys/cred.h>
 #include <sys/time.h>
+#include <sys/uio.h>
 
 #ifdef __cplusplus
 extern "C" {
index 22f9f5f..0b8748d 100644 (file)
@@ -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