Page MenuHomeFreeBSD

kboot: Rework hostdisk.c to allow easier ZFS support.
ClosedPublic

Authored by imp on Jan 10 2023, 12:20 AM.
Tags
None
Referenced Files
F103990928: D38013.diff
Mon, Dec 2, 2:48 AM
Unknown Object (File)
Sat, Nov 30, 9:47 AM
Unknown Object (File)
Tue, Nov 26, 7:48 AM
Unknown Object (File)
Sun, Nov 17, 11:58 PM
Unknown Object (File)
Tue, Nov 5, 12:31 AM
Unknown Object (File)
Tue, Nov 5, 12:31 AM
Unknown Object (File)
Tue, Nov 5, 12:31 AM
Unknown Object (File)
Tue, Nov 5, 12:26 AM
Subscribers

Details

Summary

Keep a list of disks and partitions that we have. Keep track of the
sizes of the media and sector and use that to implement DIOCGMEDIASIZE
and DIOCGSECTORSIZE. Proivde a way to lookup disks by name.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49094
Build 45983: arc lint + arc unit

Event Timeline

imp requested review of this revision.Jan 10 2023, 12:20 AM
kevans added inline comments.
stand/kboot/hostdisk.c
197

dev needs to be freed here as well upon error

416

As noted; can it be NULL? If it is NULL, I don't see a point to doing any of this last bit in the first place.

stand/kboot/hostdisk.c
197

doh! Will fix

416

At one point this was done to test the validity of a device. I'll have to check to see if that's still possible after the refactoring.

stand/kboot/hostdisk.c
416

ls.c uses it to check to see if there's a path on the device already so it can add '/' of not (eg ls foo: -> ls foo:/). Modules uses it parse a device spec to see if there's a path on it and does things with the path it finds.

Add needed free, init to NULL to make the code easier to modify in the future.

stand/kboot/hostdisk.c
416

ls.c uses it to check to see if there's a path on the device already so it can add '/' of not (eg ls foo: -> ls foo:/). Modules uses it parse a device spec to see if there's a path on it and does things with the path it finds.

But... that's with devparse, which passes in its own pointer so it's always not null. It also does the free dance for the parse-ony case. So I can remove this check here.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 13 2023, 9:27 PM
This revision was automatically updated to reflect the committed changes.