Commit 0463a3fe authored by Asias He's avatar Asias He Committed by Nicholas Bellinger

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: default avatarAsias He <asias@redhat.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 86d71829
...@@ -192,6 +192,9 @@ static int fd_configure_device(struct se_device *dev) ...@@ -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. * the smaller WRITE_SAME(10) only has a two-byte block count.
*/ */
dev->dev_attrib.max_write_same_len = 0xFFFF; dev->dev_attrib.max_write_same_len = 0xFFFF;
if (blk_queue_nonrot(q))
dev->dev_attrib.is_nonrot = 1;
} else { } else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) { if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
pr_err("FILEIO: Missing fd_dev_size=" pr_err("FILEIO: Missing fd_dev_size="
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment