Renamed tgt_dev_specific to dh_priv as well as all *_specific to *_priv

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@18 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2006-10-27 09:45:12 +00:00
parent 40ca3e675e
commit beb77e96ff
9 changed files with 118 additions and 125 deletions

View File

@@ -297,7 +297,7 @@ static void q2t_free_session_done(struct scst_session *scst_sess)
TRACE_ENTRY();
BUG_ON(scst_sess == NULL);
sess = (struct q2t_sess *)scst_sess_get_tgt_specific(scst_sess);
sess = (struct q2t_sess *)scst_sess_get_tgt_priv(scst_sess);
BUG_ON(sess == NULL);
tgt = sess->tgt;
@@ -387,8 +387,7 @@ static void q2t_clear_tgt_db(struct q2t_tgt *tgt)
static int q2t_target_release(struct scst_tgt *scst_tgt)
{
int res = 0;
struct q2t_tgt *tgt =
(struct q2t_tgt *)scst_tgt_get_tgt_specific(scst_tgt);
struct q2t_tgt *tgt = (struct q2t_tgt *)scst_tgt_get_tgt_priv(scst_tgt);
scsi_qla_host_t *ha = tgt->ha;
unsigned long flags = 0;
@@ -412,7 +411,7 @@ static int q2t_target_release(struct scst_tgt *scst_tgt)
"sess_count=%d", tgt, list_empty(&tgt->sess_list),
atomic_read(&tgt->sess_count));
scst_tgt_set_tgt_specific(scst_tgt, NULL);
scst_tgt_set_tgt_priv(scst_tgt, NULL);
TRACE_MEM("kfree for tgt %p", tgt);
kfree(tgt);
@@ -698,9 +697,9 @@ static int q2t_xmit_response(struct scst_cmd *scst_cmd)
TRACE_ENTRY();
TRACE(TRACE_SCSI, "tag=%d", scst_cmd_get_tag(scst_cmd));
prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd);
prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd);
sess = (struct q2t_sess *)
scst_sess_get_tgt_specific(scst_cmd_get_session(scst_cmd));
scst_sess_get_tgt_priv(scst_cmd_get_session(scst_cmd));
if (unlikely(scst_cmd_aborted(scst_cmd))) {
scsi_qla_host_t *ha = sess->tgt->ha;
@@ -844,9 +843,9 @@ static int q2t_rdy_to_xfer(struct scst_cmd *scst_cmd)
TRACE_ENTRY();
TRACE(TRACE_SCSI, "tag=%d", scst_cmd_get_tag(scst_cmd));
prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd);
prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd);
sess = (struct q2t_sess *)
scst_sess_get_tgt_specific(scst_cmd_get_session(scst_cmd));
scst_sess_get_tgt_priv(scst_cmd_get_session(scst_cmd));
prm.sg = scst_cmd_get_sg(scst_cmd);
prm.bufflen = scst_cmd_get_bufflen(scst_cmd);
@@ -967,13 +966,12 @@ static inline void q2t_free_cmd(struct q2t_cmd *cmd)
void q2t_on_free_cmd(struct scst_cmd *scst_cmd)
{
struct q2t_cmd *cmd =
(struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd);
struct q2t_cmd *cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd);
TRACE_ENTRY();
TRACE(TRACE_SCSI, "END Command tag %d", scst_cmd_get_tag(scst_cmd));
scst_cmd_set_tgt_specific(scst_cmd, NULL);
scst_cmd_set_tgt_priv(scst_cmd, NULL);
q2t_free_cmd(cmd);
@@ -1082,7 +1080,7 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
} else
goto out;
cmd = (struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd);
cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd);
if (cmd->state == Q2T_STATE_PROCESSED) {
TRACE_DBG("Command %p finished", cmd);
@@ -1205,7 +1203,7 @@ static int q2t_do_send_cmd_to_scst(scsi_qla_host_t *ha, struct q2t_cmd *cmd)
}
scst_cmd_set_tag(cmd->scst_cmd, le16_to_cpu(cmd->atio.exchange_id));
scst_cmd_set_tgt_specific(cmd->scst_cmd, cmd);
scst_cmd_set_tgt_priv(cmd->scst_cmd, cmd);
if (cmd->atio.execution_codes & ATIO_EXEC_READ)
dir = SCST_DATA_READ;
@@ -1402,7 +1400,7 @@ static int q2t_send_cmd_to_scst(scsi_qla_host_t *ha, atio_entry_t *atio)
res = -EFAULT;
goto out_free_sess;
}
scst_sess_set_tgt_specific(sess->scst_sess, sess);
scst_sess_set_tgt_priv(sess->scst_sess, sess);
/* add session data to host data structure */
list_add(&sess->list, &tgt->sess_list);
@@ -1591,7 +1589,7 @@ static void q2t_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd)
TRACE(TRACE_MGMT, "scst_mcmd (%p) status %#x state %#x", scst_mcmd,
scst_mcmd->status, scst_mcmd->state);
mcmd = scst_mgmt_cmd_get_tgt_specific(scst_mcmd);
mcmd = scst_mgmt_cmd_get_tgt_priv(scst_mcmd);
if (unlikely(mcmd == NULL)) {
PRINT_ERROR("scst_mcmd %p tgt_spec is NULL", mcmd);
goto out;
@@ -1603,8 +1601,8 @@ static void q2t_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd)
? 0 : FC_TM_FAILED, 1);
spin_unlock_irqrestore(&mcmd->sess->tgt->ha->hardware_lock, flags);
/* scst_mgmt_cmd_set_tgt_specific(scst_mcmd, NULL); */
scst_mcmd->tgt_specific = NULL;
/* scst_mgmt_cmd_set_tgt_priv(scst_mcmd, NULL); */
scst_mcmd->tgt_priv = NULL;
TRACE_MEM("kfree for mcmd %p", mcmd);
kfree(mcmd);
@@ -2008,7 +2006,7 @@ static void q2t_host_action(scsi_qla_host_t *ha,
goto out;
}
scst_tgt_set_tgt_specific(tgt->scst_tgt, tgt);
scst_tgt_set_tgt_priv(tgt->scst_tgt, tgt);
spin_lock_irqsave(&ha->hardware_lock, flags);
ha->tgt = tgt;

