From e22a7f075226c51f3f71b922e9eeb4f99fac1475 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Tue, 5 Jul 2011 13:34:52 -0700 Subject: 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 Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- include/target/target_core_base.h | 1 + include/target/target_core_device.h | 1 + include/target/target_core_transport.h | 2 ++ 3 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index cd163dd94cd..81deb399bf6 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -661,6 +661,7 @@ struct se_dev_attrib { int emulate_reservations; int emulate_alua; int enforce_pr_isids; + int is_nonrot; u32 hw_block_size; u32 block_size; u32 hw_max_sectors; diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h index 96586cc9498..f3b6ae65545 100644 --- a/include/target/target_core_device.h +++ b/include/target/target_core_device.h @@ -39,6 +39,7 @@ extern int se_dev_set_emulate_tas(struct se_device *, int); extern int se_dev_set_emulate_tpu(struct se_device *, int); extern int se_dev_set_emulate_tpws(struct se_device *, int); extern int se_dev_set_enforce_pr_isids(struct se_device *, int); +extern int se_dev_set_is_nonrot(struct se_device *, int); extern int se_dev_set_queue_depth(struct se_device *, u32); extern int se_dev_set_max_sectors(struct se_device *, u32); extern int se_dev_set_optimal_sectors(struct se_device *, u32); diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index 2aae7641237..b27ce1af698 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h @@ -101,6 +101,8 @@ #define DA_ENFORCE_PR_ISIDS 1 #define DA_STATUS_MAX_SECTORS_MIN 16 #define DA_STATUS_MAX_SECTORS_MAX 8192 +/* By default don't report non-rotating (solid state) medium */ +#define DA_IS_NONROT 0 #define SE_MODE_PAGE_BUF 512 -- cgit v1.2.3-70-g09d2