diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-01-31 05:10:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-01-31 05:10:39 +0000 |
commit | 8191a478609aef85867d64f7aad2ec09de4a39e7 (patch) | |
tree | 7cf1ac197a639d58aee6651c7434f925460ae46a /sys/arch | |
parent | aa1c60b9560460dca264952bc6a9ce95ec22d813 (diff) |
from ragge; rip i386 code
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/vax/vax/disksubr.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index f59565a52dc..99be68c5613 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.6 1995/05/08 19:10:53 ragge Exp $ */ +/* $NetBSD: disksubr.c,v 1.7 1996/01/28 12:14:48 ragge Exp $ */ /* * Copyright (c) 1982, 1986, 1988 Regents of the University of California. @@ -50,23 +50,22 @@ #define b_cylin b_resid -#define RAW_PART 3 - /* * Determine the size of the transfer, and make sure it is * within the boundaries of the partition. Adjust transfer * if needed, and signal errors or early completion. */ int -bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel) +bounds_check_with_label(bp, lp, wlabel) + struct buf *bp; + struct disklabel *lp; + int wlabel; { struct partition *p = lp->d_partitions + dkpart(bp->b_dev); - int labelsect = lp->d_partitions[0].p_offset; + int labelsect = lp->d_partitions[2].p_offset; int maxsz = p->p_size, sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; - /* overwriting disk label ? */ - /* XXX should also protect bootstrap in first 8K */ if (bp->b_blkno + p->p_offset <= LABELSECTOR + labelsect && #if LABELSECTOR != 0 bp->b_blkno + p->p_offset + sz > LABELSECTOR + labelsect && @@ -76,15 +75,6 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel) goto bad; } -#if defined(DOSBBSECTOR) && defined(notyet) - /* overwriting master boot record? */ - if (bp->b_blkno + p->p_offset <= DOSBBSECTOR && - (bp->b_flags & B_READ) == 0 && wlabel == 0) { - bp->b_error = EROFS; - goto bad; - } -#endif - /* beyond partition? */ if (bp->b_blkno < 0 || bp->b_blkno + sz > maxsz) { /* if exactly at end of disk, return an EOF */ @@ -110,13 +100,6 @@ bad: return(-1); } -/* NYFIL */ - -/* encoding of disk minor numbers, should be elsewhere... */ -#define dkunit(dev) (minor(dev) >> 3) -#define dkpart(dev) (minor(dev) & 7) -#define dkminor(unit, part) (((unit) << 3) | (part)) - /* * Check new disk label for sensibility * before setting it. |