#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/unaligned.h>
#include <scsi/scsi.h>
#include <scsi/scsi_proto.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_dh.h>
#define ALUA_DH_NAME …
#define ALUA_DH_VER …
#define TPGS_SUPPORT_NONE …
#define TPGS_SUPPORT_OPTIMIZED …
#define TPGS_SUPPORT_NONOPTIMIZED …
#define TPGS_SUPPORT_STANDBY …
#define TPGS_SUPPORT_UNAVAILABLE …
#define TPGS_SUPPORT_LBA_DEPENDENT …
#define TPGS_SUPPORT_OFFLINE …
#define TPGS_SUPPORT_TRANSITION …
#define TPGS_SUPPORT_ALL …
#define RTPG_FMT_MASK …
#define RTPG_FMT_EXT_HDR …
#define TPGS_MODE_UNINITIALIZED …
#define TPGS_MODE_NONE …
#define TPGS_MODE_IMPLICIT …
#define TPGS_MODE_EXPLICIT …
#define ALUA_RTPG_SIZE …
#define ALUA_FAILOVER_TIMEOUT …
#define ALUA_FAILOVER_RETRIES …
#define ALUA_RTPG_DELAY_MSECS …
#define ALUA_RTPG_RETRY_DELAY …
#define ALUA_OPTIMIZE_STPG …
#define ALUA_RTPG_EXT_HDR_UNSUPP …
#define ALUA_PG_RUN_RTPG …
#define ALUA_PG_RUN_STPG …
#define ALUA_PG_RUNNING …
static uint optimize_stpg;
module_param(optimize_stpg, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(…) …;
static LIST_HEAD(port_group_list);
static DEFINE_SPINLOCK(port_group_lock);
static struct workqueue_struct *kaluad_wq;
struct alua_port_group { … };
struct alua_dh_data { … };
struct alua_queue_data { … };
#define ALUA_POLICY_SWITCH_CURRENT …
#define ALUA_POLICY_SWITCH_ALL …
static void alua_rtpg_work(struct work_struct *work);
static bool alua_rtpg_queue(struct alua_port_group *pg,
struct scsi_device *sdev,
struct alua_queue_data *qdata, bool force);
static void alua_check(struct scsi_device *sdev, bool force);
static void release_port_group(struct kref *kref)
{ … }
static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff,
int bufflen, struct scsi_sense_hdr *sshdr, int flags)
{ … }
static int submit_stpg(struct scsi_device *sdev, int group_id,
struct scsi_sense_hdr *sshdr)
{ … }
static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size,
int group_id)
{ … }
static struct alua_port_group *alua_alloc_pg(struct scsi_device *sdev,
int group_id, int tpgs)
{ … }
static int alua_check_tpgs(struct scsi_device *sdev)
{ … }
static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h,
int tpgs)
{ … }
static char print_alua_state(unsigned char state)
{ … }
static void alua_handle_state_transition(struct scsi_device *sdev)
{ … }
static enum scsi_disposition alua_check_sense(struct scsi_device *sdev,
struct scsi_sense_hdr *sense_hdr)
{ … }
static int alua_tur(struct scsi_device *sdev)
{ … }
static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
{ … }
static unsigned alua_stpg(struct scsi_device *sdev, struct alua_port_group *pg)
{ … }
static struct scsi_device * __must_check
alua_rtpg_select_sdev(struct alua_port_group *pg)
{ … }
static void alua_rtpg_work(struct work_struct *work)
{ … }
static bool alua_rtpg_queue(struct alua_port_group *pg,
struct scsi_device *sdev,
struct alua_queue_data *qdata, bool force)
{ … }
static int alua_initialize(struct scsi_device *sdev, struct alua_dh_data *h)
{ … }
static int alua_set_params(struct scsi_device *sdev, const char *params)
{ … }
static int alua_activate(struct scsi_device *sdev,
activate_complete fn, void *data)
{ … }
static void alua_check(struct scsi_device *sdev, bool force)
{ … }
static blk_status_t alua_prep_fn(struct scsi_device *sdev, struct request *req)
{ … }
static void alua_rescan(struct scsi_device *sdev)
{ … }
static int alua_bus_attach(struct scsi_device *sdev)
{ … }
static void alua_bus_detach(struct scsi_device *sdev)
{ … }
static struct scsi_device_handler alua_dh = …;
static int __init alua_init(void)
{ … }
static void __exit alua_exit(void)
{ … }
module_init(…) …;
module_exit(alua_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);