Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/iscsi Remove conditionals for NetBSD before 4.0.
details: https://anonhg.NetBSD.org/src/rev/f5aecbce77d6
branches: trunk
changeset: 338237:f5aecbce77d6
user: joerg <joerg%NetBSD.org@localhost>
date: Fri May 15 16:24:30 2015 +0000
description:
Remove conditionals for NetBSD before 4.0.
diffstat:
sys/dev/iscsi/iscsi_globals.h | 46 ++++-------------------------
sys/dev/iscsi/iscsi_ioctl.c | 65 +++++++++++++++++++-----------------------
sys/dev/iscsi/iscsi_main.c | 4 +-
sys/dev/iscsi/iscsi_rcv.c | 10 +-----
sys/dev/iscsi/iscsi_send.c | 6 +---
sys/dev/iscsi/iscsi_utils.c | 4 +-
6 files changed, 42 insertions(+), 93 deletions(-)
diffs (truncated from 421 to 300 lines):
diff -r a29292a2f707 -r f5aecbce77d6 sys/dev/iscsi/iscsi_globals.h
--- a/sys/dev/iscsi/iscsi_globals.h Fri May 15 14:26:02 2015 +0000
+++ b/sys/dev/iscsi/iscsi_globals.h Fri May 15 16:24:30 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsi_globals.h,v 1.7 2015/04/13 16:33:24 riastradh Exp $ */
+/* $NetBSD: iscsi_globals.h,v 1.8 2015/05/15 16:24:30 joerg Exp $ */
/*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -328,13 +328,6 @@
/*
Per connection data: the connection structure
*/
-#if (__NetBSD_Version__ >= 399000900)
-typedef struct lwp *PTHREADOBJ;
-#else
-typedef struct proc *PTHREADOBJ;
-#endif
-
-
struct connection_s {
TAILQ_ENTRY(connection_s) connections;
@@ -374,7 +367,7 @@
conn_state_t state; /* State of connection */
- PTHREADOBJ threadobj;
+ struct lwp *threadobj;
/* proc/thread pointer of socket owner */
struct file *sock; /* the connection's socket */
session_t *session;
@@ -681,45 +674,20 @@
/* Version dependencies */
-
-
-#if (__NetBSD_Version__ >= 399000900)
-#define PROCP(obj) (obj->l_proc)
-#else
-#define PROCP(obj) obj
-#define UIO_SETUP_SYSSPACE(uio) (uio)->uio_segflg = UIO_SYSSPACE
-#endif
-
-#if (__NetBSD_Version__ >= 106000000)
-# ifdef ISCSI_TEST_MODE
+#ifdef ISCSI_TEST_MODE
#define SET_CCB_TIMEOUT(conn, ccb, tout) do { \
if (test_ccb_timeout (conn)) { \
callout_schedule(&ccb->timeout, tout); \
} \
} while (/*CONSTCOND*/ 0)
-# else
-#define SET_CCB_TIMEOUT(conn, ccb, tout) callout_schedule(&ccb->timeout, tout)
-# endif
-#else
-/* no test mode for 1.5 */
-#define SET_CCB_TIMEOUT(conn, ccb, tout) \
- callout_reset(&ccb->timeout, tout, ccb_timeout, ccb)
-#endif
-
-#if (__NetBSD_Version__ >= 106000000)
-# ifdef ISCSI_TEST_MODE
#define SET_CONN_TIMEOUT(conn, tout) do { \
if (test_conn_timeout (conn)) { \
callout_schedule(&conn->timeout, tout); \
} \
-} while (/*CONSTCOND*/0)
-# else
+} while (/*CONSTCOND*/ 0)
+#else
+#define SET_CCB_TIMEOUT(conn, ccb, tout) callout_schedule(&ccb->timeout, tout)
#define SET_CONN_TIMEOUT(conn, tout) callout_schedule(&conn->timeout, tout)
-# endif
-#else
-/* no test mode for 1.5 */
-#define SET_CONN_TIMEOUT(conn, tout) \
- callout_reset(&conn->timeout, tout, connection_timeout, conn)
#endif
/* in iscsi_ioctl.c */
@@ -742,7 +710,7 @@
uint32_t map_databuf(struct proc *, void **, uint32_t);
void unmap_databuf(struct proc *, void *, uint32_t);
#endif
-int iscsiioctl(dev_t, u_long, void *, int, PTHREADOBJ);
+int iscsiioctl(dev_t, u_long, void *, int, struct lwp *);
session_t *find_session(uint32_t);
connection_t *find_connection(session_t *, uint32_t);
diff -r a29292a2f707 -r f5aecbce77d6 sys/dev/iscsi/iscsi_ioctl.c
--- a/sys/dev/iscsi/iscsi_ioctl.c Fri May 15 14:26:02 2015 +0000
+++ b/sys/dev/iscsi/iscsi_ioctl.c Fri May 15 16:24:30 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsi_ioctl.c,v 1.7 2015/05/03 15:07:12 joerg Exp $ */
+/* $NetBSD: iscsi_ioctl.c,v 1.8 2015/05/15 16:24:30 joerg Exp $ */
/*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -606,7 +606,7 @@
* Parameter:
* par IN/OUT: The login parameters
* session IN: The owning session
- * p IN: The proc pointer of the caller
+ * l IN: The lwp pointer of the caller
*
* Returns: 0 on success
* >0 on failure, connection structure deleted
@@ -615,7 +615,7 @@
STATIC int
create_connection(iscsi_login_parameters_t *par, session_t *session,
- PTHREADOBJ p)
+ struct lwp *l)
{
connection_t *connection;
int rc, s;
@@ -672,7 +672,7 @@
/* close the file descriptor */
fd_close(par->socket);
- connection->threadobj = p;
+ connection->threadobj = l;
connection->login_par = par;
/*DEBOUT (("Creating receive thread\n")); */
@@ -753,7 +753,7 @@
* Parameter:
* par IN/OUT: The login parameters
* conn IN: The connection
- * p IN: The proc pointer of the caller
+ * l IN: The lwp pointer of the caller
*
* Returns: 0 on success
* >0 on failure, connection structure deleted
@@ -762,7 +762,7 @@
STATIC int
recreate_connection(iscsi_login_parameters_t *par, session_t *session,
- connection_t *connection, PTHREADOBJ p)
+ connection_t *connection, struct lwp *l)
{
int rc, s;
ccb_t *ccb;
@@ -797,7 +797,7 @@
/* close the file descriptor */
fd_close(par->socket);
- connection->threadobj = p;
+ connection->threadobj = l;
connection->login_par = par;
connection->terminating = ISCSI_STATUS_SUCCESS;
connection->recover++;
@@ -952,11 +952,11 @@
*
* Parameter:
* par IN/OUT: The login parameters
- * p IN: The proc pointer of the caller
+ * l IN: The lwp pointer of the caller
*/
STATIC void
-login(iscsi_login_parameters_t *par, PTHREADOBJ p)
+login(iscsi_login_parameters_t *par, struct lwp *l)
{
session_t *session;
int rc, s;
@@ -993,7 +993,7 @@
session->login_type = par->login_type;
session->CmdSN = 1;
- if ((rc = create_connection(par, session, p)) != 0) {
+ if ((rc = create_connection(par, session, l)) != 0) {
if (rc > 0) {
free(session, M_DEVBUF);
}
@@ -1051,11 +1051,11 @@
*
* Parameter:
* par IN/OUT: The login parameters
- * p IN: The proc pointer of the caller
+ * l IN: The lwp pointer of the caller
*/
STATIC void
-add_connection(iscsi_login_parameters_t *par, PTHREADOBJ p)
+add_connection(iscsi_login_parameters_t *par, struct lwp *l)
{
session_t *session;
@@ -1067,7 +1067,7 @@
return;
}
if ((par->status = check_login_pars(par)) == 0) {
- create_connection(par, session, p);
+ create_connection(par, session, l);
}
}
@@ -1114,11 +1114,11 @@
*
* Parameter:
* par IN/OUT: The login parameters
- * p IN: The proc pointer of the caller
+ * l IN: The lwp pointer of the caller
*/
STATIC void
-restore_connection(iscsi_login_parameters_t *par, PTHREADOBJ p)
+restore_connection(iscsi_login_parameters_t *par, struct lwp *l)
{
session_t *session;
connection_t *connection;
@@ -1140,7 +1140,7 @@
}
if ((par->status = check_login_pars(par)) == 0) {
- recreate_connection(par, session, connection, p);
+ recreate_connection(par, session, connection, l);
}
}
@@ -1222,13 +1222,8 @@
/* following code lifted almost verbatim from uvm_io.c */
vm_map_lock(kernel_map);
- uvm_unmap_remove(kernel_map, databuf, databuf + datalen, &dead_entries
-#if (__NetBSD_Version__ >= 399000500)
- , 0
-#elif (__NetBSD_Version__ >= 300000000)
- , NULL
-#endif
- );
+ uvm_unmap_remove(kernel_map, databuf, databuf + datalen, &dead_entries,
+ 0);
vm_map_unlock(kernel_map);
if (dead_entries != NULL) {
uvm_unmap_detach(dead_entries, AMAP_REFALL);
@@ -1244,11 +1239,11 @@
*
* Parameter:
* par IN/OUT: The iocommand parameters
- * p IN: The proc pointer of the caller
+ * l IN: The lwp pointer of the caller
*/
STATIC void
-io_command(iscsi_iocommand_parameters_t *par, PTHREADOBJ p)
+io_command(iscsi_iocommand_parameters_t *par, struct lwp *l)
{
uint32_t datalen = par->req.datalen;
void *databuf = par->req.databuf;
@@ -1272,7 +1267,7 @@
return;
}
- if (datalen && (par->status = map_databuf(PROCP(p),
+ if (datalen && (par->status = map_databuf(l->l_proc,
&par->req.databuf, datalen)) != 0) {
return;
}
@@ -1280,7 +1275,7 @@
par->options.immediate, par->connection_id);
if (datalen) {
- unmap_databuf(PROCP(p), par->req.databuf, datalen);
+ unmap_databuf(l->l_proc, par->req.databuf, datalen);
par->req.databuf = databuf; /* restore original addr */
}
@@ -1602,11 +1597,11 @@
* cmd The ioctl Command
* addr IN/OUT: The command parameter
* flag Flags (ignored)
- * p IN: The thread object of the caller
+ * l IN: The lwp object of the caller
*/
int
-iscsiioctl(dev_t dev, u_long cmd, void *addr, int flag, PTHREADOBJ p)
+iscsiioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
{
DEB(1, ("ISCSI Ioctl cmd = %x\n", (int) cmd));
@@ -1617,15 +1612,15 @@
break;
case ISCSI_LOGIN:
- login((iscsi_login_parameters_t *) addr, p);
+ login((iscsi_login_parameters_t *) addr, l);
break;
case ISCSI_ADD_CONNECTION:
- add_connection((iscsi_login_parameters_t *) addr, p);
+ add_connection((iscsi_login_parameters_t *) addr, l);
break;
case ISCSI_RESTORE_CONNECTION:
- restore_connection((iscsi_login_parameters_t *) addr, p);
Home |
Main Index |
Thread Index |
Old Index