Module Name: src Committed By: martin Date: Sat Mar 21 15:18:58 UTC 2020
Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]: vdev_disk.c src/sys/dev [netbsd-9]: cgd.c src/sys/dev/ata [netbsd-9]: wd.c wdvar.h src/sys/dev/dkwedge [netbsd-9]: dk.c src/sys/kern [netbsd-9]: subr_disk_open.c src/sys/sys [netbsd-9]: disk.h dkio.h Log Message: Pull up following revision(s) (requested by riastradh in ticket #788): sys/sys/dkio.h: revision 1.26 sys/dev/dkwedge/dk.c: revision 1.100 sys/sys/disk.h: revision 1.75 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.14 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.15 sys/dev/cgd.c: revision 1.121 sys/dev/ata/wdvar.h: revision 1.50 sys/kern/subr_disk_open.c: revision 1.15 sys/dev/ata/wd.c: revision 1.459 New ioctl DIOCGSECTORALIGN returns sector alignment parameters. struct disk_sectoralign { /* First aligned sector number. */ uint32_t dsa_firstaligned; /* Number of sectors per aligned unit. */ uint32_t dsa_alignment; }; - Teach wd(4) to get it from ATA. - Teach cgd(4) to pass it through from the underlying disk. - Teach dk(4) to pass it through with adjustments. - Teach zpool (zfs) to take advantage of it. => XXX zpool doesn't seem to understand when the vdev's starting sector is misaligned. Missing: - ccd(4) and raidframe(4) support -- these should support _using_ DIOCGSECTORALIGN to decide where to start putting ccd or raid stripes on disk, and these should perhaps _implement_ DIOCGSECTORALIGN by reporting the stripe/interleave factor. - sd(4) support -- I don't know any obvious way to get it from SCSI, but if any SCSI wizards know better than I, please feel free to teach sd(4) about it! - any ld(4) attachments -- might be worth teaching the ld drivers for nvme and various raid controllers to get the aligned sector size There's some duplicate logic here for now. I'm doing it this way, rather than gathering the logic into a new disklabel_sectoralign function or something, so that this change is limited to adding a new ioctl, without any new kernel symbols, in order to make it easy to pull up to netbsd-9 without worrying about the module ABI. Make getdiskinfo() compatible with a DIOCGWEDGEINFO. dkw_parent is defined to hold the disk name as used by disk_find(), not a partition (i.e. no partition letter appended). Use utility functions to handle disk geometry. To generate a diff of this commit: cvs rdiff -u -r1.11.2.2 -r1.11.2.3 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c cvs rdiff -u -r1.116 -r1.116.10.1 src/sys/dev/cgd.c cvs rdiff -u -r1.452 -r1.452.2.1 src/sys/dev/ata/wd.c cvs rdiff -u -r1.49 -r1.49.4.1 src/sys/dev/ata/wdvar.h cvs rdiff -u -r1.97 -r1.97.8.1 src/sys/dev/dkwedge/dk.c cvs rdiff -u -r1.14 -r1.14.4.1 src/sys/kern/subr_disk_open.c cvs rdiff -u -r1.74 -r1.74.2.1 src/sys/sys/disk.h cvs rdiff -u -r1.25 -r1.25.4.1 src/sys/sys/dkio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.