Page MenuHomeFreeBSD

cam: change xpt_clone_path to return int
ClosedPublic

Authored by imp on Jun 24 2021, 4:59 PM.

Details

Summary

xpt_clone_path originally returned a cam_status, but it doesn't do I/O
and should return an errno instead. I added it last year and it's only
used in one place. It's not yet documented, so no doc changes are
needed.

Sponsored by: Netflix

Test Plan

Based on Scott's comments on other reviews, make this fit the pattern of returning errno rather than cam_status.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

imp requested review of this revision.Jun 24 2021, 4:59 PM
imp added reviewers: scottl, mav.
This revision is now accepted and ready to land.Jun 24 2021, 5:04 PM

Though it is confusing for xpt_compile_path() and xpt_clone_path() have different return codes.

In D30884#694774, @mav wrote:

Though it is confusing for xpt_compile_path() and xpt_clone_path() have different return codes.

xpt_compile_path is used internally to CAM in 9 places. It's a good candidate as well, so I'll change that too.
Good observation.

In D30884#694775, @imp wrote:

xpt_compile_path is used internally to CAM in 9 places. It's a good candidate as well, so I'll change that too.

Although not used in a lot of places, it is used by xpt_create_path which does return a cam_status and is used in a bunch of SIMs, so some care would need to be undertaken to convert that... Either way, I'll followup with a subsequent review.

This revision was automatically updated to reflect the committed changes.