diff options
Diffstat (limited to 'sys/arch/mvme68k')
-rw-r--r-- | sys/arch/mvme68k/mvme68k/disksubr.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c index 13ceb97c242..2b08aaa0e83 100644 --- a/sys/arch/mvme68k/mvme68k/disksubr.c +++ b/sys/arch/mvme68k/mvme68k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.39 2007/05/29 06:28:15 otto Exp $ */ +/* $OpenBSD: disksubr.c,v 1.40 2007/05/31 19:57:43 krw Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -295,11 +295,8 @@ writedisklabel(dev, strat, lp, clp) int -bounds_check_with_label(bp, lp, osdep, wlabel) - struct buf *bp; - struct disklabel *lp; - struct cpu_disklabel *osdep; - int wlabel; +bounds_check_with_label(struct buf *bp, struct disklabel *lp, + struct cpu_disklabel *osdep, int wlabel) { #define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE)) struct partition *p = lp->d_partitions + DISKPART(bp->b_dev); @@ -328,26 +325,27 @@ bounds_check_with_label(bp, lp, osdep, wlabel) if (bp->b_blkno + sz > blockpersec(p->p_size, lp)) { sz = blockpersec(p->p_size, lp) - bp->b_blkno; if (sz == 0) { - /* if exactly at end of disk, return an EOF */ + /* If exactly at end of disk, return EOF. */ bp->b_resid = bp->b_bcount; return(0); } if (sz <= 0) { + /* If past end of disk, return EINVAL. */ bp->b_error = EINVAL; goto bad; } - /* or truncate if part of it fits */ + /* Otherwise, truncate request. */ bp->b_bcount = sz << DEV_BSHIFT; } /* calculate cylinder for disksort to order transfers with */ bp->b_cylinder = (bp->b_blkno + blockpersec(p->p_offset, lp)) / lp->d_secpercyl; - return(1); + return (1); bad: bp->b_flags |= B_ERROR; - return(-1); + return (-1); } |