diff options
author | phk <phk@FreeBSD.org> | 1999-08-28 14:33:44 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-08-28 14:33:44 +0000 |
commit | 9c72381e09a5593df856423c995563779f7535e8 (patch) | |
tree | 3471f1e5faa7dd2bf47573f428c3a46114bac456 | |
parent | a261857e2d7ff67439a916b9f0b8db5e91302af0 (diff) | |
download | FreeBSD-src-9c72381e09a5593df856423c995563779f7535e8.zip FreeBSD-src-9c72381e09a5593df856423c995563779f7535e8.tar.gz |
We don't need to pass the diskname argument all over the diskslice/label
code, we can find the name from any convenient dev_t
-rw-r--r-- | sys/alpha/alpha/diskslice_machdep.c | 28 | ||||
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 4 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_cd.c | 4 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 4 | ||||
-rw-r--r-- | sys/contrib/dev/fla/fla.c | 4 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 4 | ||||
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 4 | ||||
-rw-r--r-- | sys/dev/ida/ida_disk.c | 4 | ||||
-rw-r--r-- | sys/dev/vn/vn.c | 6 | ||||
-rw-r--r-- | sys/i386/i386/autoconf.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/diskslice_machdep.c | 28 | ||||
-rw-r--r-- | sys/i386/isa/wd.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/wfd.c | 4 | ||||
-rw-r--r-- | sys/kern/subr_disklabel.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_diskmbr.c | 28 | ||||
-rw-r--r-- | sys/kern/subr_diskslice.c | 62 | ||||
-rw-r--r-- | sys/pc98/pc98/atcompat_diskslice.c | 10 | ||||
-rw-r--r-- | sys/pc98/pc98/diskslice_machdep.c | 16 | ||||
-rw-r--r-- | sys/pc98/pc98/wd.c | 4 | ||||
-rw-r--r-- | sys/pc98/pc98/wfd.c | 4 | ||||
-rw-r--r-- | sys/sys/diskslice.h | 8 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_disksubr.c | 2 |
22 files changed, 114 insertions, 124 deletions
diff --git a/sys/alpha/alpha/diskslice_machdep.c b/sys/alpha/alpha/diskslice_machdep.c index bd72d02..391eb61 100644 --- a/sys/alpha/alpha/diskslice_machdep.c +++ b/sys/alpha/alpha/diskslice_machdep.c @@ -65,7 +65,7 @@ static struct dos_partition historical_bogus_partition_table[NDOSPART] = { static int check_part __P((char *sname, struct dos_partition *dp, u_long offset, int nsectors, int ntracks, u_long mbr_offset)); -static void extended __P((char *dname, dev_t dev, struct disklabel *lp, +static void mbr_extended __P((dev_t dev, struct disklabel *lp, struct diskslices *ssp, u_long ext_offset, u_long ext_size, u_long base_ext_offset, int nsectors, int ntracks, u_long mbr_offset)); @@ -151,8 +151,7 @@ check_part(sname, dp, offset, nsectors, ntracks, mbr_offset ) } int -dsinit(dname, dev, lp, sspp) - char *dname; +dsinit(dev, lp, sspp) dev_t dev; struct disklabel *lp; struct diskslices **sspp; @@ -184,7 +183,8 @@ reread_mbr: bp->b_flags |= B_READ; BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { - diskerr(bp, dname, "error reading primary partition table", + diskerr(bp, devtoname(bp->b_dev), + "error reading primary partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); error = EIO; @@ -193,7 +193,7 @@ reread_mbr: /* Weakly verify it. */ cp = bp->b_data; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { if (bootverbose) @@ -271,7 +271,7 @@ reread_mbr: if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0 && dp->dp_start == 0 && dp->dp_size == 0) continue; - sname = dsname(dname, dkunit(dev), BASE_SLICE + dospart, + sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); /* @@ -334,7 +334,7 @@ reread_mbr: for (dospart = 0; dospart < NDOSPART; dospart++, sp++) if (sp->ds_type == DOSPTYP_EXTENDED || sp->ds_type == DOSPTYP_EXTENDEDX) - extended(dname, bp->b_dev, lp, ssp, + mbr_extended(bp->b_dev, lp, ssp, sp->ds_offset, sp->ds_size, sp->ds_offset, max_nsectors, max_ntracks, mbr_offset); @@ -347,9 +347,8 @@ done: } void -extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, +mbr_extended(dev, lp, ssp, ext_offset, ext_size, base_ext_offset, nsectors, ntracks, mbr_offset) - char *dname; dev_t dev; struct disklabel *lp; struct diskslices *ssp; @@ -381,7 +380,8 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, bp->b_flags |= B_READ; BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { - diskerr(bp, dname, "error reading extended partition table", + diskerr(bp, devtoname(bp->b_dev), + "error reading extended partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); goto done; @@ -390,7 +390,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* Weakly verify it. */ cp = bp->b_data; if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (bootverbose) printf("%s: invalid extended partition table: no magic\n", @@ -416,7 +416,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, dp->dp_typ == DOSPTYP_EXTENDEDX) { char buf[32]; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); snprintf(buf, sizeof(buf), "%s", sname); if (strlen(buf) < sizeof buf - 11) @@ -426,7 +426,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, ext_offsets[dospart] = base_ext_offset + dp->dp_start; ext_sizes[dospart] = dp->dp_size; } else { - sname = dsname(dname, dkunit(dev), slice, RAW_PART, + sname = dsname(dev, dkunit(dev), slice, RAW_PART, partname); check_part(sname, dp, ext_offset, nsectors, ntracks, mbr_offset); @@ -447,7 +447,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* If we found any more slices, recursively find all the subslices. */ for (dospart = 0; dospart < NDOSPART; dospart++) if (ext_sizes[dospart] != 0) - extended(dname, dev, lp, ssp, + mbr_extended(dev, lp, ssp, ext_offsets[dospart], ext_sizes[dospart], base_ext_offset, nsectors, ntracks, mbr_offset); diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index f678609..630bd05 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -418,7 +418,7 @@ setroot() newrootdev = makebdev(majdev, mindev); rootdevs[0] = newrootdev; - sname = dsname(devsw(newrootdev)->d_name, unit, slice, part, partname); + sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[0] = malloc(strlen(sname) + 2, M_DEVBUF, M_NOWAIT); sprintf(rootdevnames[0], "%s%s", sname, partname); @@ -435,7 +435,7 @@ setroot() return; slice = COMPATIBILITY_SLICE; rootdevs[1] = dkmodslice(newrootdev, slice); - sname = dsname(devsw(newrootdev)->d_name, unit, slice, part, partname); + sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[1] = malloc(strlen(sname) + 2, M_DEVBUF, M_NOWAIT); sprintf(rootdevnames[1], "%s%s", sname, partname); } diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index a6d4ac8..5e9d1d2 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -956,7 +956,7 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p) label.d_partitions[0].p_fstype = FS_OTHER; /* Initialize slice tables. */ - error = dsopen("cd", dev, fmt, DSO_NOLABELS | DSO_ONESLICE, + error = dsopen(dev, fmt, DSO_NOLABELS | DSO_ONESLICE, &softc->cd_slices, &label); if (error == 0) { @@ -2452,7 +2452,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) * Check to see whether we've got a disk-type ioctl. If we * don't, dsioctl will pass back an error code of ENOIOCTL. */ - error = dsioctl("cd", dev, cmd, addr, flag, &softc->cd_slices); + error = dsioctl(dev, cmd, addr, flag, &softc->cd_slices); if (error != ENOIOCTL) break; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index bcd752d..aa2ff80 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -380,7 +380,7 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p) } /* Initialize slice tables. */ - error = dsopen("da", dev, fmt, 0, &softc->dk_slices, &label); + error = dsopen(dev, fmt, 0, &softc->dk_slices, &label); /* * Check to see whether or not the blocksize is set yet. @@ -599,7 +599,7 @@ daioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) return (error); /* error code from tsleep */ } - error = dsioctl("da", dev, cmd, addr, flag, &softc->dk_slices); + error = dsioctl(dev, cmd, addr, flag, &softc->dk_slices); if (error == ENOIOCTL) error = cam_periph_ioctl(periph, cmd, addr, daerror); diff --git a/sys/contrib/dev/fla/fla.c b/sys/contrib/dev/fla/fla.c index 3f3aaa0..b6439dd 100644 --- a/sys/contrib/dev/fla/fla.c +++ b/sys/contrib/dev/fla/fla.c @@ -146,7 +146,7 @@ flaopen(dev_t dev, int flag, int fmt, struct proc *p) dk_dd.d_secsize = DEV_BSIZE; dk_dd.d_secpercyl = dk_dd.d_ntracks * dk_dd.d_nsectors; - error = dsopen("fla", dev, fmt, 0, &sc->dk_slices, &dk_dd); + error = dsopen(dev, fmt, 0, &sc->dk_slices, &dk_dd); if (error) return (error); return (0); @@ -178,7 +178,7 @@ flaioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) dev2udev(dev), cmd, addr, flags, p); unit = dkunit(dev); sc = &softc[unit]; - error = dsioctl("fla", dev, cmd, addr, flags, &sc->dk_slices); + error = dsioctl(dev, cmd, addr, flags, &sc->dk_slices); if (error == ENOIOCTL) error = ENOTTY; return (error); diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index d8196a4..ba28db5 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -302,7 +302,7 @@ printf("adopen: lun=%d adnlun=%d\n", lun, adnlun); label.d_secpercyl = adp->sectors * adp->heads; label.d_secperunit = adp->total_secs; - error = dsopen("ad", dev, fmt, 0, &adp->slices, &label); + error = dsopen(dev, fmt, 0, &adp->slices, &label); adp->flags &= ~AD_F_LABELLING; ad_sleep(adp, "adop2"); @@ -336,7 +336,7 @@ adioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flags, struct proc *p) return ENXIO; ad_sleep(adp, "adioct"); - error = dsioctl("sd", dev, cmd, addr, flags, &adp->slices); + error = dsioctl(dev, cmd, addr, flags, &adp->slices); if (error != ENOIOCTL) return error; diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 5a2fd18..7191f79 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -235,7 +235,7 @@ afdopen(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) label.d_secperunit = fdp->cap.heads * fdp->cap.sectors * fdp->cap.cylinders; /* initialize slice tables. */ - return dsopen("afd", dev, fmt, 0, &fdp->slices, &label); + return dsopen(dev, fmt, 0, &fdp->slices, &label); } static int @@ -263,7 +263,7 @@ afdioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) if (lun >= afdnlun || !(fdp = afdtab[lun])) return ENXIO; - error = dsioctl("sd", dev, cmd, addr, flag, &fdp->slices); + error = dsioctl(dev, cmd, addr, flag, &fdp->slices); if (error != ENOIOCTL) return error; diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c index 24be38b..2874d25 100644 --- a/sys/dev/ida/ida_disk.c +++ b/sys/dev/ida/ida_disk.c @@ -144,7 +144,7 @@ idopen(dev_t dev, int flags, int fmt, struct proc *p) label.d_secperunit = drv->secperunit; /* Initialize slice tables. */ - error = dsopen("id", dev, fmt, 0, &drv->slices, &label); + error = dsopen(dev, fmt, 0, &drv->slices, &label); return (error); } @@ -171,7 +171,7 @@ idioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) if (drv == NULL) return (ENXIO); - error = dsioctl("id", dev, cmd, addr, flag, &drv->slices); + error = dsioctl(dev, cmd, addr, flag, &drv->slices); if (error == ENOIOCTL) return (ENOTTY); diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index 979e617..f51efca 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -237,8 +237,7 @@ vnopen(dev_t dev, int flags, int mode, struct proc *p) label.d_secperunit = vn->sc_size; label.d_partitions[RAW_PART].p_size = vn->sc_size; - return (dsopen("vn", dev, mode, 0, &vn->sc_slices, - &label)); + return (dsopen(dev, mode, 0, &vn->sc_slices, &label)); } if (dkslice(dev) != WHOLE_DISK_SLICE || dkpart(dev) != RAW_PART || @@ -393,8 +392,7 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) IFOPT(vn,VN_LABELS) { if (vn->sc_slices != NULL) { - error = dsioctl("vn", dev, cmd, data, flag, - &vn->sc_slices); + error = dsioctl(dev, cmd, data, flag, &vn->sc_slices); if (error != ENOIOCTL) return (error); } diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index f678609..630bd05 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -418,7 +418,7 @@ setroot() newrootdev = makebdev(majdev, mindev); rootdevs[0] = newrootdev; - sname = dsname(devsw(newrootdev)->d_name, unit, slice, part, partname); + sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[0] = malloc(strlen(sname) + 2, M_DEVBUF, M_NOWAIT); sprintf(rootdevnames[0], "%s%s", sname, partname); @@ -435,7 +435,7 @@ setroot() return; slice = COMPATIBILITY_SLICE; rootdevs[1] = dkmodslice(newrootdev, slice); - sname = dsname(devsw(newrootdev)->d_name, unit, slice, part, partname); + sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[1] = malloc(strlen(sname) + 2, M_DEVBUF, M_NOWAIT); sprintf(rootdevnames[1], "%s%s", sname, partname); } diff --git a/sys/i386/isa/diskslice_machdep.c b/sys/i386/isa/diskslice_machdep.c index 3425379..6d05806 100644 --- a/sys/i386/isa/diskslice_machdep.c +++ b/sys/i386/isa/diskslice_machdep.c @@ -64,7 +64,7 @@ static struct dos_partition historical_bogus_partition_table[NDOSPART] = { static int check_part __P((char *sname, struct dos_partition *dp, u_long offset, int nsectors, int ntracks, u_long mbr_offset)); -static void extended __P((char *dname, dev_t dev, struct disklabel *lp, +static void mbr_extended __P((dev_t dev, struct disklabel *lp, struct diskslices *ssp, u_long ext_offset, u_long ext_size, u_long base_ext_offset, int nsectors, int ntracks, u_long mbr_offset)); @@ -150,8 +150,7 @@ check_part(sname, dp, offset, nsectors, ntracks, mbr_offset ) } int -dsinit(dname, dev, lp, sspp) - char *dname; +dsinit(dev, lp, sspp) dev_t dev; struct disklabel *lp; struct diskslices **sspp; @@ -182,7 +181,8 @@ reread_mbr: bp->b_flags |= B_READ; BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { - diskerr(bp, dname, "error reading primary partition table", + diskerr(bp, devtoname(bp->b_dev), + "error reading primary partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); error = EIO; @@ -191,7 +191,7 @@ reread_mbr: /* Weakly verify it. */ cp = bp->b_data; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { if (bootverbose) @@ -263,7 +263,7 @@ reread_mbr: if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0 && dp->dp_start == 0 && dp->dp_size == 0) continue; - sname = dsname(dname, dkunit(dev), BASE_SLICE + dospart, + sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); /* @@ -326,7 +326,7 @@ reread_mbr: for (dospart = 0; dospart < NDOSPART; dospart++, sp++) if (sp->ds_type == DOSPTYP_EXTENDED || sp->ds_type == DOSPTYP_EXTENDEDX) - extended(dname, bp->b_dev, lp, ssp, + mbr_extended(bp->b_dev, lp, ssp, sp->ds_offset, sp->ds_size, sp->ds_offset, max_nsectors, max_ntracks, mbr_offset); @@ -339,9 +339,8 @@ done: } void -extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, +mbr_extended(dev, lp, ssp, ext_offset, ext_size, base_ext_offset, nsectors, ntracks, mbr_offset) - char *dname; dev_t dev; struct disklabel *lp; struct diskslices *ssp; @@ -371,7 +370,8 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, bp->b_flags |= B_READ; BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { - diskerr(bp, dname, "error reading extended partition table", + diskerr(bp, devtoname(bp->b_dev), + "error reading extended partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); goto done; @@ -380,7 +380,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* Weakly verify it. */ cp = bp->b_data; if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (bootverbose) printf("%s: invalid extended partition table: no magic\n", @@ -400,7 +400,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, dp->dp_typ == DOSPTYP_EXTENDEDX) { char buf[32]; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); snprintf(buf, sizeof(buf), "%s", sname); if (strlen(buf) < sizeof buf - 11) @@ -410,7 +410,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, ext_offsets[dospart] = base_ext_offset + dp->dp_start; ext_sizes[dospart] = dp->dp_size; } else { - sname = dsname(dname, dkunit(dev), slice, RAW_PART, + sname = dsname(dev, dkunit(dev), slice, RAW_PART, partname); check_part(sname, dp, ext_offset, nsectors, ntracks, mbr_offset); @@ -431,7 +431,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* If we found any more slices, recursively find all the subslices. */ for (dospart = 0; dospart < NDOSPART; dospart++) if (ext_sizes[dospart] != 0) - extended(dname, dev, lp, ssp, ext_offsets[dospart], + mbr_extended(dev, lp, ssp, ext_offsets[dospart], ext_sizes[dospart], base_ext_offset, nsectors, ntracks, mbr_offset); diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index 9725183..dae6c05 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -1233,7 +1233,7 @@ wdopen(dev_t dev, int flags, int fmt, struct proc *p) label.d_ncylinders = du->dk_dd.d_ncylinders; label.d_secpercyl = du->dk_dd.d_secpercyl; label.d_secperunit = du->dk_dd.d_secperunit; - error = dsopen("wd", dev, fmt, 0, &du->dk_slices, &label); + error = dsopen(dev, fmt, 0, &du->dk_slices, &label); } du->dk_flags &= ~DKFL_LABELLING; wdsleep(du->dk_ctrlr, "wdopn2"); @@ -1878,7 +1878,7 @@ wdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) du = wddrives[lunit]; wdsleep(du->dk_ctrlr, "wdioct"); - error = dsioctl("wd", dev, cmd, addr, flags, &du->dk_slices); + error = dsioctl(dev, cmd, addr, flags, &du->dk_slices); if (error != ENOIOCTL) return (error); switch (cmd) { diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c index f7837d7..3a169ac 100644 --- a/sys/i386/isa/wfd.c +++ b/sys/i386/isa/wfd.c @@ -374,7 +374,7 @@ int wfdopen (dev_t dev, int flags, int fmt, struct proc *p) label.d_secperunit = label.d_secpercyl * t->cap.cyls; /* Initialize slice tables. */ - errcode = dsopen("wfd", dev, fmt, 0, &t->dk_slices, &label); + errcode = dsopen(dev, fmt, 0, &t->dk_slices, &label); if (errcode != 0) return errcode; @@ -627,7 +627,7 @@ int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) struct wfd *t = wfdtab[lun]; int error = 0; - error = dsioctl("wfd", dev, cmd, addr, flag, &t->dk_slices); + error = dsioctl(dev, cmd, addr, flag, &t->dk_slices); if (error != ENOIOCTL) return (error); diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c index a52efbd..e3a734c 100644 --- a/sys/kern/subr_disklabel.c +++ b/sys/kern/subr_disklabel.c @@ -373,7 +373,7 @@ diskerr(bp, dname, what, pri, blkdone, lp) pr = addlog; } else pr = printf; - sname = dsname(dname, unit, slice, part, partname); + sname = dsname(bp->b_dev, unit, slice, part, partname); (*pr)("%s%s: %s %sing fsbn ", sname, partname, what, bp->b_flags & B_READ ? "read" : "writ"); sn = bp->b_blkno; diff --git a/sys/kern/subr_diskmbr.c b/sys/kern/subr_diskmbr.c index 3425379..6d05806 100644 --- a/sys/kern/subr_diskmbr.c +++ b/sys/kern/subr_diskmbr.c @@ -64,7 +64,7 @@ static struct dos_partition historical_bogus_partition_table[NDOSPART] = { static int check_part __P((char *sname, struct dos_partition *dp, u_long offset, int nsectors, int ntracks, u_long mbr_offset)); -static void extended __P((char *dname, dev_t dev, struct disklabel *lp, +static void mbr_extended __P((dev_t dev, struct disklabel *lp, struct diskslices *ssp, u_long ext_offset, u_long ext_size, u_long base_ext_offset, int nsectors, int ntracks, u_long mbr_offset)); @@ -150,8 +150,7 @@ check_part(sname, dp, offset, nsectors, ntracks, mbr_offset ) } int -dsinit(dname, dev, lp, sspp) - char *dname; +dsinit(dev, lp, sspp) dev_t dev; struct disklabel *lp; struct diskslices **sspp; @@ -182,7 +181,8 @@ reread_mbr: bp->b_flags |= B_READ; BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { - diskerr(bp, dname, "error reading primary partition table", + diskerr(bp, devtoname(bp->b_dev), + "error reading primary partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); error = EIO; @@ -191,7 +191,7 @@ reread_mbr: /* Weakly verify it. */ cp = bp->b_data; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { if (bootverbose) @@ -263,7 +263,7 @@ reread_mbr: if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0 && dp->dp_start == 0 && dp->dp_size == 0) continue; - sname = dsname(dname, dkunit(dev), BASE_SLICE + dospart, + sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); /* @@ -326,7 +326,7 @@ reread_mbr: for (dospart = 0; dospart < NDOSPART; dospart++, sp++) if (sp->ds_type == DOSPTYP_EXTENDED || sp->ds_type == DOSPTYP_EXTENDEDX) - extended(dname, bp->b_dev, lp, ssp, + mbr_extended(bp->b_dev, lp, ssp, sp->ds_offset, sp->ds_size, sp->ds_offset, max_nsectors, max_ntracks, mbr_offset); @@ -339,9 +339,8 @@ done: } void -extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, +mbr_extended(dev, lp, ssp, ext_offset, ext_size, base_ext_offset, nsectors, ntracks, mbr_offset) - char *dname; dev_t dev; struct disklabel *lp; struct diskslices *ssp; @@ -371,7 +370,8 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, bp->b_flags |= B_READ; BUF_STRATEGY(bp, 1); if (biowait(bp) != 0) { - diskerr(bp, dname, "error reading extended partition table", + diskerr(bp, devtoname(bp->b_dev), + "error reading extended partition table", LOG_PRINTF, 0, (struct disklabel *)NULL); printf("\n"); goto done; @@ -380,7 +380,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* Weakly verify it. */ cp = bp->b_data; if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (bootverbose) printf("%s: invalid extended partition table: no magic\n", @@ -400,7 +400,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, dp->dp_typ == DOSPTYP_EXTENDEDX) { char buf[32]; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); snprintf(buf, sizeof(buf), "%s", sname); if (strlen(buf) < sizeof buf - 11) @@ -410,7 +410,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, ext_offsets[dospart] = base_ext_offset + dp->dp_start; ext_sizes[dospart] = dp->dp_size; } else { - sname = dsname(dname, dkunit(dev), slice, RAW_PART, + sname = dsname(dev, dkunit(dev), slice, RAW_PART, partname); check_part(sname, dp, ext_offset, nsectors, ntracks, mbr_offset); @@ -431,7 +431,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* If we found any more slices, recursively find all the subslices. */ for (dospart = 0; dospart < NDOSPART; dospart++) if (ext_sizes[dospart] != 0) - extended(dname, dev, lp, ssp, ext_offsets[dospart], + mbr_extended(dev, lp, ssp, ext_offsets[dospart], ext_sizes[dospart], base_ext_offset, nsectors, ntracks, mbr_offset); diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index 4d154c9..771f285 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -88,12 +88,8 @@ static void set_ds_bad __P((struct diskslices *ssp, int slice, struct dkbad_intern *btp)); static void set_ds_label __P((struct diskslices *ssp, int slice, struct disklabel *lp)); -#ifdef DEVFS -static void set_ds_labeldevs __P((char *dname, dev_t dev, - struct diskslices *ssp)); -static void set_ds_labeldevs_unaliased __P((char *dname, dev_t dev, - struct diskslices *ssp)); -#endif +static void set_ds_labeldevs __P((dev_t dev, struct diskslices *ssp)); +static void set_ds_labeldevs_unaliased __P((dev_t dev, struct diskslices *ssp)); static void set_ds_wlabel __P((struct diskslices *ssp, int slice, int wlabel)); @@ -375,8 +371,7 @@ dsgone(sspp) * is subject to the same restriction as dsopen(). */ int -dsioctl(dname, dev, cmd, data, flags, sspp) - char *dname; +dsioctl(dev, cmd, data, flags, sspp) dev_t dev; u_long cmd; caddr_t data; @@ -476,9 +471,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp) } free_ds_label(ssp, slice); set_ds_label(ssp, slice, lp); -#ifdef DEVFS - set_ds_labeldevs(dname, dev, ssp); -#endif + set_ds_labeldevs(dev, ssp); return (0); case DIOCSYNCSLICEINFO: @@ -502,7 +495,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp) *sspp = NULL; lp = malloc(sizeof *lp, M_DEVBUF, M_WAITOK); *lp = *ssp->dss_slices[WHOLE_DISK_SLICE].ds_label; - error = dsopen(dname, dev, + error = dsopen(dev, ssp->dss_slices[WHOLE_DISK_SLICE].ds_copenmask & (1 << RAW_PART) ? S_IFCHR : S_IFBLK, ssp->dss_oflags, sspp, lp); @@ -522,7 +515,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp) part = 0; openmask; openmask >>= 1, part++) { if (!(openmask & 1)) continue; - error = dsopen(dname, + error = dsopen( dkmodslice(dkmodpart(dev, part), slice), S_IFBLK, ssp->dss_oflags, sspp, @@ -539,7 +532,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp) part = 0; openmask; openmask >>= 1, part++) { if (!(openmask & 1)) continue; - error = dsopen(dname, + error = dsopen( dkmodslice(dkmodpart(dev, part), slice), S_IFCHR, ssp->dss_oflags, sspp, @@ -560,7 +553,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp) return (0); case DIOCWDINFO: - error = dsioctl(dname, dev, DIOCSDINFO, data, flags, &ssp); + error = dsioctl(dev, DIOCSDINFO, data, flags, &ssp); if (error != 0) return (error); /* @@ -660,15 +653,17 @@ dsmakeslicestruct(nslices, lp) } char * -dsname(dname, unit, slice, part, partname) - char *dname; +dsname(dev, unit, slice, part, partname) + dev_t dev; int unit; int slice; int part; char *partname; { static char name[32]; + char *dname; + dname = devsw(dev)->d_name; if (strlen(dname) > 16) dname = "nametoolong"; snprintf(name, sizeof(name), "%s%d", dname, unit); @@ -689,8 +684,7 @@ dsname(dname, unit, slice, part, partname) * strategy routine must be special to allow activity. */ int -dsopen(dname, dev, mode, flags, sspp, lp) - char *dname; +dsopen(dev, mode, flags, sspp, lp) dev_t dev; int mode; u_int flags; @@ -721,7 +715,7 @@ dsopen(dname, dev, mode, flags, sspp, lp) unit = dkunit(dev); if (lp->d_secsize % DEV_BSIZE) { - printf("%s%d: invalid sector size %lu\n", dname, unit, + printf("%s: invalid sector size %lu\n", devtoname(dev), (u_long)lp->d_secsize); return (EINVAL); } @@ -744,7 +738,7 @@ dsopen(dname, dev, mode, flags, sspp, lp) if (!(flags & DSO_ONESLICE)) { TRACE(("dsinit\n")); - error = dsinit(dname, dev, lp, sspp); + error = dsinit(dev, lp, sspp); if (error != 0) { dsgone(sspp); return (error); @@ -793,7 +787,7 @@ dsopen(dname, dev, mode, flags, sspp, lp) ) continue; dev1 = dkmodslice(dkmodpart(dev, RAW_PART), slice); - sname = dsname(dname, unit, slice, RAW_PART, partname); + sname = dsname(dev, unit, slice, RAW_PART, partname); #ifdef DEVFS if (slice != COMPATIBILITY_SLICE && sp->ds_bdev == NULL && sp->ds_size != 0) { @@ -850,9 +844,7 @@ dsopen(dname, dev, mode, flags, sspp, lp) } } set_ds_label(ssp, slice, lp1); -#ifdef DEVFS - set_ds_labeldevs(dname, dev1, ssp); -#endif + set_ds_labeldevs(dev1, ssp); set_ds_wlabel(ssp, slice, FALSE); } @@ -1092,33 +1084,33 @@ set_ds_label(ssp, slice, lp) ssp->dss_slices[COMPATIBILITY_SLICE].ds_label = lp; } -#ifdef DEVFS static void -set_ds_labeldevs(dname, dev, ssp) - char *dname; +set_ds_labeldevs(dev, ssp) dev_t dev; struct diskslices *ssp; { +#ifdef DEVFS int slice; - set_ds_labeldevs_unaliased(dname, dev, ssp); + set_ds_labeldevs_unaliased(dev, ssp); if (ssp->dss_first_bsd_slice == COMPATIBILITY_SLICE) return; slice = dkslice(dev); if (slice == COMPATIBILITY_SLICE) - set_ds_labeldevs_unaliased(dname, + set_ds_labeldevs_unaliased( dkmodslice(dev, ssp->dss_first_bsd_slice), ssp); else if (slice == ssp->dss_first_bsd_slice) - set_ds_labeldevs_unaliased(dname, + set_ds_labeldevs_unaliased( dkmodslice(dev, COMPATIBILITY_SLICE), ssp); +#endif /* DEVFS */ } static void -set_ds_labeldevs_unaliased(dname, dev, ssp) - char *dname; +set_ds_labeldevs_unaliased(dev, ssp) dev_t dev; struct diskslices *ssp; { +#ifdef DEVFS struct disklabel *lp; int mynor; int part; @@ -1137,7 +1129,7 @@ set_ds_labeldevs_unaliased(dname, dev, ssp) pp = &lp->d_partitions[part]; if (pp->p_size == 0) continue; - sname = dsname(dname, dkunit(dev), slice, part, partname); + sname = dsname(dev, dkunit(dev), slice, part, partname); if (part == RAW_PART && sp->ds_bdev != NULL) { sp->ds_bdevs[part] = devfs_makelink(sp->ds_bdev, @@ -1157,8 +1149,8 @@ set_ds_labeldevs_unaliased(dname, dev, ssp) "r%s%s", sname, partname); } } -} #endif /* DEVFS */ +} static void set_ds_wlabel(ssp, slice, wlabel) diff --git a/sys/pc98/pc98/atcompat_diskslice.c b/sys/pc98/pc98/atcompat_diskslice.c index ee18554..2bd03d0 100644 --- a/sys/pc98/pc98/atcompat_diskslice.c +++ b/sys/pc98/pc98/atcompat_diskslice.c @@ -203,7 +203,7 @@ reread_mbr: /* Weakly verify it. */ cp = bp->b_data; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { if (bootverbose) @@ -275,7 +275,7 @@ reread_mbr: if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0 && dp->dp_start == 0 && dp->dp_size == 0) continue; - sname = dsname(dname, dkunit(dev), BASE_SLICE + dospart, + sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); /* @@ -397,7 +397,7 @@ atcompat_extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* Weakly verify it. */ cp = bp->b_data; if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (bootverbose) printf("%s: invalid extended partition table: no magic\n", @@ -417,7 +417,7 @@ atcompat_extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, dp->dp_typ == DOSPTYP_EXTENDEDX) { char buf[32]; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); snprintf(buf, sizeof(buf), "%s", sname); if (strlen(buf) < sizeof buf - 11) @@ -427,7 +427,7 @@ atcompat_extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, ext_offsets[dospart] = base_ext_offset + dp->dp_start; ext_sizes[dospart] = dp->dp_size; } else { - sname = dsname(dname, dkunit(dev), slice, RAW_PART, + sname = dsname(dev, dkunit(dev), slice, RAW_PART, partname); check_part(sname, dp, ext_offset, nsectors, ntracks, mbr_offset); diff --git a/sys/pc98/pc98/diskslice_machdep.c b/sys/pc98/pc98/diskslice_machdep.c index 1bc1e76..12038c0 100644 --- a/sys/pc98/pc98/diskslice_machdep.c +++ b/sys/pc98/pc98/diskslice_machdep.c @@ -257,7 +257,7 @@ reread_mbr: /* Weakly verify it. */ cp = bp->b_data; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { if (bootverbose) @@ -272,7 +272,7 @@ reread_mbr: */ if ((*(cp + 512) == 0x57) && (*(cp + 513) == 0x45) && (*(cp + 514) == 0x56) && (*(cp + 515) == 0x82)) { - sname = dsname(dname, dkunit(dev), BASE_SLICE, + sname = dsname(dev, dkunit(dev), BASE_SLICE, RAW_PART, partname); free(*sspp, M_DEVBUF); ssp = dsmakeslicestruct(MAX_SLICES, lp); @@ -296,7 +296,7 @@ reread_mbr: (*(cp + 0x1c) == 0x0) && ((*(cp + 512) == 0xf0) || (*(cp + 512) == 0xf8)) && (*(cp + 513) == 0xff) && (*(cp + 514) == 0xff)) { - sname = dsname(dname, dkunit(dev), BASE_SLICE, + sname = dsname(dev, dkunit(dev), BASE_SLICE, RAW_PART, partname); free(*sspp, M_DEVBUF); ssp = dsmakeslicestruct(MAX_SLICES, lp); @@ -405,14 +405,14 @@ reread_mbr: for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++) { if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0) continue; - sname = dsname(dname, dkunit(dev), BASE_SLICE + dospart, + sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); #else for (dospart = 0, dp = dp0; dospart < NDOSPART; dospart++, dp++) { if (dp->dp_scyl == 0 && dp->dp_shd == 0 && dp->dp_ssect == 0 && dp->dp_start == 0 && dp->dp_size == 0) continue; - sname = dsname(dname, dkunit(dev), BASE_SLICE + dospart, + sname = dsname(dev, dkunit(dev), BASE_SLICE + dospart, RAW_PART, partname); #endif /* @@ -546,7 +546,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, /* Weakly verify it. */ cp = bp->b_data; if (cp[0x1FE] != 0x55 || cp[0x1FF] != 0xAA) { - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); if (bootverbose) printf("%s: invalid extended partition table: no magic\n", @@ -574,7 +574,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, #endif char buf[32]; - sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE, + sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); snprintf(buf, sizeof(buf), "%s", sname); if (strlen(buf) < sizeof buf - 11) @@ -591,7 +591,7 @@ extended(dname, dev, lp, ssp, ext_offset, ext_size, base_ext_offset, ext_sizes[dospart] = dp->dp_size; #endif } else { - sname = dsname(dname, dkunit(dev), slice, RAW_PART, + sname = dsname(dev, dkunit(dev), slice, RAW_PART, partname); check_part(sname, dp, ext_offset, nsectors, ntracks, mbr_offset); diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index 4f118d0..f651bb6 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -1359,7 +1359,7 @@ wdopen(dev_t dev, int flags, int fmt, struct proc *p) label.d_ncylinders = du->dk_dd.d_ncylinders; label.d_secpercyl = du->dk_dd.d_secpercyl; label.d_secperunit = du->dk_dd.d_secperunit; - error = dsopen("wd", dev, fmt, 0, &du->dk_slices, &label); + error = dsopen(dev, fmt, 0, &du->dk_slices, &label); } du->dk_flags &= ~DKFL_LABELLING; wdsleep(du->dk_ctrlr, "wdopn2"); @@ -2099,7 +2099,7 @@ wdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) du = wddrives[lunit]; wdsleep(du->dk_ctrlr, "wdioct"); - error = dsioctl("wd", dev, cmd, addr, flags, &du->dk_slices); + error = dsioctl(dev, cmd, addr, flags, &du->dk_slices); if (error != ENOIOCTL) return (error); #ifdef PC98 diff --git a/sys/pc98/pc98/wfd.c b/sys/pc98/pc98/wfd.c index f7837d7..3a169ac 100644 --- a/sys/pc98/pc98/wfd.c +++ b/sys/pc98/pc98/wfd.c @@ -374,7 +374,7 @@ int wfdopen (dev_t dev, int flags, int fmt, struct proc *p) label.d_secperunit = label.d_secpercyl * t->cap.cyls; /* Initialize slice tables. */ - errcode = dsopen("wfd", dev, fmt, 0, &t->dk_slices, &label); + errcode = dsopen(dev, fmt, 0, &t->dk_slices, &label); if (errcode != 0) return errcode; @@ -627,7 +627,7 @@ int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) struct wfd *t = wfdtab[lun]; int error = 0; - error = dsioctl("wfd", dev, cmd, addr, flag, &t->dk_slices); + error = dsioctl(dev, cmd, addr, flag, &t->dk_slices); if (error != ENOIOCTL) return (error); diff --git a/sys/sys/diskslice.h b/sys/sys/diskslice.h index 418df7c..ab2253d 100644 --- a/sys/sys/diskslice.h +++ b/sys/sys/diskslice.h @@ -95,15 +95,15 @@ struct disklabel; int dscheck __P((struct buf *bp, struct diskslices *ssp)); void dsclose __P((dev_t dev, int mode, struct diskslices *ssp)); void dsgone __P((struct diskslices **sspp)); -int dsinit __P((char *dname, dev_t dev, struct disklabel *lp, +int dsinit __P((dev_t dev, struct disklabel *lp, struct diskslices **sspp)); -int dsioctl __P((char *dname, dev_t dev, u_long cmd, caddr_t data, +int dsioctl __P((dev_t dev, u_long cmd, caddr_t data, int flags, struct diskslices **sspp)); int dsisopen __P((struct diskslices *ssp)); struct diskslices *dsmakeslicestruct __P((int nslices, struct disklabel *lp)); -char *dsname __P((char *dname, int unit, int slice, int part, +char *dsname __P((dev_t dev, int unit, int slice, int part, char *partname)); -int dsopen __P((char *dname, dev_t dev, int mode, u_int flags, +int dsopen __P((dev_t dev, int mode, u_int flags, struct diskslices **sspp, struct disklabel *lp)); int dssize __P((dev_t dev, struct diskslices **sspp)); diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c index a52efbd..e3a734c 100644 --- a/sys/ufs/ufs/ufs_disksubr.c +++ b/sys/ufs/ufs/ufs_disksubr.c @@ -373,7 +373,7 @@ diskerr(bp, dname, what, pri, blkdone, lp) pr = addlog; } else pr = printf; - sname = dsname(dname, unit, slice, part, partname); + sname = dsname(bp->b_dev, unit, slice, part, partname); (*pr)("%s%s: %s %sing fsbn ", sname, partname, what, bp->b_flags & B_READ ? "read" : "writ"); sn = bp->b_blkno; |