From 9d1d74e7a86c319b0bd0d458c7a07f8abff86db9 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 13 Sep 2013 09:32:35 +0000 Subject: [PATCH] If vfs_readv()/vfs_writev() are used, loff will be adjusted automatically + cleanup git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5001 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 415896eb6..dfc41304b 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -838,6 +838,8 @@ static int vdisk_attach(struct scst_device *dev) goto out; } + virt_dev->dev = dev; + dev->block_shift = virt_dev->blk_shift; dev->block_size = 1 << dev->block_shift; @@ -848,8 +850,6 @@ static int vdisk_attach(struct scst_device *dev) goto out; } - virt_dev->dev = dev; - dev->dev_rd_only = virt_dev->rd_only; if (!virt_dev->cdrom_empty) { @@ -3741,7 +3741,6 @@ static enum compl_status_e fileio_exec_read(struct vdisk_cmd_params *p) if (finished) break; - loff += full_len; length = scst_get_buf_next(cmd, (uint8_t __force **)&address); }; @@ -3896,7 +3895,6 @@ restart: if (finished) break; - loff += saved_full_len; length = scst_get_buf_next(cmd, (uint8_t __force **)&address); }