From 5c5d93b15d2cf66d814e69413121dcf0bd40da31 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 7 May 2014 08:57:04 +0000 Subject: [PATCH] scst_vdisk: Build fix for kernel versions < 2.6.37 See also r5420 / r5479. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5506 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index fefe4c3be..8ca710993 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -990,6 +990,18 @@ out_overflow: goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) && !defined(RHEL_MAJOR) +/* + * See also patch "mm: add vzalloc() and vzalloc_node() helpers" (commit + * e1ca7788dec6773b1a2bce51b7141948f2b8bccf). + */ +static void *vzalloc(unsigned long size) +{ + return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, + PAGE_KERNEL); +} +#endif + static int vdev_save_mode_pages(const struct scst_vdisk_dev *virt_dev) { int res, rc, offs;