From 9c7b81617946031584eb91b44e01431afda3d395 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 13 Apr 2017 23:53:35 +0000 Subject: [PATCH] scst_vdisk: move declarations inside #ifdef Move some #ifdefs to also cover declarations used only inside the #ifdef. This is to avoid compiler warnings about unused variables. Signed-off-by: David Butterfield git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7121 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 4bf745e7c..8375281e0 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1077,12 +1077,12 @@ check: #endif if (virt_dev->blockio) { +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32) || \ + (defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 6) struct request_queue *q; sBUG_ON(!fd_open); q = bdev_get_queue(file_inode(fd)->i_bdev); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32) || \ - (defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 6) virt_dev->unmap_opt_gran = q->limits.discard_granularity >> block_shift; virt_dev->unmap_align = q->limits.discard_alignment >> block_shift; if (virt_dev->unmap_opt_gran == virt_dev->unmap_align) @@ -7887,6 +7887,8 @@ static void vdev_destroy(struct scst_vdisk_dev *virt_dev) return; } +#ifndef CONFIG_SCST_PROC + static void vdev_check_node(struct scst_vdisk_dev **pvirt_dev, int orig_nodeid) { struct scst_vdisk_dev *virt_dev = *pvirt_dev; @@ -7914,8 +7916,6 @@ out: return; } -#ifndef CONFIG_SCST_PROC - static int vdev_parse_add_dev_params(struct scst_vdisk_dev *virt_dev, char *params, const char *const allowed_params[]) {