Skip to content

Commit

Permalink
target/file: Set is_nonrot attribute
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Asias He authored and Nicholas Bellinger committed Apr 25, 2013
1 parent 86d7182 commit 0463a3f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/target/target_core_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand Down

0 comments on commit 0463a3f

Please sign in to comment.