View File

@@ -832,8 +832,8 @@ struct scst_tgt
/* Maximum SG table size */
int sg_tablesize;
/* Used for storage of target specific stuff */
void *tgt_specific;
/* Used for storage of target driver private stuff */
void *tgt_priv;
};
struct scst_session
@@ -870,8 +870,8 @@ struct scst_session
/* List entry for the sessions list inside ACG */
struct list_head acg_sess_list_entry;
/* Used for storage of target specific stuff */
void *tgt_specific;
/* Used for storage of target driver private stuff */
void *tgt_priv;
/*
* List of cmds in this session. Used to find a cmd in the
@@ -1114,11 +1114,11 @@ struct scst_cmd
struct list_head fileio_cmd_list_entry;
int fileio_in_list;
/* Used for storage of target specific stuff */
void *tgt_specific;
/* Used for storage of target driver private stuff */
void *tgt_priv;
/* Used for storage of dev handler specific stuff */
void *tgt_dev_specific;
/* Used for storage of dev handler private stuff */
void *dh_priv;
/*
* Used to store previous tgt_dev if dev handler returns
@@ -1162,8 +1162,8 @@ struct scst_mgmt_cmd
/* completition status, one of the SCST_MGMT_STATUS_* constants */
int status;
/* Used for storage of target specific stuff */
void *tgt_specific;
/* Used for storage of target driver private stuff */
void *tgt_priv;
};
struct scst_device
@@ -1211,8 +1211,8 @@ struct scst_device
/* Corresponding real SCSI device, could be NULL for virtual devices */
struct scsi_device *scsi_dev;
/* Used for storage of dev handler specific stuff */
void *tgt_dev_specific;
/* Used for storage of dev handler private stuff */
void *dh_priv;
/* Used to wait for requested amount of "on_dev" commands */
wait_queue_head_t on_dev_waitQ;
@@ -1262,8 +1262,8 @@ struct scst_tgt_dev
unsigned long tgt_dev_flags; /* tgt_dev's flags */
/* Used for storage of dev handler specific stuff */
void *tgt_dev_specific;
/* Used for storage of dev handler private stuff */
void *dh_priv;
/*
* Used to execute cmd's in order of arrival.
@@ -1553,7 +1553,7 @@ void scst_tgt_cmd_done(struct scst_cmd *cmd);
* same sess. Returns 0 for success, error code otherwise.
*/
int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, uint32_t tag,
int atomic, void *tgt_specific);
int atomic, void *tgt_priv);
/*
* Creates new management command using LUN and sends it for execution.
@@ -1563,7 +1563,7 @@ int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, uint32_t tag,
*/
int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn,
const uint8_t *lun, int lun_len,
int atomic, void *tgt_specific);
int atomic, void *tgt_priv);
/*
* Provides various CDB info
@@ -1649,30 +1649,30 @@ int scst_register_virtual_device(struct scst_dev_type *dev_handler,
void scst_unregister_virtual_device(int id);
/*
* Get/Set functions for tgt's target specific data
* Get/Set functions for tgt's target private data
*/
static inline void *scst_tgt_get_tgt_specific(struct scst_tgt *tgt)
static inline void *scst_tgt_get_tgt_priv(struct scst_tgt *tgt)
{
return tgt->tgt_specific;
return tgt->tgt_priv;
}
static inline void scst_tgt_set_tgt_specific(struct scst_tgt *tgt, void *val)
static inline void scst_tgt_set_tgt_priv(struct scst_tgt *tgt, void *val)
{
tgt->tgt_specific = val;
tgt->tgt_priv = val;
}
/*
* Get/Set functions for session's target specific data
* Get/Set functions for session's target private data
*/
static inline void *scst_sess_get_tgt_specific(struct scst_session *sess)
static inline void *scst_sess_get_tgt_priv(struct scst_session *sess)
{
return sess->tgt_specific;
return sess->tgt_priv;
}
static inline void scst_sess_set_tgt_specific(struct scst_session *sess,
static inline void scst_sess_set_tgt_priv(struct scst_session *sess,
void *val)
{
sess->tgt_specific = val;
sess->tgt_priv = val;
}
/* Returns TRUE if cmd is being executed in atomic context */
@@ -1811,23 +1811,23 @@ static inline void scst_cmd_set_tag(struct scst_cmd *cmd, uint32_t tag)
}
/*
* Get/Set functions for cmd's target specific data.
* Get/Set functions for cmd's target private data.
* Variant with *_lock must be used if target driver uses
* scst_find_cmd() to avoid race with it, except inside scst_find_cmd()'s
* callback, where lock is already taken.
*/
static inline void *scst_cmd_get_tgt_specific(struct scst_cmd *cmd)
static inline void *scst_cmd_get_tgt_priv(struct scst_cmd *cmd)
{
return cmd->tgt_specific;
return cmd->tgt_priv;
}
static inline void scst_cmd_set_tgt_specific(struct scst_cmd *cmd, void *val)
static inline void scst_cmd_set_tgt_priv(struct scst_cmd *cmd, void *val)
{
cmd->tgt_specific = val;
cmd->tgt_priv = val;
}
void *scst_cmd_get_tgt_specific_lock(struct scst_cmd *cmd);
void scst_cmd_set_tgt_specific_lock(struct scst_cmd *cmd, void *val);
void *scst_cmd_get_tgt_priv_lock(struct scst_cmd *cmd);
void scst_cmd_set_tgt_priv_lock(struct scst_cmd *cmd, void *val);
/*
* Get/Set functions for data_buf_tgt_alloc flag
@@ -1897,17 +1897,17 @@ static inline void scst_cmd_set_expected(struct scst_cmd *cmd,
}
/*
* Get/Set function for mgmt cmd's target specific data
* Get/Set function for mgmt cmd's target private data
*/
static inline void *scst_mgmt_cmd_get_tgt_specific(struct scst_mgmt_cmd *mcmd)
static inline void *scst_mgmt_cmd_get_tgt_priv(struct scst_mgmt_cmd *mcmd)
{
return mcmd->tgt_specific;
return mcmd->tgt_priv;
}
static inline void scst_mgmt_cmd_set_tgt_specific(struct scst_mgmt_cmd *mcmd,
static inline void scst_mgmt_cmd_set_tgt_priv(struct scst_mgmt_cmd *mcmd,
void *val)
{
mcmd->tgt_specific = val;
mcmd->tgt_priv = val;
}
/*

View File

@@ -163,7 +163,7 @@ out_free_buf:
out_free_cdrom:
if (res == 0)
dev->tgt_dev_specific = cdrom;
dev->dh_priv = cdrom;
else {
TRACE_MEM("kfree for cdrom: %p", cdrom);
kfree(cdrom);
@@ -185,14 +185,13 @@ out:
************************************************************/
void cdrom_detach(struct scst_device *dev)
{
struct cdrom_params *cdrom =
(struct cdrom_params *)dev->tgt_dev_specific;
struct cdrom_params *cdrom = (struct cdrom_params *)dev->dh_priv;
TRACE_ENTRY();
TRACE_MEM("kfree for cdrom: %p", cdrom);
kfree(cdrom);
dev->tgt_dev_specific = NULL;
dev->dh_priv = NULL;
TRACE_EXIT();
return;
@@ -277,7 +276,7 @@ int cdrom_parse(struct scst_cmd *cmd, const struct scst_info_cdb *info_cdb)
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
*/
cdrom = (struct cdrom_params *)cmd->dev->tgt_dev_specific;
cdrom = (struct cdrom_params *)cmd->dev->dh_priv;
cmd->bufflen = info_cdb->transfer_len * cdrom->sector_size;
}
@@ -341,8 +340,7 @@ int cdrom_done(struct scst_cmd *cmd)
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
*/
cdrom =
(struct cdrom_params *)cmd->dev->tgt_dev_specific;
cdrom = (struct cdrom_params *)cmd->dev->dh_priv;
sector_size =
((buffer[4] << 24) | (buffer[5] << 16) |
(buffer[6] << 8) | (buffer[7] << 0));

View File

@@ -236,7 +236,7 @@ out_free_buf:
out_free_disk:
if (res == 0)
dev->tgt_dev_specific = disk;
dev->dh_priv = disk;
else {
TRACE_MEM("kfree for disk: %p", disk);
kfree(disk);
@@ -258,13 +258,13 @@ out:
************************************************************/
void disk_detach(struct scst_device *dev)
{
struct disk_params *disk = (struct disk_params *)dev->tgt_dev_specific;
struct disk_params *disk = (struct disk_params *)dev->dh_priv;
TRACE_ENTRY();
TRACE_MEM("kfree for disk: %p", disk);
kfree(disk);
dev->tgt_dev_specific = NULL;
dev->dh_priv = NULL;
TRACE_EXIT();
return;
@@ -337,7 +337,7 @@ int disk_parse(struct scst_cmd *cmd, const struct scst_info_cdb *info_cdb)
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
*/
disk = (struct disk_params *)cmd->dev->tgt_dev_specific;
disk = (struct disk_params *)cmd->dev->dh_priv;
cmd->bufflen = info_cdb->transfer_len * disk->sector_size;
}
@@ -401,7 +401,7 @@ int disk_done(struct scst_cmd *cmd)
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
*/
disk = (struct disk_params *)cmd->dev->tgt_dev_specific;
disk = (struct disk_params *)cmd->dev->dh_priv;
sector_size =
((buffer[4] << 24) | (buffer[5] << 16) |
(buffer[6] << 8) | (buffer[7] << 0));

View File

@@ -341,7 +341,7 @@ static int fileio_attach(struct scst_device *dev)
virt_dev->name);
}
dev->tgt_dev_specific = virt_dev;
dev->dh_priv = virt_dev;
out:
TRACE_EXIT();
@@ -364,7 +364,7 @@ out_close_file:
static void fileio_detach(struct scst_device *dev)
{
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)dev->tgt_dev_specific;
(struct scst_fileio_dev *)dev->dh_priv;
TRACE_ENTRY();
@@ -374,7 +374,7 @@ static void fileio_detach(struct scst_device *dev)
virt_dev->name, virt_dev->file_name);
/* virt_dev will be freed by the caller */
dev->tgt_dev_specific = NULL;
dev->dh_priv = NULL;
TRACE_EXIT();
return;
@@ -388,7 +388,7 @@ static void fileio_do_job(struct scst_cmd *cmd)
loff_t loff;
struct scst_device *dev = cmd->dev;
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)dev->tgt_dev_specific;
(struct scst_fileio_dev *)dev->dh_priv;
int fua = 0;
TRACE_ENTRY();
@@ -481,7 +481,7 @@ static void fileio_do_job(struct scst_cmd *cmd)
int do_fsync = 0;
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev*)
cmd->tgt_dev->tgt_dev_specific;
cmd->tgt_dev->dh_priv;
if ((cmd->queue_type == SCST_CMD_QUEUE_ORDERED) &&
!virt_dev->wt_flag) {
TRACE(TRACE_SCSI/*|TRACE_SPECIAL*/, "ORDERED WRITE: "
@@ -508,7 +508,7 @@ static void fileio_do_job(struct scst_cmd *cmd)
int do_fsync = 0;
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev*)
cmd->tgt_dev->tgt_dev_specific;
cmd->tgt_dev->dh_priv;
if ((cmd->queue_type == SCST_CMD_QUEUE_ORDERED) &&
!virt_dev->wt_flag) {
TRACE(TRACE_SCSI/*|TRACE_SPECIAL*/, "ORDERED "
@@ -535,7 +535,7 @@ static void fileio_do_job(struct scst_cmd *cmd)
int immed = cmd->cdb[1] & 0x2;
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev*)
cmd->tgt_dev->tgt_dev_specific;
cmd->tgt_dev->dh_priv;
TRACE(TRACE_SCSI, "SYNCHRONIZE_CACHE: "
"loff=%Ld, data_len=%Ld, immed=%d", (uint64_t)loff,
(uint64_t)data_len, immed);
@@ -664,7 +664,7 @@ static int fileio_cmd_thread(void *arg)
static int fileio_attach_tgt(struct scst_tgt_dev *tgt_dev)
{
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)tgt_dev->acg_dev->dev->tgt_dev_specific;
(struct scst_fileio_dev *)tgt_dev->acg_dev->dev->dh_priv;
struct scst_fileio_tgt_dev *ftgt_dev;
int res = 0;
@@ -710,7 +710,7 @@ static int fileio_attach_tgt(struct scst_tgt_dev *tgt_dev)
res = 0;
atomic_inc(&ftgt_dev->threads_count);
tgt_dev->tgt_dev_specific = ftgt_dev;
tgt_dev->dh_priv = ftgt_dev;
down(&virt_dev->ftgt_list_mutex);
list_add_tail(&ftgt_dev->ftgt_list_entry,
@@ -734,9 +734,9 @@ out_free:
static void fileio_detach_tgt(struct scst_tgt_dev *tgt_dev)
{
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev *)tgt_dev->tgt_dev_specific;
(struct scst_fileio_tgt_dev *)tgt_dev->dh_priv;
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)tgt_dev->acg_dev->dev->tgt_dev_specific;
(struct scst_fileio_dev *)tgt_dev->acg_dev->dev->dh_priv;
TRACE_ENTRY();
@@ -759,7 +759,7 @@ static void fileio_detach_tgt(struct scst_tgt_dev *tgt_dev)
TRACE_MEM("kfree ftgt_dev: %p", ftgt_dev);
kfree(ftgt_dev);
tgt_dev->tgt_dev_specific = NULL;
tgt_dev->dh_priv = NULL;
TRACE_EXIT();
}
@@ -781,7 +781,7 @@ static int disk_fileio_parse(struct scst_cmd *cmd,
int res = SCST_CMD_STATE_DEFAULT;
int fixed;
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
(struct scst_fileio_dev *)cmd->dev->dh_priv;
TRACE_ENTRY();
@@ -842,7 +842,7 @@ static int disk_fileio_parse(struct scst_cmd *cmd,
static inline void fileio_queue_cmd(struct scst_cmd *cmd)
{
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific;
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv;
spin_lock_bh(&ftgt_dev->fdev_lock);
TRACE_DBG("Pushing cmd %p to IO thread", cmd);
list_add_tail(&cmd->fileio_cmd_list_entry,
@@ -963,7 +963,7 @@ static int cdrom_fileio_parse(struct scst_cmd *cmd,
int res = SCST_CMD_STATE_DEFAULT;
int fixed;
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
(struct scst_fileio_dev *)cmd->dev->dh_priv;
TRACE_ENTRY();
@@ -1029,7 +1029,7 @@ static int cdrom_fileio_exec(struct scst_cmd *cmd)
int delayed = 0;
int opcode = cmd->cdb[0];
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
(struct scst_fileio_dev *)cmd->dev->dh_priv;
TRACE_ENTRY();
@@ -1129,7 +1129,7 @@ static void fileio_exec_inquiry(struct scst_cmd *cmd)
uint8_t *address;
uint8_t *buf;
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
(struct scst_fileio_dev *)cmd->dev->dh_priv;
/* ToDo: Performance Boost:
* 1. remove kzalloc, buf
@@ -1378,7 +1378,7 @@ static void fileio_exec_mode_sense(struct scst_cmd *cmd)
goto out;
}
virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv;
blocksize = virt_dev->block_size;
nblocks = virt_dev->nblocks;
@@ -1560,7 +1560,7 @@ static void fileio_exec_mode_select(struct scst_cmd *cmd)
TRACE_ENTRY();
virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv;
mselect_6 = (MODE_SELECT == cmd->cdb[0]);
length = scst_get_buf_first(cmd, &address);
@@ -1640,7 +1640,7 @@ static void fileio_exec_read_capacity(struct scst_cmd *cmd)
TRACE_ENTRY();
virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv;
blocksize = virt_dev->block_size;
nblocks = virt_dev->nblocks;
@@ -1691,7 +1691,7 @@ static void fileio_exec_read_capacity16(struct scst_cmd *cmd)
TRACE_ENTRY();
virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv;
blocksize = virt_dev->block_size;
nblocks = virt_dev->nblocks;
@@ -1763,7 +1763,7 @@ static void fileio_exec_read_toc(struct scst_cmd *cmd)
goto out;
}
virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv;
/* FIXME when you have > 8TB ROM device. */
nblocks = (uint32_t)virt_dev->nblocks;
@@ -1806,7 +1806,7 @@ out:
static void fileio_exec_prevent_allow_medium_removal(struct scst_cmd *cmd)
{
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
(struct scst_fileio_dev *)cmd->dev->dh_priv;
TRACE_DBG("PERSIST/PREVENT 0x%02x", cmd->cdb[4]);
@@ -1889,9 +1889,9 @@ static void fileio_exec_read(struct scst_cmd *cmd, loff_t loff)
ssize_t length, full_len;
uint8_t *address;
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
(struct scst_fileio_dev *)cmd->dev->dh_priv;
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific;
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv;
struct file *fd = ftgt_dev->fd;
struct iovec *iv;
int iv_count, i;
@@ -1974,9 +1974,9 @@ static void fileio_exec_write(struct scst_cmd *cmd, loff_t loff)
ssize_t length, full_len;
uint8_t *address;
struct scst_fileio_dev *virt_dev =
(struct scst_fileio_dev *)cmd->dev->tgt_dev_specific;
(struct scst_fileio_dev *)cmd->dev->dh_priv;
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific;
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv;
struct file *fd = ftgt_dev->fd;
struct iovec *iv, *eiv;
int iv_count, eiv_count;
@@ -2092,7 +2092,7 @@ static void fileio_exec_verify(struct scst_cmd *cmd, loff_t loff)
uint8_t *address_sav, *address;
int compare;
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific;
(struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv;
struct file *fd = ftgt_dev->fd;
uint8_t *mem_verify = NULL;
@@ -2205,8 +2205,7 @@ static int fileio_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
unsigned long flags;
struct scst_cmd *cmd_to_abort = mcmd->cmd_to_abort;
struct scst_fileio_tgt_dev *ftgt_dev =
(struct scst_fileio_tgt_dev *)cmd_to_abort->tgt_dev->
tgt_dev_specific;
(struct scst_fileio_tgt_dev *)cmd_to_abort->tgt_dev->dh_priv;
/*
* Actually, _bh lock is enough here. But, since we
* could be called with IRQ off, the in-kernel debug check

View File

@@ -250,7 +250,7 @@ out_free_buf:
out_free_modisk:
if (res == 0)
dev->tgt_dev_specific = modisk;
dev->dh_priv = modisk;
else {
TRACE_MEM("kfree for modisk: %p", modisk);
kfree(modisk);
@@ -272,14 +272,13 @@ out:
************************************************************/
void modisk_detach(struct scst_device *dev)
{
struct modisk_params *modisk =
(struct modisk_params *)dev->tgt_dev_specific;
struct modisk_params *modisk = (struct modisk_params *)dev->dh_priv;
TRACE_ENTRY();
TRACE_MEM("kfree for modisk: %p", modisk);
kfree(modisk);
dev->tgt_dev_specific = NULL;
dev->dh_priv = NULL;
TRACE_EXIT();
return;
@@ -364,7 +363,7 @@ int modisk_parse(struct scst_cmd *cmd, const struct scst_info_cdb *info_cdb)
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
*/
modisk = (struct modisk_params *)cmd->dev->tgt_dev_specific;
modisk = (struct modisk_params *)cmd->dev->dh_priv;
cmd->bufflen = info_cdb->transfer_len * modisk->sector_size;
}
@@ -428,8 +427,7 @@ int modisk_done(struct scst_cmd *cmd)
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
*/
modisk =
(struct modisk_params *)cmd->dev->tgt_dev_specific;
modisk = (struct modisk_params *)cmd->dev->dh_priv;
sector_size =
((buffer[4] << 24) | (buffer[5] << 16) |
(buffer[6] << 8) | (buffer[7] << 0));

View File

@@ -248,7 +248,7 @@ out_free_buf:
out_free_req:
if (res == 0)
dev->tgt_dev_specific = tape;
dev->dh_priv = tape;
else {
TRACE_MEM("kfree for tape: %p", tape);
kfree(tape);
@@ -270,13 +270,13 @@ out:
************************************************************/
void tape_detach(struct scst_device *dev)
{
struct tape_params *tape = (struct tape_params *)dev->tgt_dev_specific;
struct tape_params *tape = (struct tape_params *)dev->dh_priv;
TRACE_ENTRY();
TRACE_MEM("kfree for tape: %p", tape);
kfree(tape);
dev->tgt_dev_specific = NULL;
dev->dh_priv = NULL;
TRACE_EXIT();
return;
@@ -337,7 +337,7 @@ int tape_parse(struct scst_cmd *cmd, const struct scst_info_cdb *info_cdb)
* No need for locks here, since *_detach() can not be called,
* when there are existing commands.
*/
tape = (struct tape_params *)cmd->dev->tgt_dev_specific;
tape = (struct tape_params *)cmd->dev->dh_priv;
cmd->bufflen = info_cdb->transfer_len * tape->block_size;
}
@@ -400,7 +400,7 @@ int tape_done(struct scst_cmd *cmd)
* can not be called, when there are
* existing commands.
*/
tape = (struct tape_params *)cmd->dev->tgt_dev_specific;
tape = (struct tape_params *)cmd->dev->dh_priv;
spin_lock_bh(&tape->tp_lock);
if (buffer[3] == 8) {
tape->block_size = (buffer[9] << 16) |
@@ -419,7 +419,7 @@ int tape_done(struct scst_cmd *cmd)
* No need for locks here, since *_detach() can not be
* called, when there are existing commands.
*/
tape = (struct tape_params *)cmd->dev->tgt_dev_specific;
tape = (struct tape_params *)cmd->dev->dh_priv;
spin_lock_bh(&tape->tp_lock);
if (buffer[3] == 8) {
tape->block_size =
@@ -477,7 +477,7 @@ int tape_done(struct scst_cmd *cmd)
* *_detach() can not be called, when
* there are existing commands.
*/
tape = (struct tape_params *)cmd->dev->tgt_dev_specific;
tape = (struct tape_params *)cmd->dev->dh_priv;
resp_data_len *= tape->block_size;
}
scst_set_resp_data_len(cmd, resp_data_len);

View File

@@ -1280,8 +1280,8 @@ EXPORT_SYMBOL(scst_put);
* Other Commands
*/
EXPORT_SYMBOL(scst_get_cdb_info);
EXPORT_SYMBOL(scst_cmd_get_tgt_specific_lock);
EXPORT_SYMBOL(scst_cmd_set_tgt_specific_lock);
EXPORT_SYMBOL(scst_cmd_get_tgt_priv_lock);
EXPORT_SYMBOL(scst_cmd_set_tgt_priv_lock);
#ifdef DEBUG
EXPORT_SYMBOL(scst_random);

View File

@@ -3400,7 +3400,7 @@ static void scst_mgmt_cmd_send_done(struct scst_mgmt_cmd *mcmd)
break;
}
mcmd->tgt_specific = NULL;
mcmd->tgt_priv = NULL;
TRACE_EXIT();
return;
@@ -3535,7 +3535,7 @@ int scst_mgmt_cmd_thread(void *arg)
}
static struct scst_mgmt_cmd *scst_pre_rx_mgmt_cmd(struct scst_session
*sess, int fn, int atomic, void *tgt_specific)
*sess, int fn, int atomic, void *tgt_priv)
{
struct scst_mgmt_cmd *mcmd = NULL;
@@ -3554,7 +3554,7 @@ static struct scst_mgmt_cmd *scst_pre_rx_mgmt_cmd(struct scst_session
mcmd->sess = sess;
mcmd->fn = fn;
mcmd->state = SCST_MGMT_CMD_STATE_INIT;
mcmd->tgt_specific = tgt_specific;
mcmd->tgt_priv = tgt_priv;
out:
TRACE_EXIT();
@@ -3623,7 +3623,7 @@ out_unlock:
*/
int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn,
const uint8_t *lun, int lun_len, int atomic,
void *tgt_specific)
void *tgt_priv)
{
int res = -EFAULT;
struct scst_mgmt_cmd *mcmd = NULL;
@@ -3636,7 +3636,7 @@ int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn,
goto out;
}
mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_specific);
mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_priv);
if (mcmd == NULL)
goto out;
@@ -3666,7 +3666,7 @@ out_free:
* same sess
*/
int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, uint32_t tag,
int atomic, void *tgt_specific)
int atomic, void *tgt_priv)
{
int res = -EFAULT;
struct scst_mgmt_cmd *mcmd = NULL;
@@ -3679,7 +3679,7 @@ int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, uint32_t tag,
goto out;
}
mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_specific);
mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_priv);
if (mcmd == NULL)
goto out;
@@ -4024,20 +4024,20 @@ struct scst_cmd *scst_find_cmd_by_tag(struct scst_session *sess,
return cmd;
}
void *scst_cmd_get_tgt_specific_lock(struct scst_cmd *cmd)
void *scst_cmd_get_tgt_priv_lock(struct scst_cmd *cmd)
{
void *res;
unsigned long flags;
spin_lock_irqsave(&scst_list_lock, flags);
res = cmd->tgt_specific;
res = cmd->tgt_priv;
spin_unlock_irqrestore(&scst_list_lock, flags);
return res;
}
void scst_cmd_set_tgt_specific_lock(struct scst_cmd *cmd, void *val)
void scst_cmd_set_tgt_priv_lock(struct scst_cmd *cmd, void *val)
{
unsigned long flags;
spin_lock_irqsave(&scst_list_lock, flags);
cmd->tgt_specific = val;
cmd->tgt_priv = val;
spin_unlock_irqrestore(&scst_list_lock, flags);
}