From 862a433dd40eceb9dc328ace94e2b99edb3cebcd Mon Sep 17 00:00:00 2001 From: mlelstv Date: Sat, 22 Aug 2015 07:42:46 +0000 Subject: [PATCH] revert the previous --- sys/dev/dkwedge/dk.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c index 61085ea7182d..def302d73c6a 100644 --- a/sys/dev/dkwedge/dk.c +++ b/sys/dev/dkwedge/dk.c @@ -1,4 +1,4 @@ -/* $NetBSD: dk.c,v 1.80 2015/08/20 23:08:33 mlelstv Exp $ */ +/* $NetBSD: dk.c,v 1.81 2015/08/22 07:42:46 mlelstv Exp $ */ /*- * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.80 2015/08/20 23:08:33 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.81 2015/08/22 07:42:46 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "opt_dkwedge.h" @@ -944,7 +944,7 @@ dkwedge_read(struct disk *pdk, struct vnode *vp, daddr_t blkno, void *tbuf, size_t len) { buf_t *bp; - int error, isopen; + int error; /* * The kernel cannot read from a character device vnode @@ -964,12 +964,6 @@ dkwedge_read(struct disk *pdk, struct vnode *vp, daddr_t blkno, bp->b_cylinder = 0; bp->b_error = 0; - /* - * XXX Only the last user of a block device can close it. - * There is no reference counting in the driver. - */ - isopen = pdk->dk_bopenmask & (1 << DISKPART(bp->b_dev)); - error = bdev_open(bp->b_dev, FREAD, S_IFBLK, curlwp); if (error) return error; @@ -978,8 +972,7 @@ dkwedge_read(struct disk *pdk, struct vnode *vp, daddr_t blkno, error = biowait(bp); putiobuf(bp); - if (!isopen) - bdev_close(bp->b_dev, FREAD, S_IFBLK, curlwp); + bdev_close(bp->b_dev, FREAD, S_IFBLK, curlwp); return error; }