Page MenuHomeFreeBSD

devctl: Add DEV_GET_PATH
ClosedPublic

Authored by imp on Oct 30 2021, 12:52 AM.
Tags
None
Referenced Files
F103027227: D32745.id.diff
Wed, Nov 20, 12:09 AM
Unknown Object (File)
Mon, Nov 18, 4:36 PM
Unknown Object (File)
Mon, Nov 18, 2:51 PM
Unknown Object (File)
Sun, Nov 17, 5:57 PM
Unknown Object (File)
Sun, Nov 17, 2:13 PM
Unknown Object (File)
Sun, Nov 17, 1:24 PM
Unknown Object (File)
Sun, Nov 17, 12:49 PM
Unknown Object (File)
Sun, Nov 17, 11:29 AM
Subscribers
None

Details

Summary

DEV_GET_PATH will get the path to a device based on different locators.

Sponsored by: Netflix

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42501
Build 39389: arc lint + arc unit

Event Timeline

imp requested review of this revision.Oct 30 2021, 12:52 AM
imp created this revision.

refactor to make things easier later.

sys/kern/subr_bus.c
5710

I would maybe just make this return a char *. It's a static function and the caller has to pass the result to free anyway, so it's always going to require an ugly __DECONST in the caller to deal with free. Doing this removes the __DECONST below in the ioctl handler and also removes the need for both rv and r in this function.

5721

Hmm, I guess sbuf_finish() can't fail in practice due to SBUF_AUTOEXTEND?

5731
5757

I would be fine with not requiring PRIV_DRIVER for this request.

imp marked 4 inline comments as done.

Updated based on review.

sys/kern/subr_bus.c
5710

OK.

5721

Doesn't matter if it fails or not. If it does fail, len will be -1, which is checked below.

5757

OK. /dev/devctl2's permissions would need to be updated for that to be completely useful though.

imp marked 3 inline comments as done.

update based on review

This revision is now accepted and ready to land.Nov 9 2021, 5:29 PM
This revision was automatically updated to reflect the committed changes.