summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorAsias He <asias@redhat.com>2013-04-25 04:38:11 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2013-04-25 10:05:25 +0200
commit0463a3fefda4cf0591edc685d4fb215a33315e01 (patch)
treec29245da85b2a39428997c88888630c3f64ca0ce /drivers/target
parenttarget: Add sbc_execute_unmap() helper (diff)
downloadlinux-0463a3fefda4cf0591edc685d4fb215a33315e01.tar.xz
linux-0463a3fefda4cf0591edc685d4fb215a33315e01.zip
target/file: Set is_nonrot attribute
Set is_nonrot attribute according to the block queue if the backend device is a block device. Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 9063c31df9e1..58ed683e04ae 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -192,6 +192,9 @@ static int fd_configure_device(struct se_device *dev)
* the smaller WRITE_SAME(10) only has a two-byte block count.
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
+
+ if (blk_queue_nonrot(q))
+ dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
pr_err("FILEIO: Missing fd_dev_size="