Page MenuHomeFreeBSD

cam/cd: Simplify to remove invalid flag
Needs ReviewPublic

Authored by imp on Tue, Feb 4, 6:37 PM.

Details

Reviewers
mav
ken
Group Reviewers
cam
Summary

cdoninvalidate set the CD_FLAG_INVALID flag. However, the periph's
invalid flag is set before that routine is called, so it's always set
when CD_FLAG_INVALID is set. It's therefore redundant.

The code in strategy can be simplified by checking the periph's
CAM_PERIPH_INVALID flag. Since this is a locked access, they will
always be the same.

The check in cdopen is currently redundant because both
cam_periph_acquire and cam_periph_hold will return an error when
CAM_PERIPH_INVALID is set, the former being unlocked, the latter being
locked (to catch the race, but in this case the race doesn't matter).

Since theres are the only places we use this flag, we can simplfy
the code by removing it entirely.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62250
Build 59134: arc lint + arc unit