Skip to contentSkip to conversation

scsi: use notifier chain for Asynchronous Event Notification

PATCH In review [email protected] 1 participant 1 message Oct 2, 2007 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 17/17 scsi: use notifier chain for Asynchronous Event Notification

From: Kristen Carlson Accardi <[email protected]>

Add a notifier chain for SCSI asynchronous events. Add a notifier block for events which should be sent to user space, and add support for the MEDIA_CHANGE event, which would be used by a driver when new media has been inserted.

---

 drivers/scsi/Makefile    |    2 
 drivers/scsi/scsi.c      |    2 
 drivers/scsi/scsi_aen.c  |  168 +++++++++++++++++++++++++++++++++++++
 drivers/scsi/scsi_lib.c  |   83 ------------------
 drivers/scsi/scsi_priv.h |    4 
 5 files changed, 175 insertions(+), 84 deletions(-)
drivers/scsi/Makefile renamed from drivers/scsi/Makefile~scsi-use-notifier-chain-for-asynchronous-event +1 -1
diff -puN drivers/scsi/Makefile~scsi-use-notifier-chain-for-asynchronous-event drivers/scsi/Makefile
@@ -150,7 +150,7 @@ obj-$(CONFIG_SCSI_DEBUG)	+= scsi_debug.o
 obj-$(CONFIG_SCSI_WAIT_SCAN)	+= scsi_wait_scan.o
 
 scsi_mod-y			+= scsi.o hosts.o scsi_ioctl.o constants.o \
-				   scsicam.o scsi_error.o scsi_lib.o
+				   scsicam.o scsi_error.o scsi_lib.o scsi_aen.o
 scsi_mod-$(CONFIG_SCSI_DMA)	+= scsi_lib_dma.o
 scsi_mod-y			+= scsi_scan.o scsi_sysfs.o scsi_devinfo.o
 scsi_mod-$(CONFIG_SCSI_NETLINK)	+= scsi_netlink.o
drivers/scsi/scsi.c renamed from drivers/scsi/scsi.c~scsi-use-notifier-chain-for-asynchronous-event +2 -0
diff -puN drivers/scsi/scsi.c~scsi-use-notifier-chain-for-asynchronous-event drivers/scsi/scsi.c
@@ -1045,6 +1045,8 @@ static int __init init_scsi(void)
 	if (error)
 		goto cleanup_sysctl;
 
+	scsi_aen_init();
+
 	scsi_netlink_init();
 
 	printk(KERN_NOTICE "SCSI subsystem initialized\n");
drivers/scsi/scsi_aen.c new file +168 -0

168 lines not on this page · raw message

drivers/scsi/scsi_lib.c renamed from drivers/scsi/scsi_lib.c~scsi-use-notifier-chain-for-asynchronous-event +0 -83

95 lines not on this page · raw message

drivers/scsi/scsi_priv.h renamed from drivers/scsi/scsi_priv.h~scsi-use-notifier-chain-for-asynchronous-event +4 -0
diff -puN drivers/scsi/scsi_priv.h~scsi-use-notifier-chain-for-asynchronous-event drivers/scsi/scsi_priv.h
@@ -128,6 +128,10 @@ static inline void scsi_netlink_init(voi
 static inline void scsi_netlink_exit(void) {}
 #endif
 
+/* scsi_aen.c */
+extern int scsi_aen_init(void);
+extern void scsi_aen_exit(void);
+
 /* 
  * internal scsi timeout functions: for use by mid-layer and transport
  * classes.

_