From 5d14759c699406032befb22c18e02ed32d65539c Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 16 Apr 2014 02:24:44 +0000 Subject: [PATCH] Follow up for r5418: some cleanups and fixes git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5420 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 19 ++++++++++--------- scst/src/scst_targ.c | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index f073630dd..656780927 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1824,17 +1824,18 @@ static vdisk_op_fn nullio_ops[256] = { SHARED_OPS }; +#define VDISK_OPCODE_DESCRIPTORS \ + /* &scst_op_descr_get_lba_status, */ \ + &scst_op_descr_read_capacity16, \ + &scst_op_descr_write_same10, \ + &scst_op_descr_write_same16, \ + &scst_op_descr_unmap, \ + &scst_op_descr_format_unit, \ + &scst_op_descr_cwr, + static const struct scst_opcode_descriptor *vdisk_opcode_descriptors[] = { SHARED_OPCODE_DESCRIPTORS -#if 0 /* it's INVALID OPCODE currently */ - &scst_op_descr_get_lba_status, -#endif - &scst_op_descr_read_capacity16, - &scst_op_descr_write_same10, - &scst_op_descr_write_same16, - &scst_op_descr_unmap, - &scst_op_descr_format_unit, - &scst_op_descr_cwr, + VDISK_OPCODE_DESCRIPTORS SCST_OPCODE_DESCRIPTORS }; diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 2f824abeb..9090509d7 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -2229,7 +2229,7 @@ static int scst_report_supported_opcodes(struct scst_cmd *cmd) buf = address; inline_buf = true; } else { - buf = vzalloc(buf_len); /* it can be big */ + buf = vmalloc(buf_len); /* it can be big */ if (buf == NULL) { PRINT_ERROR("Unable to allocate REPORT SUPPORTED " "OPERATION CODES buffer with size %d", buf_len); @@ -2239,7 +2239,7 @@ static int scst_report_supported_opcodes(struct scst_cmd *cmd) inline_buf = false; } - memset(buf, 0, sizeof(buf)); + memset(buf, 0, buf_len); switch(options) { case 0: /* all */