Skip to content
Commit 2bae0093 authored by Tejun Heo's avatar Tejun Heo Committed by James Bottomley
Browse files

[SCSI] sd: implement sd_check_events()



Replace sd_media_change() with sd_check_events().

* Move media removed logic into set_media_not_present() and
  media_not_present() and set sdev->changed iff an existing media is
  removed or the device indicates UNIT_ATTENTION.

* Make sd_check_events() sets sdev->changed if previously missing
  media becomes present.

* Event is reported only if sdev->changed is set.

This makes media presence event reported if scsi_disk->media_present
actually changed or the device indicated UNIT_ATTENTION.  For backward
compatibility, SDEV_EVT_MEDIA_CHANGE is generated each time
sd_check_events() detects media change event.

[jejb: fix boot failure]
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarJens Axboe <jaxboe@fusionio.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 52cfd503
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment