mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-21 20:51:27 +00:00
Removed superfluous casts.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3091 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -394,7 +394,7 @@ static void dev_user_free_ucmd(struct scst_user_cmd *ucmd)
|
||||
static struct page *dev_user_alloc_pages(struct scatterlist *sg,
|
||||
gfp_t gfp_mask, void *priv)
|
||||
{
|
||||
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)priv;
|
||||
struct scst_user_cmd *ucmd = priv;
|
||||
int offset = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -497,7 +497,7 @@ static void __dev_user_free_sg_entries(struct scst_user_cmd *ucmd)
|
||||
static void dev_user_free_sg_entries(struct scatterlist *sg, int sg_count,
|
||||
void *priv)
|
||||
{
|
||||
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)priv;
|
||||
struct scst_user_cmd *ucmd = priv;
|
||||
|
||||
TRACE_MEM("Freeing data pages (sg=%p, sg_count=%d, priv %p)", sg,
|
||||
sg_count, ucmd);
|
||||
@@ -550,7 +550,7 @@ static int dev_user_alloc_sg(struct scst_user_cmd *ucmd, int cached_buff)
|
||||
|
||||
if (cmd->data_direction != SCST_DATA_BIDI) {
|
||||
orig_bufflen = cmd->bufflen;
|
||||
pool = (struct sgv_pool *)cmd->tgt_dev->dh_priv;
|
||||
pool = cmd->tgt_dev->dh_priv;
|
||||
} else {
|
||||
/* Make out_sg->offset 0 */
|
||||
int len = cmd->bufflen + ucmd->first_page_offset;
|
||||
@@ -586,8 +586,7 @@ static int dev_user_alloc_sg(struct scst_user_cmd *ucmd, int cached_buff)
|
||||
cmd->sg = sgv_pool_alloc(pool, bufflen, gfp_mask, flags, &cmd->sg_cnt,
|
||||
&ucmd->sgv, &dev->udev_mem_lim, ucmd);
|
||||
if (cmd->sg != NULL) {
|
||||
struct scst_user_cmd *buf_ucmd =
|
||||
(struct scst_user_cmd *)sgv_get_priv(ucmd->sgv);
|
||||
struct scst_user_cmd *buf_ucmd = sgv_get_priv(ucmd->sgv);
|
||||
|
||||
TRACE_MEM("Buf ucmd %p (cmd->sg_cnt %d, last seg len %d, "
|
||||
"last_len %d, bufflen %d)", buf_ucmd, cmd->sg_cnt,
|
||||
@@ -734,7 +733,7 @@ out:
|
||||
|
||||
static int dev_user_get_block(struct scst_cmd *cmd)
|
||||
{
|
||||
struct scst_user_dev *dev = (struct scst_user_dev *)cmd->dev->dh_priv;
|
||||
struct scst_user_dev *dev = cmd->dev->dh_priv;
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
@@ -748,7 +747,7 @@ static int dev_user_parse(struct scst_cmd *cmd)
|
||||
int rc, res = SCST_CMD_STATE_DEFAULT;
|
||||
struct scst_user_cmd *ucmd;
|
||||
int atomic = scst_cmd_atomic(cmd);
|
||||
struct scst_user_dev *dev = (struct scst_user_dev *)cmd->dev->dh_priv;
|
||||
struct scst_user_dev *dev = cmd->dev->dh_priv;
|
||||
gfp_t gfp_mask = atomic ? GFP_ATOMIC : GFP_KERNEL;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -767,7 +766,7 @@ static int dev_user_parse(struct scst_cmd *cmd)
|
||||
ucmd->cmd = cmd;
|
||||
cmd->dh_priv = ucmd;
|
||||
} else {
|
||||
ucmd = (struct scst_user_cmd *)cmd->dh_priv;
|
||||
ucmd = cmd->dh_priv;
|
||||
TRACE_DBG("Used ucmd %p, state %x", ucmd, ucmd->state);
|
||||
}
|
||||
|
||||
@@ -863,7 +862,7 @@ out_error:
|
||||
static int dev_user_alloc_data_buf(struct scst_cmd *cmd)
|
||||
{
|
||||
int res = SCST_CMD_STATE_DEFAULT;
|
||||
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)cmd->dh_priv;
|
||||
struct scst_user_cmd *ucmd = cmd->dh_priv;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -918,7 +917,7 @@ out:
|
||||
|
||||
static int dev_user_exec(struct scst_cmd *cmd)
|
||||
{
|
||||
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)cmd->dh_priv;
|
||||
struct scst_user_cmd *ucmd = cmd->dh_priv;
|
||||
int res = SCST_EXEC_COMPLETED;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -978,7 +977,7 @@ static void dev_user_free_sgv(struct scst_user_cmd *ucmd)
|
||||
|
||||
static void dev_user_on_free_cmd(struct scst_cmd *cmd)
|
||||
{
|
||||
struct scst_user_cmd *ucmd = (struct scst_user_cmd *)cmd->dh_priv;
|
||||
struct scst_user_cmd *ucmd = cmd->dh_priv;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -1030,7 +1029,7 @@ out_reply:
|
||||
|
||||
static void dev_user_set_block(struct scst_cmd *cmd, int block)
|
||||
{
|
||||
struct scst_user_dev *dev = (struct scst_user_dev *)cmd->dev->dh_priv;
|
||||
struct scst_user_dev *dev = cmd->dev->dh_priv;
|
||||
/*
|
||||
* No need for locks here, since *_detach() can not be
|
||||
* called, when there are existing commands.
|
||||
@@ -1631,7 +1630,7 @@ static int dev_user_reply_cmd(struct file *file, void __user *arg)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (unlikely(res != 0)) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -1674,7 +1673,7 @@ static int dev_user_get_ext_cdb(struct file *file, void __user *arg)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (unlikely(res != 0)) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -1919,7 +1918,7 @@ static int dev_user_reply_get_cmd(struct file *file, void __user *arg)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (unlikely(res != 0)) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -2127,7 +2126,7 @@ static unsigned int dev_user_poll(struct file *file, poll_table *wait)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (unlikely(res != 0)) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -2410,8 +2409,7 @@ static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
struct scst_tgt_dev *tgt_dev)
|
||||
{
|
||||
struct scst_user_cmd *ucmd;
|
||||
struct scst_user_dev *dev =
|
||||
(struct scst_user_dev *)tgt_dev->dev->dh_priv;
|
||||
struct scst_user_dev *dev = tgt_dev->dev->dh_priv;
|
||||
struct scst_user_cmd *ucmd_to_abort = NULL;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -2470,8 +2468,7 @@ static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
ucmd->user_cmd.tm_cmd.cmd_sn_set = mcmd->cmd_sn_set;
|
||||
|
||||
if (mcmd->cmd_to_abort != NULL) {
|
||||
ucmd_to_abort =
|
||||
(struct scst_user_cmd *)mcmd->cmd_to_abort->dh_priv;
|
||||
ucmd_to_abort = mcmd->cmd_to_abort->dh_priv;
|
||||
if (ucmd_to_abort != NULL)
|
||||
ucmd->user_cmd.tm_cmd.cmd_h_to_abort = ucmd_to_abort->h;
|
||||
}
|
||||
@@ -2533,7 +2530,7 @@ out:
|
||||
|
||||
static void dev_user_detach(struct scst_device *sdev)
|
||||
{
|
||||
struct scst_user_dev *dev = (struct scst_user_dev *)sdev->dh_priv;
|
||||
struct scst_user_dev *dev = sdev->dh_priv;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -2582,8 +2579,7 @@ static int dev_user_process_reply_sess(struct scst_user_cmd *ucmd, int status)
|
||||
|
||||
static int dev_user_attach_tgt(struct scst_tgt_dev *tgt_dev)
|
||||
{
|
||||
struct scst_user_dev *dev =
|
||||
(struct scst_user_dev *)tgt_dev->dev->dh_priv;
|
||||
struct scst_user_dev *dev = tgt_dev->dev->dh_priv;
|
||||
int res = 0, rc;
|
||||
struct scst_user_cmd *ucmd;
|
||||
DECLARE_COMPLETION_ONSTACK(cmpl);
|
||||
@@ -2671,8 +2667,7 @@ out_nomem:
|
||||
|
||||
static void dev_user_detach_tgt(struct scst_tgt_dev *tgt_dev)
|
||||
{
|
||||
struct scst_user_dev *dev =
|
||||
(struct scst_user_dev *)tgt_dev->dev->dh_priv;
|
||||
struct scst_user_dev *dev = tgt_dev->dev->dh_priv;
|
||||
struct scst_user_cmd *ucmd;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -3016,7 +3011,7 @@ static int dev_user_unregister_dev(struct file *file)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (res != 0) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -3032,7 +3027,7 @@ static int dev_user_unregister_dev(struct file *file)
|
||||
up_read(&dev->dev_rwsem);
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
if (dev == NULL) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
goto out_resume;
|
||||
@@ -3071,7 +3066,7 @@ static int dev_user_flush_cache(struct file *file)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (res != 0) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -3105,7 +3100,7 @@ static int dev_user_capacity_changed(struct file *file)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (res != 0) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -3138,7 +3133,7 @@ static int dev_user_prealloc_buffer(struct file *file, void __user *arg)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (unlikely(res != 0)) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -3190,8 +3185,7 @@ static int dev_user_prealloc_buffer(struct file *file, void __user *arg)
|
||||
sg = sgv_pool_alloc(pool, bufflen, GFP_KERNEL, SGV_POOL_ALLOC_GET_NEW,
|
||||
&sg_cnt, &ucmd->sgv, &dev->udev_mem_lim, ucmd);
|
||||
if (sg != NULL) {
|
||||
struct scst_user_cmd *buf_ucmd =
|
||||
(struct scst_user_cmd *)sgv_get_priv(ucmd->sgv);
|
||||
struct scst_user_cmd *buf_ucmd = sgv_get_priv(ucmd->sgv);
|
||||
|
||||
TRACE_MEM("Buf ucmd %p (sg_cnt %d, last seg len %d, "
|
||||
"bufflen %d)", buf_ucmd, sg_cnt,
|
||||
@@ -3299,7 +3293,7 @@ static int dev_user_set_opt(struct file *file, const struct scst_user_opt *opt)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (res != 0) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -3333,7 +3327,7 @@ static int dev_user_get_opt(struct file *file, void __user *arg)
|
||||
TRACE_ENTRY();
|
||||
|
||||
mutex_lock(&dev_priv_mutex);
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
res = dev_user_check_reg(dev);
|
||||
if (res != 0) {
|
||||
mutex_unlock(&dev_priv_mutex);
|
||||
@@ -3430,7 +3424,7 @@ static int dev_user_exit_dev(struct scst_user_dev *dev)
|
||||
|
||||
static int __dev_user_release(void *arg)
|
||||
{
|
||||
struct scst_user_dev *dev = (struct scst_user_dev *)arg;
|
||||
struct scst_user_dev *dev = arg;
|
||||
dev_user_exit_dev(dev);
|
||||
kfree(dev);
|
||||
return 0;
|
||||
@@ -3443,7 +3437,7 @@ static int dev_user_release(struct inode *inode, struct file *file)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = (struct scst_user_dev *)file->private_data;
|
||||
dev = file->private_data;
|
||||
if (dev == NULL)
|
||||
goto out;
|
||||
file->private_data = NULL;
|
||||
@@ -3537,7 +3531,7 @@ static ssize_t dev_user_sysfs_commands_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
udev = (struct scst_user_dev *)dev->dh_priv;
|
||||
udev = dev->dh_priv;
|
||||
|
||||
spin_lock_irqsave(&udev->udev_cmd_threads.cmd_list_lock, flags);
|
||||
for (i = 0; i < (int)ARRAY_SIZE(udev->ucmd_hash); i++) {
|
||||
|
||||
@@ -852,8 +852,7 @@ out:
|
||||
/* scst_mutex supposed to be held */
|
||||
static void vdisk_detach(struct scst_device *dev)
|
||||
{
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -891,8 +890,7 @@ static struct scst_vdisk_thr *vdisk_init_thr_data(
|
||||
struct scst_tgt_dev *tgt_dev)
|
||||
{
|
||||
struct scst_vdisk_thr *res;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)tgt_dev->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = tgt_dev->dev->dh_priv;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -963,8 +961,7 @@ static int vdisk_do_job(struct scst_cmd *cmd)
|
||||
loff_t loff;
|
||||
struct scst_device *dev = cmd->dev;
|
||||
struct scst_tgt_dev *tgt_dev = cmd->tgt_dev;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
struct scst_thr_data_hdr *d;
|
||||
struct scst_vdisk_thr *thr = NULL;
|
||||
int fua = 0;
|
||||
@@ -1221,8 +1218,7 @@ out_thr:
|
||||
|
||||
static int vdisk_get_block_shift(struct scst_cmd *cmd)
|
||||
{
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
return virt_dev->block_shift;
|
||||
}
|
||||
|
||||
@@ -1242,8 +1238,7 @@ static int vcdrom_exec(struct scst_cmd *cmd)
|
||||
{
|
||||
int res = SCST_EXEC_COMPLETED;
|
||||
int opcode = cmd->cdb[0];
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -1302,8 +1297,7 @@ static uint64_t vdisk_gen_dev_id_num(const char *virt_dev_name)
|
||||
|
||||
static void vdisk_exec_unmap(struct scst_cmd *cmd, struct scst_vdisk_thr *thr)
|
||||
{
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
ssize_t length = 0;
|
||||
struct file *fd = thr->fd;
|
||||
struct inode *inode;
|
||||
@@ -1436,8 +1430,7 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd)
|
||||
int32_t length, i, resp_len = 0;
|
||||
uint8_t *address;
|
||||
uint8_t *buf;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
|
||||
/* ToDo: Performance Boost:
|
||||
* 1. remove kzalloc, buf
|
||||
@@ -1938,7 +1931,7 @@ static void vdisk_exec_mode_sense(struct scst_cmd *cmd)
|
||||
goto out;
|
||||
}
|
||||
|
||||
virt_dev = (struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
virt_dev = cmd->dev->dh_priv;
|
||||
blocksize = virt_dev->block_size;
|
||||
nblocks = virt_dev->nblocks;
|
||||
|
||||
@@ -2129,7 +2122,7 @@ static void vdisk_exec_mode_select(struct scst_cmd *cmd)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
virt_dev = (struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
virt_dev = cmd->dev->dh_priv;
|
||||
mselect_6 = (MODE_SELECT == cmd->cdb[0]);
|
||||
|
||||
length = scst_get_buf_first(cmd, &address);
|
||||
@@ -2240,7 +2233,7 @@ static void vdisk_exec_read_capacity(struct scst_cmd *cmd)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
virt_dev = (struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
virt_dev = cmd->dev->dh_priv;
|
||||
blocksize = virt_dev->block_size;
|
||||
nblocks = virt_dev->nblocks;
|
||||
|
||||
@@ -2313,7 +2306,7 @@ static void vdisk_exec_read_capacity16(struct scst_cmd *cmd)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
virt_dev = (struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
virt_dev = cmd->dev->dh_priv;
|
||||
blocksize = virt_dev->block_size;
|
||||
nblocks = virt_dev->nblocks - 1;
|
||||
|
||||
@@ -2439,7 +2432,7 @@ static void vdisk_exec_read_toc(struct scst_cmd *cmd)
|
||||
goto out;
|
||||
}
|
||||
|
||||
virt_dev = (struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
virt_dev = cmd->dev->dh_priv;
|
||||
/* ToDo when you have > 8TB ROM device. */
|
||||
nblocks = (uint32_t)virt_dev->nblocks;
|
||||
|
||||
@@ -2488,8 +2481,7 @@ out:
|
||||
|
||||
static void vdisk_exec_prevent_allow_medium_removal(struct scst_cmd *cmd)
|
||||
{
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
|
||||
TRACE_DBG("PERSIST/PREVENT 0x%02x", cmd->cdb[4]);
|
||||
|
||||
@@ -2504,8 +2496,7 @@ static int vdisk_fsync(struct scst_vdisk_thr *thr, loff_t loff,
|
||||
loff_t len, struct scst_cmd *cmd, struct scst_device *dev)
|
||||
{
|
||||
int res = 0;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
struct file *file;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -2574,8 +2565,7 @@ static void vdisk_exec_read(struct scst_cmd *cmd,
|
||||
loff_t err;
|
||||
ssize_t length, full_len;
|
||||
uint8_t __user *address;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
struct file *fd = thr->fd;
|
||||
struct iovec *iv;
|
||||
int iv_count, i;
|
||||
@@ -2689,8 +2679,7 @@ static void vdisk_exec_write(struct scst_cmd *cmd,
|
||||
loff_t err;
|
||||
ssize_t length, full_len, saved_full_len;
|
||||
uint8_t __user *address;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
struct file *fd = thr->fd;
|
||||
struct iovec *iv, *eiv;
|
||||
int i, iv_count, eiv_count;
|
||||
@@ -2904,8 +2893,7 @@ static void blockio_endio(struct bio *bio, int error)
|
||||
static void blockio_exec_rw(struct scst_cmd *cmd, struct scst_vdisk_thr *thr,
|
||||
u64 lba_start, int write)
|
||||
{
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
struct block_device *bdev = thr->bdev;
|
||||
struct request_queue *q = bdev_get_queue(bdev);
|
||||
int length, max_nr_vecs = 0, offset;
|
||||
@@ -3078,8 +3066,7 @@ static void vdisk_exec_verify(struct scst_cmd *cmd,
|
||||
ssize_t length, len_mem = 0;
|
||||
uint8_t *address_sav, *address;
|
||||
int compare;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)cmd->dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv;
|
||||
struct file *fd = thr->fd;
|
||||
uint8_t *mem_verify = NULL;
|
||||
|
||||
@@ -3194,8 +3181,7 @@ static int vdisk_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
if ((mcmd->fn == SCST_LUN_RESET) || (mcmd->fn == SCST_TARGET_RESET)) {
|
||||
/* Restore default values */
|
||||
struct scst_device *dev = tgt_dev->dev;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
|
||||
dev->tst = DEF_TST;
|
||||
dev->d_sense = DEF_DSENSE;
|
||||
@@ -3211,8 +3197,7 @@ static int vdisk_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
|
||||
spin_unlock(&virt_dev->flags_lock);
|
||||
} else if (mcmd->fn == SCST_PR_ABORT_ALL) {
|
||||
struct scst_device *dev = tgt_dev->dev;
|
||||
struct scst_vdisk_dev *virt_dev =
|
||||
(struct scst_vdisk_dev *)dev->dh_priv;
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
spin_lock(&virt_dev->flags_lock);
|
||||
virt_dev->prevent_allow_medium_removal = 0;
|
||||
spin_unlock(&virt_dev->flags_lock);
|
||||
@@ -4035,7 +4020,7 @@ static int vcdrom_sysfs_process_filename_store(struct scst_sysfs_work_item *work
|
||||
TRACE_ENTRY();
|
||||
|
||||
/* It's safe, since we taken dev_kobj and dh_priv NULLed in attach() */
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
res = vcdrom_change(virt_dev, work->buf);
|
||||
|
||||
@@ -4098,7 +4083,7 @@ static ssize_t vdev_sysfs_size_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%lld\n", virt_dev->file_size / 1024 / 1024);
|
||||
|
||||
@@ -4116,7 +4101,7 @@ static ssize_t vdisk_sysfs_blocksize_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%d\n%s", (int)virt_dev->block_size,
|
||||
(virt_dev->block_size == DEF_DISK_BLOCKSIZE) ? "" :
|
||||
@@ -4136,7 +4121,7 @@ static ssize_t vdisk_sysfs_rd_only_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%d\n%s", virt_dev->rd_only ? 1 : 0,
|
||||
(virt_dev->rd_only == DEF_RD_ONLY) ? "" :
|
||||
@@ -4156,7 +4141,7 @@ static ssize_t vdisk_sysfs_wt_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%d\n%s", virt_dev->wt_flag ? 1 : 0,
|
||||
(virt_dev->wt_flag == DEF_WRITE_THROUGH) ? "" :
|
||||
@@ -4176,7 +4161,7 @@ static ssize_t vdisk_sysfs_tp_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%d\n%s", virt_dev->thin_provisioned ? 1 : 0,
|
||||
(virt_dev->thin_provisioned == DEF_THIN_PROVISIONED) ? "" :
|
||||
@@ -4196,7 +4181,7 @@ static ssize_t vdisk_sysfs_nv_cache_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%d\n%s", virt_dev->nv_cache ? 1 : 0,
|
||||
(virt_dev->nv_cache == DEF_NV_CACHE) ? "" :
|
||||
@@ -4216,7 +4201,7 @@ static ssize_t vdisk_sysfs_o_direct_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%d\n%s", virt_dev->o_direct_flag ? 1 : 0,
|
||||
(virt_dev->o_direct_flag == DEF_O_DIRECT) ? "" :
|
||||
@@ -4236,7 +4221,7 @@ static ssize_t vdisk_sysfs_removable_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%d\n", virt_dev->removable ? 1 : 0);
|
||||
|
||||
@@ -4263,7 +4248,7 @@ static int vdev_sysfs_process_get_filename(struct scst_sysfs_work_item *work)
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
if (virt_dev == NULL)
|
||||
goto out_unlock;
|
||||
@@ -4331,7 +4316,7 @@ static int vdisk_sysfs_process_resync_size_store(
|
||||
TRACE_ENTRY();
|
||||
|
||||
/* It's safe, since we taken dev_kobj and dh_priv NULLed in attach() */
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
res = vdisk_resync_size(virt_dev);
|
||||
|
||||
@@ -4380,7 +4365,7 @@ static ssize_t vdev_sysfs_t10_dev_id_store(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
write_lock_bh(&vdisk_t10_dev_id_rwlock);
|
||||
|
||||
@@ -4429,7 +4414,7 @@ static ssize_t vdev_sysfs_t10_dev_id_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock_bh(&vdisk_t10_dev_id_rwlock);
|
||||
pos = sprintf(buf, "%s\n%s", virt_dev->t10_dev_id,
|
||||
@@ -4450,7 +4435,7 @@ static ssize_t vdev_sysfs_usn_show(struct kobject *kobj,
|
||||
TRACE_ENTRY();
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = (struct scst_vdisk_dev *)dev->dh_priv;
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
pos = sprintf(buf, "%s\n", virt_dev->usn);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user