diff options
author | bde <bde@FreeBSD.org> | 1995-02-16 14:47:38 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-02-16 14:47:38 +0000 |
commit | 8abfaf1d18588e52a635ffe04eaa7235584d88df (patch) | |
tree | 915b514ee4b32dd01df99c5d3e545dc6049a7852 /sys/ufs | |
parent | fa2d46eb479eb13da59aff18ed314b810c753625 (diff) | |
download | FreeBSD-src-8abfaf1d18588e52a635ffe04eaa7235584d88df.zip FreeBSD-src-8abfaf1d18588e52a635ffe04eaa7235584d88df.tar.gz |
Adjust slice names in diskerr() for the rearranged slice numbers. The
mapping from numbers to names is messy for backwards compatibility.
E.g., for driver "sd", unit "0":
slice 0: omit the slice number for compatibility; names are sd0[a-h].
slice 1: omit the partition letter 'c' because the whole disk device
shouldn't have anything to do with partitions; sd0 is the
only name.
slices 2-31: subtract 1 from slice number to compensate for the
compatibility slice 0; names are sd0s[1-30][a-h].
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_disksubr.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c index d5e699e..82ade54 100644 --- a/sys/ufs/ufs/ufs_disksubr.c +++ b/sys/ufs/ufs/ufs_disksubr.c @@ -42,7 +42,7 @@ * SUCH DAMAGE. * * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 - * $Id: ufs_disksubr.c,v 1.7 1994/12/16 16:31:23 bde Exp $ + * $Id: ufs_disksubr.c,v 1.8 1994/12/22 04:42:31 bde Exp $ */ #include <sys/param.h> @@ -620,7 +620,7 @@ diskerr(bp, dname, what, pri, blkdone, lp) int slice = dkslice(bp->b_dev); int part = dkpart(bp->b_dev); register void (*pr) __P((const char *, ...)); - char partname = 'a' + part; + char partname[2]; char slicename[32]; int sn; @@ -629,15 +629,15 @@ diskerr(bp, dname, what, pri, blkdone, lp) pr = addlog; } else pr = printf; - slicename[0] = '\0'; - if (slice != WHOLE_DISK_SLICE) - sprintf(slicename, "s%d", slice); - (*pr)("%s%d%s", dname, unit, slicename); -#ifndef PRE_DISKSLICE_COMPAT - if (slice != WHOLE_DISK_SLICE) -#endif - (*pr)("%c", partname); - (*pr)(": %s %sing fsbn ", what, bp->b_flags & B_READ ? "read" : "writ"); + slicename[0] = partname[0] = '\0'; + if (slice != WHOLE_DISK_SLICE || part != RAW_PART) { + partname[0] = 'a' + part; + partname[1] = '\0'; + if (slice != COMPATIBILITY_SLICE) + sprintf(slicename, "s%d", slice - 1); + } + (*pr)("%s%d%s%s: %s %sing fsbn ", dname, unit, slicename, partname, + what, bp->b_flags & B_READ ? "read" : "writ"); sn = bp->b_blkno; if (bp->b_bcount <= DEV_BSIZE) (*pr)("%d", sn); |