summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-05 08:55:00 +0000
committermav <mav@FreeBSD.org>2015-10-05 08:55:00 +0000
commit76966ba3a77b3630bf8f18df5ce8190743dbed6c (patch)
treedfd526e3a0651bf18d86b2087b4bc420fcaaec6e
parentf1a03e38c50a7d5bc9185fe40d17d80197e1b575 (diff)
downloadFreeBSD-src-76966ba3a77b3630bf8f18df5ce8190743dbed6c.zip
FreeBSD-src-76966ba3a77b3630bf8f18df5ce8190743dbed6c.tar.gz
MFC r287618: Disable CTL_IO_DELAY feature.
It is too developer-oriented to be enabled by default.
-rw-r--r--sys/cam/ctl/ctl.c21
-rw-r--r--sys/cam/ctl/ctl_io.h7
2 files changed, 7 insertions, 21 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 1905f33..f9710b5 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -1190,15 +1190,6 @@ ctl_init(void)
SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree),
OID_AUTO, "ha_state", CTLTYPE_INT | CTLFLAG_RWTUN,
softc, 0, ctl_ha_state_sysctl, "I", "HA state for this head");
-
-#ifdef CTL_IO_DELAY
- if (sizeof(struct callout) > CTL_TIMER_BYTES) {
- printf("sizeof(struct callout) %zd > CTL_TIMER_BYTES %zd\n",
- sizeof(struct callout), CTL_TIMER_BYTES);
- return (EINVAL);
- }
-#endif /* CTL_IO_DELAY */
-
return (0);
}
@@ -12200,12 +12191,10 @@ ctl_datamove(union ctl_io *io)
lun =(struct ctl_lun *)io->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
if ((lun != NULL)
&& (lun->delay_info.datamove_delay > 0)) {
- struct callout *callout;
- callout = (struct callout *)&io->io_hdr.timer_bytes;
- callout_init(callout, /*mpsafe*/ 1);
+ callout_init(&io->io_hdr.delay_callout, /*mpsafe*/ 1);
io->io_hdr.flags |= CTL_FLAG_DELAY_DONE;
- callout_reset(callout,
+ callout_reset(&io->io_hdr.delay_callout,
lun->delay_info.datamove_delay * hz,
ctl_datamove_timer_wakeup, io);
if (lun->delay_info.datamove_type ==
@@ -13450,12 +13439,10 @@ ctl_done(union ctl_io *io)
if ((lun != NULL)
&& (lun->delay_info.done_delay > 0)) {
- struct callout *callout;
- callout = (struct callout *)&io->io_hdr.timer_bytes;
- callout_init(callout, /*mpsafe*/ 1);
+ callout_init(&io->io_hdr.delay_callout, /*mpsafe*/ 1);
io->io_hdr.flags |= CTL_FLAG_DELAY_DONE;
- callout_reset(callout,
+ callout_reset(&io->io_hdr.delay_callout,
lun->delay_info.done_delay * hz,
ctl_done_timer_wakeup, io);
if (lun->delay_info.done_type == CTL_DELAY_TYPE_ONESHOT)
diff --git a/sys/cam/ctl/ctl_io.h b/sys/cam/ctl/ctl_io.h
index fc4ddfb..40e4664 100644
--- a/sys/cam/ctl/ctl_io.h
+++ b/sys/cam/ctl/ctl_io.h
@@ -58,13 +58,12 @@ EXTERN(int ctl_time_io_secs, CTL_TIME_IO_DEFAULT_SECS);
#endif
/*
- * Uncomment these next two lines to enable the CTL I/O delay feature. You
+ * Uncomment this next line to enable the CTL I/O delay feature. You
* can delay I/O at two different points -- datamove and done. This is
* useful for diagnosing abort conditions (for hosts that send an abort on a
* timeout), and for determining how long a host's timeout is.
*/
-#define CTL_IO_DELAY
-#define CTL_TIMER_BYTES sizeof(struct callout)
+//#define CTL_IO_DELAY
typedef enum {
CTL_STATUS_NONE, /* No status */
@@ -231,7 +230,7 @@ struct ctl_io_hdr {
uint32_t timeout; /* timeout in ms */
uint32_t retries; /* retry count */
#ifdef CTL_IO_DELAY
- uint8_t timer_bytes[CTL_TIMER_BYTES]; /* timer kludge */
+ struct callout delay_callout;
#endif /* CTL_IO_DELAY */
#ifdef CTL_TIME_IO
time_t start_time; /* I/O start time */
OpenPOWER on IntegriCloud