-/* $OpenBSD: disksubr.c,v 1.9 1997/04/05 21:56:04 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.10 1997/04/06 06:04:29 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
struct disklabel *lp;
int wlabel;
{
+#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
- int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
+ int labelsector = blockpersec(lp->d_partitions[RAW_PART].p_offset, lp) +
+ LABELSECTOR;
int sz = howmany(bp->b_bcount, DEV_BSIZE);
-#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
-
if (bp->b_blkno + sz > blockpersec(p->p_size, lp)) {
sz = blockpersec(p->p_size, lp) - bp->b_blkno;
if (sz == 0) {
-/* $OpenBSD: disksubr.c,v 1.18 1997/04/05 21:56:02 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.19 1997/04/06 06:04:26 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
struct disklabel *lp;
int wlabel;
{
+#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
- int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
+ int labelsector = blockpersec(lp->d_partitions[RAW_PART].p_offset, lp) +
+ LABELSECTOR;
int sz = howmany(bp->b_bcount, DEV_BSIZE);
-#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
-
if (bp->b_blkno + sz > blockpersec(p->p_size, lp)) {
sz = blockpersec(p->p_size, lp) - bp->b_blkno;
if (sz == 0) {