HomeFreeBSD

cam/cd: Simplify to remove invalid flag

Description

cam/cd: Simplify to remove invalid flag

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 these are the only places we use this flag, we can simplfy the
code by removing it entirely and changing cdstreategy slightly.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D48840

Details

Provenance
impAuthored on Thu, Feb 6, 6:19 PM
Differential Revision
D48840: cam/cd: Simplify to remove invalid flag
Parents
rGd8c9f53922c6: cam/da: Add some comments about 28/0 asc
Branches
Unknown
Tags
Unknown