Page MenuHomeFreeBSD

devctl: Add DEV_GET_PATH
AcceptedPublic

Authored by imp on Oct 30 2021, 12:52 AM.

Details

Reviewers
jhb
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 OK
Unit
No Unit 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
5709

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.

5720

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

5730
5755

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
5709

OK.

5720

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

5755

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