summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2013-05-29 01:55:21 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2013-06-14 09:27:36 +0200
commit670caa9f762647802a1b19749f127ac28949ca5a (patch)
treefb1f2efecba04a83708c70c7e8b3fb96aa084fd2 /drivers/target
parenttarget: Make virtual_lun0 a nullio device (diff)
downloadlinux-670caa9f762647802a1b19749f127ac28949ca5a.tar.xz
linux-670caa9f762647802a1b19749f127ac28949ca5a.zip
target: Don't allocate pages for NULLIO devices
Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_rd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 0921a64b5550..51127d15d5c5 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -139,6 +139,11 @@ static int rd_build_device_space(struct rd_dev *rd_dev)
rd_dev->rd_page_count);
return -EINVAL;
}
+
+ /* Don't need backing pages for NULLIO */
+ if (rd_dev->rd_flags & RDF_NULLIO)
+ return 0;
+
total_sg_needed = rd_dev->rd_page_count;
sg_tables = (total_sg_needed / max_sg_per_table) + 1;