aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_backend.h
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2014-04-08 20:50:48 +0000
committerAlexander Motin <mav@FreeBSD.org>2014-04-08 20:50:48 +0000
commitee7f31c068884c5792903b21c91f83cd08b76893 (patch)
tree95a3cc931da8a5065180b81740f088c57be28b04 /sys/cam/ctl/ctl_backend.h
parent5e9d46791b1609b6798a5511e707da5c4d6997b9 (diff)
downloadsrc-ee7f31c068884c5792903b21c91f83cd08b76893.tar.gz
src-ee7f31c068884c5792903b21c91f83cd08b76893.zip
Add support for SCSI UNMAP commands to CTL.
This patch adds support for three new SCSI commands: UNMAP, WRITE SAME(10) and WRITE SAME(16). WRITE SAME commands support both normal write mode and UNMAP flag. To properly report UNMAP capabilities this patch also adds support for reporting two new VPD pages: Block limits and Logical Block Provisioning. UNMAP support can be enabled per-LUN by adding "-o unmap=on" to `ctladm create` command line or "option unmap on" to lun sections of /etc/ctl.conf. At this moment UNMAP supported for ramdisks and device-backed block LUNs. It was tested to work great with ZFS ZVOLs. For file-backed LUNs UNMAP support is unfortunately missing due to absence of respective VFS KPI. Reviewed by: ken MFC after: 1 month Sponsored by: iXsystems, Inc
Notes
Notes: svn path=/head/; revision=264274
Diffstat (limited to 'sys/cam/ctl/ctl_backend.h')
-rw-r--r--sys/cam/ctl/ctl_backend.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl_backend.h b/sys/cam/ctl/ctl_backend.h
index c64492d52094..ad93119afc97 100644
--- a/sys/cam/ctl/ctl_backend.h
+++ b/sys/cam/ctl/ctl_backend.h
@@ -71,6 +71,8 @@
* valid for use in SCSI INQUIRY VPD page 0x83.
*
* The DEV_TYPE flag tells us that the device_type field is filled in.
+ *
+ * The UNMAP flag tells us that this LUN supports UNMAP.
*/
typedef enum {
CTL_LUN_FLAG_ID_REQ = 0x01,
@@ -79,7 +81,8 @@ typedef enum {
CTL_LUN_FLAG_PRIMARY = 0x08,
CTL_LUN_FLAG_SERIAL_NUM = 0x10,
CTL_LUN_FLAG_DEVID = 0x20,
- CTL_LUN_FLAG_DEV_TYPE = 0x40
+ CTL_LUN_FLAG_DEV_TYPE = 0x40,
+ CTL_LUN_FLAG_UNMAP = 0x80
} ctl_backend_lun_flags;
#ifdef _KERNEL