Page MenuHomeFreeBSD

devctl: Add DEV_GET_PATH
ClosedPublic

Authored by imp on Oct 30 2021, 12:52 AM.
Tags
None
Referenced Files
F105601220: D32745.diff
Wed, Dec 18, 3:56 AM
Unknown Object (File)
Mon, Dec 2, 6:46 PM
Unknown Object (File)
Mon, Dec 2, 3:54 PM
Unknown Object (File)
Mon, Nov 25, 9:31 AM
Unknown Object (File)
Wed, Nov 20, 6:35 PM
Unknown Object (File)
Wed, Nov 20, 6:28 PM
Unknown Object (File)
Wed, Nov 20, 4:21 PM
Unknown Object (File)
Wed, Nov 20, 12:09 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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
5767

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.

5778

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

5788
5813

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
5767

OK.

5778

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

5813

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.