1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

The presence of a on __FreeBSD_version flagged some code that hasn't been in

the right spot since the FreeBSD 3.x days, if not earlier.
This commit is contained in:
Scott Long 2005-08-07 23:51:53 +00:00
parent 5b3e518936
commit 4b910da2ea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148840

View File

@ -111,9 +111,6 @@ static int
amrd_open(struct disk *dp)
{
struct amrd_softc *sc = (struct amrd_softc *)dp->d_drv1;
#if __FreeBSD_version < 500000 /* old buf style */
struct disklabel *label;
#endif
debug_called(1);
@ -124,23 +121,6 @@ amrd_open(struct disk *dp)
if (sc->amrd_controller->amr_state & AMR_STATE_SHUTDOWN)
return(ENXIO);
#if __FreeBSD_version < 500000 /* old buf style */
label = &sc->amrd_disk.d_label;
bzero(label, sizeof(*label));
label->d_type = DTYPE_SCSI;
label->d_secsize = AMR_BLKSIZE;
label->d_nsectors = sc->amrd_drive->al_sectors;
label->d_ntracks = sc->amrd_drive->al_heads;
label->d_ncylinders = sc->amrd_drive->al_cylinders;
label->d_secpercyl = sc->amrd_drive->al_sectors * sc->amrd_drive->al_heads;
label->d_secperunit = sc->amrd_drive->al_size;
#else
sc->amrd_disk->d_sectorsize = AMR_BLKSIZE;
sc->amrd_disk->d_mediasize = (off_t)sc->amrd_drive->al_size * AMR_BLKSIZE;
sc->amrd_disk->d_fwsectors = sc->amrd_drive->al_sectors;
sc->amrd_disk->d_fwheads = sc->amrd_drive->al_heads;
#endif
return (0);
}
/********************************************************************************
@ -257,10 +237,11 @@ amrd_attach(device_t dev)
sc->amrd_disk->d_dump = (dumper_t *)amrd_dump;
sc->amrd_disk->d_unit = sc->amrd_unit;
sc->amrd_disk->d_flags = 0;
sc->amrd_disk->d_sectorsize = AMR_BLKSIZE;
sc->amrd_disk->d_mediasize = (off_t)sc->amrd_drive->al_size * AMR_BLKSIZE;
sc->amrd_disk->d_fwsectors = sc->amrd_drive->al_sectors;
sc->amrd_disk->d_fwheads = sc->amrd_drive->al_heads;
disk_create(sc->amrd_disk, DISK_VERSION);
#ifdef FREEBSD_4
disks_registered++;
#endif
return (0);
}