freebsd-dev/sys/geom
Alexander Motin 3631c6382f Implement media change notification for DA and CD removable media devices.
It includes three parts:
 1) Modifications to CAM to detect media media changes and report them to
disk(9) layer. For modern SATA (and potentially UAS) devices it utilizes
Asynchronous Notification mechanism to receive events from hardware.
Active polling with TEST UNIT READY commands with 3 seconds period is used
for incapable hardware. After that both CD and DA drivers work the same way,
detecting two conditions: "NOT READY: Medium not present" after medium was
detected previously, and "UNIT ATTENTION: Not ready to ready change, medium
may have changed". First one reported to disk(9) as media removal, second
as media insert/change. To reliably receive second event new
AC_UNIT_ATTENTION async added to make UAs broadcasted to all periphs by
generic error handling code in cam_periph_error().
 2) Modifications to GEOM core to handle media remove and change events.
Media removal handled by spoiling all consumers attached to the provider.
Media change event also schedules provider retaste after spoiling to probe
new media. New flag G_CF_ORPHAN was added to consumers to reflect that
consumer is in process of destruction. It allows retaste to create new
geom instance of the same class, while previous one is still dying.
 3) Modifications to some GEOM classes: DEV -- to report media change
events to devd; VFS -- to handle spoiling same as orphan to prevent
accessing replaced media. PART class already handles spoiling alike to
orphan.

Reviewed by:	silence on geom@ and scsi@
Tested by:	avg
Sponsored by:	iXsystems, Inc. / PC-BSD
MFC after:	2 months
2012-07-29 11:51:48 +00:00
..
bde Fix orphan() methods of several GEOM classes to not assume that there 2012-07-07 17:09:44 +00:00
cache Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
concat Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
eli Use correct part of the Master-Key for generating encryption keys. 2012-07-04 17:54:17 +00:00
gate Reorder things in g_gate_create() so at the moment when g_new_geomf() 2012-07-28 16:30:50 +00:00
journal Current implementations of sync(2) and syncer vnode fsync() VOP uses 2012-02-06 11:04:36 +00:00
label Revert r235918 for now and add comment explaining the reason for the 2012-05-25 10:08:48 +00:00
linux_lvm Add some FEATURE macros for various GEOM classes. 2011-02-25 10:24:35 +00:00
mirror Make geom_mirror more friendly to SSDs. To properly support TRIM, 2012-07-01 15:43:52 +00:00
mountver Add trivial resize handling to gmountver(8). 2012-07-07 22:20:47 +00:00
multipath Add missing newlines into XML output. 2012-06-05 16:46:34 +00:00
nop Add trivial resize handling to gnop(8). 2012-07-07 22:22:13 +00:00
part Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
raid - Prevent error status leak if write to some of the RAID1/1E volume disks 2012-05-11 13:20:17 +00:00
raid3 Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
sched Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
shsec Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
stripe Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
uncompress Fix orphan() methods of several GEOM classes to not assume that there 2012-07-07 17:09:44 +00:00
uzip Fix orphan() methods of several GEOM classes to not assume that there 2012-07-07 17:09:44 +00:00
vinum Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
virstor Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
zero Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
geom_aes.c Fix orphan() methods of several GEOM classes to not assume that there 2012-07-07 17:09:44 +00:00
geom_bsd_enc.c
geom_bsd.c Avoid to check the same cache line/variable from all the locking 2012-01-28 14:00:21 +00:00
geom_ccd.c Include sys/sbuf.h directly. 2011-07-11 05:22:31 +00:00
geom_ctl.c Finish r210923, 210926. Mark some devices as eternal. 2011-01-04 10:59:38 +00:00
geom_ctl.h
geom_dev.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_disk.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_disk.h Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_dump.c Do not hide stripeoffset from libgeom(3), it may be useful even when 2011-06-02 12:49:45 +00:00
geom_event.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_flashmap.c - Correct signedness for casts; 2012-05-23 20:51:21 +00:00
geom_fox.c Add some FEATURE macros for various GEOM classes. 2011-02-25 10:24:35 +00:00
geom_int.h
geom_io.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_kern.c Move the three geom kprocs as threads under a single pid. 2011-05-11 21:47:30 +00:00
geom_map.c Use %j to match intmax_t. 2012-07-01 05:22:13 +00:00
geom_mbr_enc.c
geom_mbr.c Avoid to check the same cache line/variable from all the locking 2012-01-28 14:00:21 +00:00
geom_pc98_enc.c
geom_pc98.c Avoid to check the same cache line/variable from all the locking 2012-01-28 14:00:21 +00:00
geom_redboot.c - Give geom_redboot taste of flash/spi. Now there is another provider 2010-02-03 01:12:19 +00:00
geom_slice.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_slice.h
geom_subr.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_sunlabel_enc.c
geom_sunlabel.c Include sys/sbuf.h directly. 2011-07-11 05:22:31 +00:00
geom_vfs.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_vfs.h Remove the struct thread unuseful argument from bufobj interface. 2008-10-10 21:23:50 +00:00
geom_vol_ffs.c Add some FEATURE macros for various GEOM classes. 2011-02-25 10:24:35 +00:00
geom.h Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
notes