Author: mav
Date: Sat Oct 29 08:45:39 2016
New Revision: 308079
URL: https://svnweb.freebsd.org/changeset/base/308079

Log:
  MFC r307374: Add LU option to control reported provisioning type.

Modified:
  stable/10/sys/cam/ctl/ctl.c
  stable/10/usr.sbin/ctladm/ctladm.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl.c Sat Oct 29 08:45:06 2016        (r308078)
+++ stable/10/sys/cam/ctl/ctl.c Sat Oct 29 08:45:39 2016        (r308079)
@@ -10044,6 +10044,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
 {
        struct scsi_vpd_logical_block_prov *lbp_ptr;
        struct ctl_lun *lun;
+       const char *value;
 
        lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
@@ -10081,7 +10082,14 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
        if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) {
                lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 |
                    SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP;
-               lbp_ptr->prov_type = SVPD_LBP_THIN;
+               value = ctl_get_opt(&lun->be_lun->options, "provisioning_type");
+               if (value != NULL) {
+                       if (strcmp(value, "resource") == 0)
+                               lbp_ptr->prov_type = SVPD_LBP_RESOURCE;
+                       else if (strcmp(value, "thin") == 0)
+                               lbp_ptr->prov_type = SVPD_LBP_THIN;
+               } else
+                       lbp_ptr->prov_type = SVPD_LBP_THIN;
        }
 
        ctl_set_success(ctsio);

Modified: stable/10/usr.sbin/ctladm/ctladm.8
==============================================================================
--- stable/10/usr.sbin/ctladm/ctladm.8  Sat Oct 29 08:45:06 2016        
(r308078)
+++ stable/10/usr.sbin/ctladm/ctladm.8  Sat Oct 29 08:45:39 2016        
(r308079)
@@ -903,8 +903,14 @@ Specifies medium rotation rate of the de
 .It Va formfactor
 Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25",
 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8".
+.It Va provisioning_type
+When UNMAP support is enabled, this option specifies provisioning type:
+"resource", "thin" or "unknown".
+Default value is "thin".
+Logical units without UNMAP support are reported as fully provisioned.
 .It Va unmap
-Set to "on", enables UNMAP support for the LUN, if supported by the backend.
+Setting to "on" or "off" controls UNMAP support for the logical unit.
+Default value is "on" if supported by the backend.
 .It Va unmap_max_lba
 .It Va unmap_max_descr
 Specify maximum allowed number of LBAs and block descriptors per UNMAP
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to