summaryrefslogtreecommitdiffstats
path: root/module/zfs/dmu.c
diff options
context:
space:
mode:
authorcao <[email protected]>2016-10-21 02:24:01 +0800
committerBrian Behlendorf <[email protected]>2016-10-20 11:24:01 -0700
commit5a6765cf8cad21d22dc172b4089b655c9270d16a (patch)
tree4f520258b4180d1ab3a30e8f0701e13b019eea82 /module/zfs/dmu.c
parent1f72394443f710a0be11232b557b8a698693668d (diff)
Fix coverity defects: CID 147472
CID 147472: Type: 'Constant' variable guards dead code Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5288
Diffstat (limited to 'module/zfs/dmu.c')
-rw-r--r--module/zfs/dmu.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index 80185706c..7da49af7b 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -987,6 +987,7 @@ static xuio_stats_t xuio_stats = {
atomic_add_64(&xuio_stats.stat.value.ui64, (val))
#define XUIOSTAT_BUMP(stat) XUIOSTAT_INCR(stat, 1)
+#ifdef HAVE_UIO_ZEROCOPY
int
dmu_xuio_init(xuio_t *xuio, int nblk)
{
@@ -1071,6 +1072,7 @@ dmu_xuio_clear(xuio_t *xuio, int i)
ASSERT(i < priv->cnt);
priv->bufs[i] = NULL;
}
+#endif /* HAVE_UIO_ZEROCOPY */
static void
xuio_stat_init(void)
@@ -1111,7 +1113,9 @@ dmu_read_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size)
{
dmu_buf_t **dbp;
int numbufs, i, err;
+#ifdef HAVE_UIO_ZEROCOPY
xuio_t *xuio = NULL;
+#endif
/*
* NB: we could do this block-at-a-time, but it's nice
@@ -1132,6 +1136,7 @@ dmu_read_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size)
bufoff = uio->uio_loffset - db->db_offset;
tocpy = MIN(db->db_size - bufoff, size);
+#ifdef HAVE_UIO_ZEROCOPY
if (xuio) {
dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db;
arc_buf_t *dbuf_abuf = dbi->db_buf;
@@ -1146,10 +1151,10 @@ dmu_read_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size)
XUIOSTAT_BUMP(xuiostat_rbuf_nocopy);
else
XUIOSTAT_BUMP(xuiostat_rbuf_copied);
- } else {
+ } else
+#endif
err = uiomove((char *)db->db_data + bufoff, tocpy,
UIO_READ, uio);
- }
if (err)
break;