From owner-svn-src-head@freebsd.org Sat Oct 15 14:40:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D98C13186; Sat, 15 Oct 2016 14:40:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A312BA40; Sat, 15 Oct 2016 14:40:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9FEeY6G077714; Sat, 15 Oct 2016 14:40:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FEeYZ0077712; Sat, 15 Oct 2016 14:40:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610151440.u9FEeYZ0077712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 15 Oct 2016 14:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307374 - in head: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 14:40:36 -0000 Author: mav Date: Sat Oct 15 14:40:34 2016 New Revision: 307374 URL: https://svnweb.freebsd.org/changeset/base/307374 Log: Add LU option to control reported provisioning type. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Oct 15 13:45:12 2016 (r307373) +++ head/sys/cam/ctl/ctl.c Sat Oct 15 14:40:34 2016 (r307374) @@ -10040,6 +10040,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; @@ -10077,7 +10078,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: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Sat Oct 15 13:45:12 2016 (r307373) +++ head/usr.sbin/ctladm/ctladm.8 Sat Oct 15 14:40:34 2016 (r307374) @@ -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