Page MenuHomeFreeBSD

stand: Add dv_devfmt to return a string represenation of the device
ClosedPublic

Authored by imp on Jul 25 2022, 8:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 10:45 AM
Unknown Object (File)
Sat, Nov 16, 8:57 AM
Unknown Object (File)
Fri, Nov 15, 10:44 PM
Unknown Object (File)
Wed, Nov 13, 11:06 PM
Unknown Object (File)
Oct 23 2024, 12:11 PM
Unknown Object (File)
Oct 14 2024, 2:01 PM
Unknown Object (File)
Oct 1 2024, 8:46 PM
Unknown Object (File)
Oct 1 2024, 7:04 PM
Subscribers

Details

Summary

Add a new pointer, dv_devfmt, to allow devices to format themselves. We
will use this to simplify many of the fmtdev functions in the tree as
they are all almost the same, or all are isomorphic to each other.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Jul 25 2022, 8:32 PM
stand/libsa/stand.h
143

Is there more background for this specific size? I mean, we have DEV_NAMLEN + 10 chars in int + colon + NUL... asking because 128 bytes add up in text+data+bss of BIOS loader:)

stand/libsa/stand.h
143

128 was used in a lot of places (see subsequent reviews) so I used that here.
For disk devices, I don't see this ever being > diskXXXXsXXa: (so up to 10k disks, 100 partitions and maybe a bsd label for evilness).
I'm not sure what a good limit is here, but in most loaders, this will just be 128 bytes once in the devformat static buffer.

This revision is now accepted and ready to land.Jul 26 2022, 10:30 AM
This revision now requires review to proceed.Jul 28 2022, 4:57 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 11 2022, 4:28 PM
This revision was automatically updated to reflect the committed changes.