X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fvdev_file.c;h=ce49fe08fb7126c134e9802e5965d6c060861985;hb=b39d3b9f7be925ba9314c336099f31f508e1d940;hp=f31389a6df0acb0be0ac0ee2e11c133e77a32690;hpb=d4ed667343c3dac114642b9f6cb4f7baa3ff7334;p=zfs.git diff --git a/module/zfs/vdev_file.c b/module/zfs/vdev_file.c index f31389a..ce49fe0 100644 --- a/module/zfs/vdev_file.c +++ b/module/zfs/vdev_file.c @@ -130,7 +130,6 @@ vdev_file_close(vdev_t *vd) (void) VOP_PUTPAGE(vf->vf_vnode, 0, 0, B_INVAL, kcred, NULL); (void) VOP_CLOSE(vf->vf_vnode, spa_mode(vd->vdev_spa), 1, 0, kcred, NULL); - VN_RELE(vf->vf_vnode); } vd->vdev_delayed_close = B_FALSE; @@ -142,16 +141,17 @@ static int vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; - vdev_file_t *vf = vd->vdev_tsd; + vdev_file_t *vf; ssize_t resid = 0; - if (zio->io_type == ZIO_TYPE_IOCTL) { - /* XXPOLICY */ - if (!vdev_readable(vd)) { - zio->io_error = ENXIO; - return (ZIO_PIPELINE_CONTINUE); - } + if (!vdev_readable(vd)) { + zio->io_error = ENXIO; + return (ZIO_PIPELINE_CONTINUE); + } + vf = vd->vdev_tsd; + + if (zio->io_type == ZIO_TYPE_IOCTL) { switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: zio->io_error = VOP_FSYNC(vf->vf_vnode, FSYNC | FDSYNC,