Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/iscsi Inline SET_CCB_TIMEOUT and SET_CONN_TIMEOUT
details: https://anonhg.NetBSD.org/src/rev/935290274cd8
branches: trunk
changeset: 338575:935290274cd8
user: joerg <joerg%NetBSD.org@localhost>
date: Sat May 30 18:09:31 2015 +0000
description:
Inline SET_CCB_TIMEOUT and SET_CONN_TIMEOUT
diffstat:
sys/dev/iscsi/iscsi_globals.h | 8 +-------
sys/dev/iscsi/iscsi_ioctl.c | 6 +++---
sys/dev/iscsi/iscsi_rcv.c | 20 ++++++++++----------
sys/dev/iscsi/iscsi_send.c | 12 ++++++------
4 files changed, 20 insertions(+), 26 deletions(-)
diffs (164 lines):
diff -r 451771f0ef49 -r 935290274cd8 sys/dev/iscsi/iscsi_globals.h
--- a/sys/dev/iscsi/iscsi_globals.h Sat May 30 18:00:09 2015 +0000
+++ b/sys/dev/iscsi/iscsi_globals.h Sat May 30 18:09:31 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsi_globals.h,v 1.10 2015/05/30 18:00:09 joerg Exp $ */
+/* $NetBSD: iscsi_globals.h,v 1.11 2015/05/30 18:09:31 joerg Exp $ */
/*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -628,12 +628,6 @@
(a >= b && ((a - b) & 0x80000000));
}
-
-/* Version dependencies */
-/* XXX */
-#define SET_CCB_TIMEOUT(conn, ccb, tout) callout_schedule(&ccb->timeout, tout)
-#define SET_CONN_TIMEOUT(conn, tout) callout_schedule(&conn->timeout, tout)
-
/* in iscsi_ioctl.c */
/* Parameter for logout is reason code in logout PDU, -1 for don't send logout */
diff -r 451771f0ef49 -r 935290274cd8 sys/dev/iscsi/iscsi_ioctl.c
--- a/sys/dev/iscsi/iscsi_ioctl.c Sat May 30 18:00:09 2015 +0000
+++ b/sys/dev/iscsi/iscsi_ioctl.c Sat May 30 18:09:31 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsi_ioctl.c,v 1.10 2015/05/30 18:00:09 joerg Exp $ */
+/* $NetBSD: iscsi_ioctl.c,v 1.11 2015/05/30 18:09:31 joerg Exp $ */
/*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -477,7 +477,7 @@
/* of logging in */
if (logout >= 0) {
conn->state = ST_WINDING_DOWN;
- SET_CONN_TIMEOUT(conn, CONNECTION_TIMEOUT);
+ callout_schedule(&conn->timeout, CONNECTION_TIMEOUT);
if (sess->ErrorRecoveryLevel < 2 &&
logout == RECOVER_CONNECTION) {
@@ -850,7 +850,7 @@
}
resend_pdu(ccb);
} else {
- SET_CCB_TIMEOUT(connection, ccb, COMMAND_TIMEOUT);
+ callout_schedule(&ccb->timeout, COMMAND_TIMEOUT);
}
}
diff -r 451771f0ef49 -r 935290274cd8 sys/dev/iscsi/iscsi_rcv.c
--- a/sys/dev/iscsi/iscsi_rcv.c Sat May 30 18:00:09 2015 +0000
+++ b/sys/dev/iscsi/iscsi_rcv.c Sat May 30 18:09:31 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsi_rcv.c,v 1.9 2015/05/30 18:00:09 joerg Exp $ */
+/* $NetBSD: iscsi_rcv.c,v 1.10 2015/05/30 18:09:31 joerg Exp $ */
/*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -468,7 +468,7 @@
}
if (req_ccb->pdu_waiting != NULL) {
- SET_CCB_TIMEOUT(conn, req_ccb, COMMAND_TIMEOUT);
+ callout_schedule(&req_ccb->timeout, COMMAND_TIMEOUT);
req_ccb->num_timeouts = 0;
}
@@ -575,7 +575,7 @@
req_ccb->flags |= CCBF_GOT_RSP;
if (req_ccb->pdu_waiting != NULL) {
- SET_CCB_TIMEOUT(conn, req_ccb, COMMAND_TIMEOUT);
+ callout_schedule(&req_ccb->timeout, COMMAND_TIMEOUT);
req_ccb->num_timeouts = 0;
}
@@ -656,7 +656,7 @@
if (req_ccb != NULL) {
if (req_ccb->pdu_waiting != NULL) {
- SET_CCB_TIMEOUT(conn, req_ccb, COMMAND_TIMEOUT);
+ callout_schedule(&req_ccb->timeout, COMMAND_TIMEOUT);
req_ccb->num_timeouts = 0;
}
send_data_out(conn, pdu, req_ccb, CCBDISP_NOWAIT, TRUE);
@@ -699,7 +699,7 @@
}
if (req_ccb->pdu_waiting != NULL) {
- SET_CCB_TIMEOUT(conn, req_ccb, COMMAND_TIMEOUT);
+ callout_schedule(&req_ccb->timeout, COMMAND_TIMEOUT);
req_ccb->num_timeouts = 0;
}
@@ -1090,11 +1090,11 @@
MaxCmdSN = ntohl(pdu->pdu.p.nop_in.MaxCmdSN);
/* received a valid frame, reset timeout */
-
- SET_CONN_TIMEOUT(conn,
- (((pdu->pdu.Opcode & OPCODE_MASK) == TOP_NOP_In) &&
- (TAILQ_FIRST(&conn->ccbs_waiting) == NULL)) ?
- conn->idle_timeout_val : CONNECTION_TIMEOUT);
+ if ((pdu->pdu.Opcode & OPCODE_MASK) == TOP_NOP_In &&
+ TAILQ_EMPTY(&conn->ccbs_waiting))
+ callout_schedule(&conn->timeout, conn->idle_timeout_val);
+ else
+ callout_schedule(&conn->timeout, CONNECTION_TIMEOUT);
conn->num_timeouts = 0;
/*
diff -r 451771f0ef49 -r 935290274cd8 sys/dev/iscsi/iscsi_send.c
--- a/sys/dev/iscsi/iscsi_send.c Sat May 30 18:00:09 2015 +0000
+++ b/sys/dev/iscsi/iscsi_send.c Sat May 30 18:09:31 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsi_send.c,v 1.13 2015/05/30 18:00:09 joerg Exp $ */
+/* $NetBSD: iscsi_send.c,v 1.14 2015/05/30 18:09:31 joerg Exp $ */
/*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -260,7 +260,7 @@
}
resend_pdu(ccb);
} else {
- SET_CCB_TIMEOUT(conn, ccb, COMMAND_TIMEOUT);
+ callout_schedule(&ccb->timeout, COMMAND_TIMEOUT);
}
DEBC(conn, 1, ("Reassign ccb %p, no_tm=%d, rc=%d\n",
ccb, no_tm, rc));
@@ -482,7 +482,7 @@
wakeup(&conn->pdus_to_send);
if (cdisp != CCBDISP_NOWAIT) {
- SET_CCB_TIMEOUT(conn, ccb, COMMAND_TIMEOUT);
+ callout_schedule(&ccb->timeout, COMMAND_TIMEOUT);
if (prev_cdisp <= CCBDISP_NOWAIT)
suspend_ccb(ccb, TRUE);
@@ -533,7 +533,7 @@
} else {
TAILQ_INSERT_TAIL(&conn->pdus_to_send, pdu, send_chain);
}
- SET_CCB_TIMEOUT(conn, ccb, COMMAND_TIMEOUT);
+ callout_schedule(&ccb->timeout, COMMAND_TIMEOUT);
splx (s);
wakeup(&conn->pdus_to_send);
@@ -1591,7 +1591,7 @@
if (conn->state == ST_FULL_FEATURE)
send_nop_out(conn, NULL);
- SET_CONN_TIMEOUT(conn, CONNECTION_TIMEOUT);
+ callout_schedule(&conn->timeout, CONNECTION_TIMEOUT);
}
}
@@ -1626,6 +1626,6 @@
/* request resend of all missing status */
snack_missing(conn, NULL, SNACK_STATUS_NAK, 0, 0);
}
- SET_CCB_TIMEOUT(conn, ccb, COMMAND_TIMEOUT);
+ callout_schedule(&ccb->timeout, COMMAND_TIMEOUT);
}
}
Home |
Main Index |
Thread Index |
Old Index