From 80d2dac38ef7e92840cf0553f57466d510869133 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 14 May 2020 16:27:32 +0000 Subject: [PATCH] vdisk_blockio: Remove support for unaligned buffers Submitting an unaligned buffer is a bug. Additionally, the patch that added support for unaligned buffers negatively affected performance of the ib_srpt and scst_local drivers. This patch reverts 85f8ac3a1e8a ("vdisk_blockio: Add support for unaligned buffers"). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8911 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 33 ------------------------------ 1 file changed, 33 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 31a3b3062..60cc939e8 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3310,14 +3310,6 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p) } #endif -static void blockio_on_free_cmd(struct scst_cmd *cmd) -{ - if (!scst_cmd_get_dh_data_buff_alloced(cmd)) - return; - sgv_pool_free(cmd->sgv, &cmd->dev->dev_mem_lim); - cmd->sgv = NULL; -} - static void vdisk_on_free_cmd_params(const struct vdisk_cmd_params *p) { if (!p->execute_async) { @@ -3409,29 +3401,6 @@ out: return res; } -static int blockio_alloc(struct scst_cmd *cmd) -{ - struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; - struct sgv_pool *pool = tgt_dev->pools[raw_smp_processor_id()]; - int res = SCST_CMD_STATE_DEFAULT; - - if (cmd->sg && (cmd->sg->offset & 511) == 0) - return res; - - WARN_ON_ONCE(cmd->sgv); - cmd->sg = sgv_pool_alloc(pool, cmd->bufflen, cmd->cmd_gfp_mask, 0, - &cmd->sg_cnt, &cmd->sgv, - &cmd->dev->dev_mem_lim, NULL); - if (!cmd->sg) { - res = SCST_CMD_STATE_STOP; - goto out; - } - scst_cmd_set_dh_data_buff_alloced(cmd); - -out: - return res; -} - static enum scst_exec_res blockio_exec(struct scst_cmd *cmd) { struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv; @@ -9921,9 +9890,7 @@ static struct scst_dev_type vdisk_blk_devtype = { .attach_tgt = vdisk_attach_tgt, .detach_tgt = vdisk_detach_tgt, .parse = non_fileio_parse, - .dev_alloc_data_buf = blockio_alloc, .exec = blockio_exec, - .on_free_cmd = blockio_on_free_cmd, .on_alua_state_change_start = blockio_on_alua_state_change_start, .on_alua_state_change_finish = blockio_on_alua_state_change_finish, .task_mgmt_fn_done = vdisk_task_mgmt_fn_done,