iod_pingtimo is unused, #if 0

iod_sleeptimo is set to same value always, so use the value directly
and #if 0 iod_sleeptimo

add one smb_iod_wakeup() in smb_iod_sendrq()
XXX unfortunately iod thread still must wakeup periodically to check
XXX for arriving replies - command latency might be improved if this could
XXX be avoided
This commit is contained in:
jdolecek 2003-03-24 07:49:48 +00:00
parent 850f5b36ec
commit 41b5582182
2 changed files with 11 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: smb_conn.h,v 1.6 2003/03/24 07:38:54 jdolecek Exp $ */
/* $NetBSD: smb_conn.h,v 1.7 2003/03/24 07:49:48 jdolecek Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@ -436,7 +436,6 @@ struct smbiod {
int iod_flags;
enum smbiod_state iod_state;
int iod_muxcnt; /* number of active outstanding requests */
int iod_sleeptimo;
struct smb_vc * iod_vc;
struct smb_slock iod_rqlock; /* iod_rqlist, iod_muxwant */
SIMPLEQ_HEAD(, smb_rq)
@ -450,9 +449,10 @@ struct smbiod {
struct smb_slock iod_evlock; /* iod_evlist */
SIMPLEQ_HEAD(,smbiod_event) iod_evlist;
#if 0
int iod_sleeptimo;
struct timeval iod_lastrqsent;
#endif
struct timeval iod_pingtimo;
#endif
};
int smb_iod_init(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: smb_iod.c,v 1.13 2003/03/23 10:32:05 jdolecek Exp $ */
/* $NetBSD: smb_iod.c,v 1.14 2003/03/24 07:49:49 jdolecek Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: smb_iod.c,v 1.13 2003/03/23 10:32:05 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: smb_iod.c,v 1.14 2003/03/24 07:49:49 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -52,9 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: smb_iod.c,v 1.13 2003/03/23 10:32:05 jdolecek Exp $"
#include <netsmb/smb_tran.h>
#include <netsmb/smb_trantcp.h>
#define SMBIOD_SLEEP_TIMO 2
#define SMBIOD_PING_TIMO 60 /* seconds */
#define SMBIOD_SLEEP_TIMO 2
#define SMB_IOD_EVLOCKPTR(iod) (&((iod)->iod_evlock))
#define SMB_IOD_EVLOCK(iod) smb_sl_lock(&((iod)->iod_evlock))
@ -270,6 +268,7 @@ smb_iod_sendrq(struct smbiod *iod, struct smb_rq *rqp)
#endif
rqp->sr_flags |= SMBR_SENT;
rqp->sr_state = SMBRQ_SENT;
smb_iod_wakeup(iod);
return 0;
}
/*
@ -660,10 +659,11 @@ smb_iod_thread(void *arg)
smb_makescred(&iod->iod_scred, iod->iod_p, NULL);
while ((iod->iod_flags & SMBIOD_SHUTDOWN) == 0) {
smb_iod_main(iod);
SMBIODEBUG("going to sleep for %d ticks\n", iod->iod_sleeptimo);
SMBIODEBUG("going to sleep for %d ticks\n",
SMBIOD_SLEEP_TIMO * hz);
if (iod->iod_flags & SMBIOD_SHUTDOWN)
break;
tsleep(&iod->iod_flags, PWAIT, "smbidle", iod->iod_sleeptimo);
tsleep(&iod->iod_flags, PWAIT, "smbidle", SMBIOD_SLEEP_TIMO * hz);
}
kthread_exit(0);
}
@ -678,9 +678,8 @@ smb_iod_create(struct smb_vc *vcp)
iod->iod_id = smb_iod_next++;
iod->iod_state = SMBIOD_ST_NOTCONN;
iod->iod_vc = vcp;
iod->iod_sleeptimo = hz * SMBIOD_SLEEP_TIMO;
iod->iod_pingtimo.tv_sec = SMBIOD_PING_TIMO;
#if 0
iod->iod_pingtimo.tv_sec = SMBIOD_PING_TIMO;
microtime(&iod->iod_lastrqsent);
#endif
vcp->vc_iod = iod;