revert the previous
This commit is contained in:
parent
34bf41c699
commit
862a433dd4
|
@ -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 <sys/cdefs.h>
|
||||
__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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue