diff options
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r-- | sys/dev/vnd.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 948303ecede..8ac0a7aca04 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnd.c,v 1.159 2016/10/08 05:52:06 guenther Exp $ */ +/* $OpenBSD: vnd.c,v 1.160 2016/11/12 10:59:37 jca Exp $ */ /* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */ /* @@ -305,11 +305,11 @@ vndstrategy(struct buf *bp) bp->b_bcount = ((origbcount + secsize - 1) & ~(secsize - 1)); #ifdef DIAGNOSTIC if (bp->b_bcount != origbcount) { - struct proc *curp = curproc; + struct process *curpr = curproc->p_p; printf("%s: sloppy %s from proc %d (%s): " "blkno %lld bcount %ld\n", sc->sc_dev.dv_xname, (bp->b_flags & B_READ) ? "read" : "write", - curp->p_p->ps_pid, curp->p_comm, + curpr->ps_pid, curpr->ps_comm, (long long)bp->b_blkno, origbcount); } #endif @@ -396,6 +396,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) struct vnd_softc *sc; struct vnd_ioctl *vio; struct vnd_user *vnu; + struct vnd_user60 *vnu60; struct vattr vattr; struct nameidata nd; int error, part, pmask; @@ -544,6 +545,35 @@ vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) disk_unlock(&sc->sc_dk); break; + /* XXX kill after 6.1 */ + case VNDIOCGET60: + vnu60 = (struct vnd_user60 *)addr; + + if (vnu60->vnu60_unit == -1) + vnu60->vnu60_unit = unit; + if (vnu60->vnu60_unit >= numvnd) + return (ENXIO); + if (vnu60->vnu60_unit < 0) + return (EINVAL); + + sc = &vnd_softc[vnu60->vnu60_unit]; + + if (sc->sc_flags & VNF_INITED) { + error = VOP_GETATTR(sc->sc_vp, &vattr, p->p_ucred, p); + if (error) + return (error); + + strlcpy(vnu60->vnu60_file, sc->sc_file, + sizeof(vnu60->vnu60_file)); + vnu60->vnu60_dev = vattr.va_fsid; + vnu60->vnu60_ino = vattr.va_fileid; + } else { + vnu60->vnu60_dev = 0; + vnu60->vnu60_ino = 0; + } + + break; + case VNDIOCGET: vnu = (struct vnd_user *)addr; |