diff options
author | Roland Dreier <roland@purestorage.com> | 2011-07-05 16:34:52 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-22 05:37:47 -0400 |
commit | e22a7f075226c51f3f71b922e9eeb4f99fac1475 (patch) | |
tree | e0a04f974153136eafe13793ee59be58c37c5ffc /drivers/target/target_core_iblock.c | |
parent | b2eb705e00a9b9a9b3122192a7ab3e9058f0c48a (diff) |
target: Implement Block Device Characteristics VPD page
Implement page B1h, Block Device Characteristics, so that we can report
a medium rotation rate of 1 (non-rotating / solid state) if the
is_nonrot device attribute is set; we update the iblock backend to set
this attribute if the underlying Linux block device has its nonrot
flag set.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_iblock.c')
-rw-r--r-- | drivers/target/target_core_iblock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 160c484fd3da..392e75fb1087 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c | |||
@@ -196,6 +196,9 @@ static struct se_device *iblock_create_virtdevice( | |||
196 | " disabled by default\n"); | 196 | " disabled by default\n"); |
197 | } | 197 | } |
198 | 198 | ||
199 | if (blk_queue_nonrot(q)) | ||
200 | dev->se_sub_dev->se_dev_attrib.is_nonrot = 1; | ||
201 | |||
199 | return dev; | 202 | return dev; |
200 | 203 | ||
201 | failed: | 204 | failed: |