diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-09-20 17:51:00 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-09-20 17:51:00 +0000 |
| commit | 6fb3d70418f6085121f617a1662d4d98cbf660d2 (patch) | |
| tree | dbeca777ba2b4bd9cb736990b6598d6cd54fcfc6 /sys/alpha | |
| parent | 2e45c1b191f0c363c6805cac8316596fe0c333e0 (diff) | |
Notes
Diffstat (limited to 'sys/alpha')
| -rw-r--r-- | sys/alpha/alpha/machdep.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index 276fd3c44ade6..db64fd3cf1deb 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -1917,66 +1917,6 @@ Debugger(const char *msg) } #endif /* no DDB */ -#include <sys/disklabel.h> - -/* - * 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 bio *bp, struct disklabel *lp, int wlabel) -{ - struct partition *p = lp->d_partitions + dkpart(bp->bio_dev); - int labelsect = lp->d_partitions[0].p_offset; - int maxsz = p->p_size, - sz = (bp->bio_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; - - /* overwriting disk label ? */ - /* XXX should also protect bootstrap in first 8K */ - if (bp->bio_blkno + p->p_offset <= LABELSECTOR + labelsect && -#if LABELSECTOR != 0 - bp->bio_blkno + p->p_offset + sz > LABELSECTOR + labelsect && -#endif - (bp->bio_cmd == BIO_WRITE) && wlabel == 0) { - bp->bio_error = EROFS; - goto bad; - } - -#if defined(DOSBBSECTOR) && defined(notyet) - /* overwriting master boot record? */ - if (bp->bio_blkno + p->p_offset <= DOSBBSECTOR && - (bp->bio_cmd == BIO_WRITE) && wlabel == 0) { - bp->bio_error = EROFS; - goto bad; - } -#endif - - /* beyond partition? */ - if (bp->bio_blkno < 0 || bp->bio_blkno + sz > maxsz) { - /* if exactly at end of disk, return an EOF */ - if (bp->bio_blkno == maxsz) { - bp->bio_resid = bp->bio_bcount; - return(0); - } - /* or truncate if part of it fits */ - sz = maxsz - bp->bio_blkno; - if (sz <= 0) { - bp->bio_error = EINVAL; - goto bad; - } - bp->bio_bcount = sz << DEV_BSHIFT; - } - - bp->bio_pblkno = bp->bio_blkno + p->p_offset; - return(1); - -bad: - bp->bio_flags |= BIO_ERROR; - return(-1); - -} - static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS) { |
