diff options
author | phk <phk@FreeBSD.org> | 2002-09-20 19:36:05 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-09-20 19:36:05 +0000 |
commit | 57a346a21312d7f99ca28aee15ab6091be10cbd7 (patch) | |
tree | 47b5afae3623c1371d19a0478c850d8e6a08d07b /sys/dev/pst | |
parent | 2fb7a39c0fdc17568c3b60cf37e5f3c2d6dff5e4 (diff) | |
download | FreeBSD-src-57a346a21312d7f99ca28aee15ab6091be10cbd7.zip FreeBSD-src-57a346a21312d7f99ca28aee15ab6091be10cbd7.tar.gz |
(This commit touches about 15 disk device drivers in a very consistent
and predictable way, and I apologize if I have gotten it wrong anywhere,
getting prior review on a patch like this is not feasible, considering
the number of people involved and hardware availability etc.)
If struct disklabel is the messenger: kill the messenger.
Inside struct disk we had a struct disklabel which disk drivers used to
communicate certain metrics to the disklayer above (GEOM or the disk
mini-layer). This commit changes this communication to use four
explicit fields instead.
Amongst the benefits is that the fields do not get overwritten by
wrong or bogus on-disk disklabels.
Once that is clear, <sys/disk.h> which is included in the drivers
no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in,
the few places that needs them, have gotten explicit #includes for
them.
The disklabel inside struct disk is now only for internal use in
the disk mini-layer, so instead of embedding it, we malloc it as
we need it.
This concludes (modulus any mistakes) the series of disklabel related
commits.
I belive it all amounts to a NOP for all the rest of you :-)
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/dev/pst')
-rw-r--r-- | sys/dev/pst/pst-raid.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/pst/pst-raid.c b/sys/dev/pst/pst-raid.c index 2382576..db120b0 100644 --- a/sys/dev/pst/pst-raid.c +++ b/sys/dev/pst/pst-raid.c @@ -172,15 +172,10 @@ pst_attach(device_t dev) psc->device->si_drv1 = psc; psc->device->si_iosize_max = 64 * 1024; /*I2O_SGL_MAX_SEGS * PAGE_SIZE;*/ - bzero(&psc->disk.d_label, sizeof(struct disklabel)); - psc->disk.d_label.d_secsize = psc->info->block_size; - psc->disk.d_label.d_nsectors = 63; - psc->disk.d_label.d_ntracks = 255; - psc->disk.d_label.d_ncylinders = - (psc->info->capacity / psc->info->block_size) / (255 * 63); - psc->disk.d_label.d_secpercyl = 255 * 63; - psc->disk.d_label.d_secperunit = - psc->info->capacity / psc->info->block_size; + psc->disk.d_sectorsize = psc->info->block_size; + psc->disk.d_mediasize = psc->info->capacity; + psc->disk.d_fssectors = 63; + psc->disk.d_fsheads = 255; devstat_add_entry(&psc->stats, "pst", lun, psc->info->block_size, DEVSTAT_NO_ORDERED_TAGS, |