Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Dec 2019 19:16:26 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355817 - in head/sys/cam: ata scsi
Message-ID:  <201912161916.xBGJGQ4k014843@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Mon Dec 16 19:16:26 2019
New Revision: 355817
URL: https://svnweb.freebsd.org/changeset/base/355817

Log:
  Revert r355813
  
  It was extracted from a larger tree and is incomplete. Will resubmit after
  reworking.

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Mon Dec 16 19:08:49 2019	(r355816)
+++ head/sys/cam/ata/ata_da.c	Mon Dec 16 19:16:26 2019	(r355817)
@@ -858,10 +858,6 @@ static void		adaresume(void *arg);
 #define	ADA_DEFAULT_WRITE_CACHE	1
 #endif
 
-#ifndef	ADA_DEFAULT_MAX_DELETE
-#define	ADA_DEFAULT_MAX_DELETE	(1 * 1024 * 1024 * 1024)	/* 1GB max trim by default */
-#endif
-
 #define	ADA_RA	(softc->read_ahead >= 0 ? \
 		 softc->read_ahead : ada_read_ahead)
 #define	ADA_WC	(softc->write_cache >= 0 ? \
@@ -882,7 +878,6 @@ static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOW
 static int ada_spindown_suspend = ADA_DEFAULT_SPINDOWN_SUSPEND;
 static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD;
 static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE;
-static int64_t ada_default_max_delete = ADA_DEFAULT_MAX_DELETE;
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
@@ -900,9 +895,6 @@ SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLA
            &ada_read_ahead, 0, "Enable disk read-ahead");
 SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RWTUN,
            &ada_write_cache, 0, "Enable disk write cache");
-SYSCTL_QUAD(_kern_cam_ada, OID_AUTO, default_max_delete, CTLFLAG_RWTUN,
-    &ada_default_max_delete, 0,
-    "Default system wide maximum delete");
 
 /*
  * ADA_ORDEREDTAG_INTERVAL determines how often, relative
@@ -3400,8 +3392,6 @@ adasetgeom(struct ada_softc *softc, struct ccb_getdev 
 		softc->disk->d_delmaxsize = 256 * softc->params.secsize;
 	} else
 		softc->disk->d_delmaxsize = maxio;
-	if (softc->disk->d_delmaxsize > ada_default_max_delete)
-		softc->disk->d_delmaxsize = ada_default_max_delete;
 	if ((softc->cpi.hba_misc & PIM_UNMAPPED) != 0) {
 		d_flags |= DISKFLAG_UNMAPPED_BIO;
 		softc->unmappedio = 1;

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Mon Dec 16 19:08:49 2019	(r355816)
+++ head/sys/cam/scsi/scsi_da.c	Mon Dec 16 19:16:26 2019	(r355817)
@@ -1516,17 +1516,12 @@ static callout_func_t	damediapoll;
 #define	DA_DEFAULT_SEND_ORDERED	1
 #endif
 
-#ifndef	DA_DEFAULT_MAX_DELETE
-#define	DA_DEFAULT_MAX_DELETE	(1 * 1024 * 1024 * 1024)	/* 1GB max trim by default */
-#endif
-
 static int da_poll_period = DA_DEFAULT_POLL_PERIOD;
 static int da_retry_count = DA_DEFAULT_RETRY;
 static int da_default_timeout = DA_DEFAULT_TIMEOUT;
 static sbintime_t da_default_softtimeout = DA_DEFAULT_SOFTTIMEOUT;
 static int da_send_ordered = DA_DEFAULT_SEND_ORDERED;
 static int da_disable_wp_detection = 0;
-static int64_t da_default_max_delete = DA_DEFAULT_MAX_DELETE;
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
@@ -1541,9 +1536,6 @@ SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFL
 SYSCTL_INT(_kern_cam_da, OID_AUTO, disable_wp_detection, CTLFLAG_RWTUN,
            &da_disable_wp_detection, 0,
 	   "Disable detection of write-protected disks");
-SYSCTL_INT64(_kern_cam_da, OID_AUTO, default_max_delete, CTLFLAG_RWTUN,
-    &da_default_max_delete, 0,
-    "Default system wide maximum delete");
 
 SYSCTL_PROC(_kern_cam_da, OID_AUTO, default_softtimeout,
     CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, dasysctlsofttimeout, "I",
@@ -2508,8 +2500,8 @@ dadeletemaxsize(struct da_softc *softc, da_delete_meth
 		return 0;
 	}
 
-	return (off_t)MIN(da_default_max_delete, softc->params.secsize *
-	    omin(sectors, softc->params.sectors));
+	return (off_t)softc->params.secsize *
+	    omin(sectors, softc->params.sectors);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912161916.xBGJGQ4k014843>