svn commit: r261256 - stable/9/sys/cam/scsi
Alexander Motin
mav at FreeBSD.org
Wed Jan 29 02:39:44 UTC 2014
Author: mav
Date: Wed Jan 29 02:39:44 2014
New Revision: 261256
URL: http://svnweb.freebsd.org/changeset/base/261256
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/9/sys/cam/scsi/scsi_da.c
Directory Properties:
stable/9/ (props changed)
stable/9/sys/ (props changed)
Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c Wed Jan 29 02:38:25 2014 (r261255)
+++ stable/9/sys/cam/scsi/scsi_da.c Wed Jan 29 02:39:44 2014 (r261256)
@@ -212,7 +212,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;
@@ -1239,7 +1239,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;
@@ -1863,7 +1863,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;
@@ -2570,7 +2570,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;
@@ -2581,7 +2581,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,
@@ -2675,7 +2675,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) *
@@ -2706,7 +2706,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)
@@ -2729,11 +2729,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);
More information about the svn-src-stable-9
mailing list