diff options
author | phk <phk@FreeBSD.org> | 2002-09-20 12:52:03 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-09-20 12:52:03 +0000 |
commit | 1919170e9039df45d87abbe1d7b256cc0db1ed19 (patch) | |
tree | 1d367b627ceceea40420446ef7bb5ef0ae17c419 /sys/kern/subr_disklabel.c | |
parent | b003f2381fcadb1c640d68a8885d0a806a0e8d9c (diff) | |
download | FreeBSD-src-1919170e9039df45d87abbe1d7b256cc0db1ed19.zip FreeBSD-src-1919170e9039df45d87abbe1d7b256cc0db1ed19.tar.gz |
Make FreeBSD "struct disklabel" agnostic, step 311 of 723:
Rename diskerr() to disk_err() for naming consistency.
Drop the by now entirely useless struct disklabel argument.
Add a flag argument for new-line termination.
Fix a couple of printf-format-casts to %j instead of %l.
Correctly print the name of all bio commands.
Move the function from subr_disklabel.c to subr_disk.c,
and from <sys/disklabel.h> to <sys/disk.h>.
Use the new disk_err() throughout, #include <sys/disk.h> as needed.
Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs.
Remove unused disklabel members of softc for aac, amr and mlx, which seem
to originally have been intended for diskerr() use, but which only rotted
and got Copy&Pasted at least two times to many.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/kern/subr_disklabel.c')
-rw-r--r-- | sys/kern/subr_disklabel.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c index e10bc61..a650e3a 100644 --- a/sys/kern/subr_disklabel.c +++ b/sys/kern/subr_disklabel.c @@ -367,60 +367,3 @@ done: brelse(bp); return (error); } - -/* - * Disk error is the preface to plaintive error messages - * about failing disk transfers. It prints messages of the form - -hp0g: hard error reading fsbn 12345 of 12344-12347 (hp0 bn %d cn %d tn %d sn %d) - - * if the offset of the error in the transfer and a disk label - * are both available. blkdone should be -1 if the position of the error - * is unknown; the disklabel pointer may be null from drivers that have not - * been converted to use them. The message is printed with printf. - * The message should be completed with at least a newline. There is no - * trailing space. - */ -void -diskerr(bp, what, blkdone, lp) - struct bio *bp; - char *what; - int blkdone; - register struct disklabel *lp; -{ - int part = dkpart(bp->bio_dev); - char partname[2]; - char *sname; - daddr_t sn; - - *partname = '\0'; - sname = bp->bio_dev->si_name; - printf("%s%s: %s %sing fsbn ", sname, partname, what, - bp->bio_cmd == BIO_READ ? "read" : "writ"); - sn = bp->bio_blkno; - if (bp->bio_bcount <= DEV_BSIZE) - printf("%jd", (intmax_t)sn); - else { - if (blkdone >= 0) { - sn += blkdone; - printf("%jd of ", (intmax_t)sn); - } - printf("%ld-%ld", (long)bp->bio_blkno, - (long)(bp->bio_blkno + (bp->bio_bcount - 1) / DEV_BSIZE)); - } - if (lp && (blkdone >= 0 || bp->bio_bcount <= lp->d_secsize)) { - sn += lp->d_partitions[part].p_offset; - /* - * XXX should add slice offset and not print the slice, - * but we don't know the slice pointer. - * XXX should print bp->b_pblkno so that this will work - * independent of slices, labels and bad sector remapping, - * but some drivers don't set bp->b_pblkno. - */ - printf(" (%s bn %jd; cn %jd", sname, (intmax_t)sn, - (intmax_t)(sn / lp->d_secpercyl)); - sn %= lp->d_secpercyl; - printf(" tn %ld sn %ld)", (long)(sn / lp->d_nsectors), - (long)(sn % lp->d_nsectors)); - } -} |