diff options
author | cao <[email protected]> | 2016-10-21 02:24:01 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-10-20 11:24:01 -0700 |
commit | 5a6765cf8cad21d22dc172b4089b655c9270d16a (patch) | |
tree | 4f520258b4180d1ab3a30e8f0701e13b019eea82 /module/zfs/zfs_vnops.c | |
parent | 1f72394443f710a0be11232b557b8a698693668d (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/zfs_vnops.c')
-rw-r--r-- | module/zfs/zfs_vnops.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 116bb2730..8ac14df00 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -596,14 +596,16 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) arc_buf_t *abuf; const iovec_t *aiov = NULL; xuio_t *xuio = NULL; - int i_iov = 0; - const iovec_t *iovp = uio->uio_iov; int write_eof; int count = 0; sa_bulk_attr_t bulk[4]; uint64_t mtime[2], ctime[2]; uint32_t uid; +#ifdef HAVE_UIO_ZEROCOPY + int i_iov = 0; + const iovec_t *iovp = uio->uio_iov; ASSERTV(int iovcnt = uio->uio_iovcnt); +#endif /* * Fasttrack empty write @@ -726,6 +728,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) } if (xuio && abuf == NULL) { +#ifdef HAVE_UIO_ZEROCOPY ASSERT(i_iov < iovcnt); ASSERT3U(uio->uio_segflg, !=, UIO_BVEC); aiov = &iovp[i_iov]; @@ -735,6 +738,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) ((char *)aiov->iov_base - (char *)abuf->b_data + aiov->iov_len == arc_buf_size(abuf))); i_iov++; +#endif } else if (abuf == NULL && n >= max_blksz && woff >= zp->z_size && P2PHASE(woff, max_blksz) == 0 && |