[SCSI] libsas: Add SAS_HA state flags to avoid queueing events while unloading

Track sas_ha_struct state so that we ignore events that come in while
we're shutting things down.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
Darrick J. Wong 2007-01-11 14:15:43 -08:00 committed by James Bottomley
parent 980fa2f9d6
commit 6b0efb8516
5 changed files with 31 additions and 6 deletions

View file

@ -323,12 +323,20 @@ struct sas_ha_event {
struct sas_ha_struct *ha;
};
enum sas_ha_state {
SAS_HA_REGISTERED,
SAS_HA_UNREGISTERED
};
struct sas_ha_struct {
/* private: */
spinlock_t event_lock;
struct sas_ha_event ha_events[HA_NUM_EVENTS];
unsigned long pending;
enum sas_ha_state state;
spinlock_t state_lock;
struct scsi_core core;
/* public: */