From fcb6ce06334dabd07f5c7a69b9f11e8adf709978 Mon Sep 17 00:00:00 2001 From: Lee Susman Date: Wed, 29 Jan 2014 18:29:29 +0200 Subject: [PATCH] block: add test bio size define to test-iosched Add a define for the test bio size (which is the size of a page), this is used for allocating the right sized buffer for the bio during test request creation. Change-Id: I9505c85c4352009bdee442172eb8ae8f4254cfb0 Signed-off-by: Lee Susman --- block/test-iosched.c | 4 ++-- include/linux/test-iosched.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/block/test-iosched.c b/block/test-iosched.c index a267e7a31152..9341bc163e95 100644 --- a/block/test-iosched.c +++ b/block/test-iosched.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -311,7 +311,7 @@ struct test_request *test_iosched_create_test_req(int is_err_expcted, return NULL; } - buf_size = sizeof(unsigned int) * BIO_U32_SIZE * num_bios; + buf_size = TEST_BIO_SIZE * num_bios; test_rq->bios_buffer = kzalloc(buf_size, GFP_KERNEL); if (!test_rq->bios_buffer) { pr_err("%s: Failed to allocate the data buf", __func__); diff --git a/include/linux/test-iosched.h b/include/linux/test-iosched.h index 36facf7e4053..47383ae0675c 100644 --- a/include/linux/test-iosched.h +++ b/include/linux/test-iosched.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -28,6 +28,7 @@ #define TEST_PATTERN_FF 0xFFFFFFFF #define TEST_NO_PATTERN 0xDEADBEEF #define BIO_U32_SIZE 1024 +#define TEST_BIO_SIZE PAGE_SIZE /* use one page bios */ struct test_data;