Page MenuHomeFreeBSD

devctl: Add DEV_GET_PATH
ClosedPublic

Authored by imp on Oct 30 2021, 12:52 AM.
Tags
None
Referenced Files
F170696418: D32745.id103341.diff
Sun, Sep 6, 2:02 AM
F170645790: D32745.id97932.diff
Sat, Sep 5, 7:14 PM
F170645732: D32745.id97932.diff
Sat, Sep 5, 7:14 PM
F170591349: D32745.id97932.diff
Sat, Sep 5, 1:27 PM
F170588232: D32745.diff
Sat, Sep 5, 1:08 PM
F170568170: D32745.diff
Sat, Sep 5, 11:02 AM
F170538013: D32745.id103341.diff
Sat, Sep 5, 7:34 AM
F170515663: D32745.id98102.diff
Sat, Sep 5, 4:49 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 42624
Build 39512: 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
5756

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.

5756

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.