From owner-svn-src-stable@FreeBSD.ORG Wed Jan 29 02:38:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C53C65A9; Wed, 29 Jan 2014 02:38:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B16BC12A3; Wed, 29 Jan 2014 02:38:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0T2cPxJ002782; Wed, 29 Jan 2014 02:38:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0T2cPKs002781; Wed, 29 Jan 2014 02:38:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201401290238.s0T2cPKs002781@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 Jan 2014 02:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261255 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2014 02:38:25 -0000 Author: mav Date: Wed Jan 29 02:38:25 2014 New Revision: 261255 URL: http://svnweb.freebsd.org/changeset/base/261255 Log: MFC r260267 (by smh), r261042: Correct short delete issue in SCSI UNMAP support Correct missing \n's in xpt_print's Correct incorrect count being passed to short delete xpt_print Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Tue Jan 28 23:40:02 2014 (r261254) +++ stable/10/sys/cam/scsi/scsi_da.c Wed Jan 29 02:38:25 2014 (r261255) @@ -211,7 +211,7 @@ struct da_softc { int delete_running; int delete_available; /* Delete methods possibly available */ uint32_t unmap_max_ranges; - uint32_t unmap_max_lba; + uint32_t unmap_max_lba; /* Max LBAs in UNMAP req */ uint64_t ws_max_blks; da_delete_methods delete_method; da_delete_func_t *delete_func; @@ -1246,7 +1246,7 @@ daopen(struct disk *dp) error = cam_periph_sleep(periph, &softc->disk->d_mediasize, PRIBIO, "dareprobe", 0); if (error != 0) - xpt_print(periph->path, "unable to retrieve capacity data"); + xpt_print(periph->path, "unable to retrieve capacity data\n"); if (periph->flags & CAM_PERIPH_INVALID) error = ENXIO; @@ -1854,7 +1854,7 @@ dadeletemaxsize(struct da_softc *softc, switch(delete_method) { case DA_DELETE_UNMAP: - sectors = (off_t)softc->unmap_max_lba * softc->unmap_max_ranges; + sectors = (off_t)softc->unmap_max_lba; break; case DA_DELETE_ATA_TRIM: sectors = (off_t)ATA_DSM_RANGE_MAX * softc->trim_max_ranges; @@ -2553,7 +2553,7 @@ da_delete_unmap(struct cam_periph *perip /* Try to extend the previous range. */ if (lba == lastlba) { - c = min(count, softc->unmap_max_lba - lastcount); + c = omin(count, UNMAP_RANGE_MAX - lastcount); lastcount += c; off = ((ranges - 1) * UNMAP_RANGE_SIZE) + UNMAP_HEAD_SIZE; @@ -2564,7 +2564,7 @@ da_delete_unmap(struct cam_periph *perip } while (count > 0) { - c = min(count, softc->unmap_max_lba); + c = omin(count, UNMAP_RANGE_MAX); if (totalcount + c > softc->unmap_max_lba || ranges >= softc->unmap_max_ranges) { xpt_print(periph->path, @@ -2659,7 +2659,7 @@ da_delete_trim(struct cam_periph *periph lastcount = c; if (count != 0 && ranges == softc->trim_max_ranges) { xpt_print(periph->path, - "%s issuing short delete %ld > %ld", + "%s issuing short delete %ld > %ld\n", da_delete_method_desc[softc->delete_method], requestcount, (softc->trim_max_ranges - ranges) * @@ -2691,7 +2691,7 @@ da_delete_trim(struct cam_periph *periph /* * We calculate ws_max_blks here based off d_delmaxsize instead * of using softc->ws_max_blks as it is absolute max for the - * device not the protocol max which may well be lower + * device not the protocol max which may well be lower. */ static void da_delete_ws(struct cam_periph *periph, union ccb *ccb, struct bio *bp) @@ -2714,11 +2714,11 @@ da_delete_ws(struct cam_periph *periph, bioq_insert_tail(&softc->delete_run_queue, bp1); count += bp1->bio_bcount / softc->params.secsize; if (count > ws_max_blks) { - count = min(count, ws_max_blks); xpt_print(periph->path, - "%s issuing short delete %ld > %ld", + "%s issuing short delete %ld > %ld\n", da_delete_method_desc[softc->delete_method], count, ws_max_blks); + count = min(count, ws_max_blks); break; } bp1 = bioq_first(&softc->delete_queue);