smb_iod.c (107940) | smb_iod.c (109623) |
---|---|
1/* 2 * Copyright (c) 2000-2001 Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 2000-2001 Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/netsmb/smb_iod.c 107940 2002-12-16 16:20:06Z robert $ | 32 * $FreeBSD: head/sys/netsmb/smb_iod.c 109623 2003-01-21 08:56:16Z alfred $ |
33 */ 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/endian.h> 38#include <sys/proc.h> 39#include <sys/kernel.h> 40#include <sys/kthread.h> --- 202 unchanged lines hidden (view full) --- 243 /* 244 * If all attempts to send a request failed, then 245 * something is seriously hosed. 246 */ 247 return ENOTCONN; 248 } 249 SMBSDEBUG("M:%04x, P:%04x, U:%04x, T:%04x\n", rqp->sr_mid, 0, 0, 0); 250 m_dumpm(rqp->sr_rq.mb_top); | 33 */ 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/endian.h> 38#include <sys/proc.h> 39#include <sys/kernel.h> 40#include <sys/kthread.h> --- 202 unchanged lines hidden (view full) --- 243 /* 244 * If all attempts to send a request failed, then 245 * something is seriously hosed. 246 */ 247 return ENOTCONN; 248 } 249 SMBSDEBUG("M:%04x, P:%04x, U:%04x, T:%04x\n", rqp->sr_mid, 0, 0, 0); 250 m_dumpm(rqp->sr_rq.mb_top); |
251 m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, M_TRYWAIT); | 251 m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, 0); |
252 error = rqp->sr_lerror = m ? SMB_TRAN_SEND(vcp, m, td) : ENOBUFS; 253 if (error == 0) { 254 getnanotime(&rqp->sr_timesent); 255 iod->iod_lastrqsent = rqp->sr_timesent; 256 rqp->sr_flags |= SMBR_SENT; 257 rqp->sr_state = SMBRQ_SENT; 258 return 0; 259 } --- 106 unchanged lines hidden (view full) --- 366 367int 368smb_iod_request(struct smbiod *iod, int event, void *ident) 369{ 370 struct smbiod_event *evp; 371 int error; 372 373 SMBIODEBUG("\n"); | 252 error = rqp->sr_lerror = m ? SMB_TRAN_SEND(vcp, m, td) : ENOBUFS; 253 if (error == 0) { 254 getnanotime(&rqp->sr_timesent); 255 iod->iod_lastrqsent = rqp->sr_timesent; 256 rqp->sr_flags |= SMBR_SENT; 257 rqp->sr_state = SMBRQ_SENT; 258 return 0; 259 } --- 106 unchanged lines hidden (view full) --- 366 367int 368smb_iod_request(struct smbiod *iod, int event, void *ident) 369{ 370 struct smbiod_event *evp; 371 int error; 372 373 SMBIODEBUG("\n"); |
374 evp = smb_zmalloc(sizeof(*evp), M_SMBIOD, M_WAITOK); | 374 evp = smb_zmalloc(sizeof(*evp), M_SMBIOD, 0); |
375 evp->ev_type = event; 376 evp->ev_ident = ident; 377 SMB_IOD_EVLOCK(iod); 378 STAILQ_INSERT_TAIL(&iod->iod_evlist, evp, ev_link); 379 if ((event & SMBIOD_EV_SYNC) == 0) { 380 SMB_IOD_EVUNLOCK(iod); 381 smb_iod_wakeup(iod); 382 return 0; --- 275 unchanged lines hidden (view full) --- 658} 659 660int 661smb_iod_create(struct smb_vc *vcp) 662{ 663 struct smbiod *iod; 664 int error; 665 | 375 evp->ev_type = event; 376 evp->ev_ident = ident; 377 SMB_IOD_EVLOCK(iod); 378 STAILQ_INSERT_TAIL(&iod->iod_evlist, evp, ev_link); 379 if ((event & SMBIOD_EV_SYNC) == 0) { 380 SMB_IOD_EVUNLOCK(iod); 381 smb_iod_wakeup(iod); 382 return 0; --- 275 unchanged lines hidden (view full) --- 658} 659 660int 661smb_iod_create(struct smb_vc *vcp) 662{ 663 struct smbiod *iod; 664 int error; 665 |
666 iod = smb_zmalloc(sizeof(*iod), M_SMBIOD, M_WAITOK); | 666 iod = smb_zmalloc(sizeof(*iod), M_SMBIOD, 0); |
667 iod->iod_id = smb_iod_next++; 668 iod->iod_state = SMBIOD_ST_NOTCONN; 669 iod->iod_vc = vcp; 670 iod->iod_sleeptimo = hz * SMBIOD_SLEEP_TIMO; 671 iod->iod_pingtimo.tv_sec = SMBIOD_PING_TIMO; 672 getnanotime(&iod->iod_lastrqsent); 673 vcp->vc_iod = iod; 674 smb_sl_init(&iod->iod_rqlock, "90rql"); --- 35 unchanged lines hidden --- | 667 iod->iod_id = smb_iod_next++; 668 iod->iod_state = SMBIOD_ST_NOTCONN; 669 iod->iod_vc = vcp; 670 iod->iod_sleeptimo = hz * SMBIOD_SLEEP_TIMO; 671 iod->iod_pingtimo.tv_sec = SMBIOD_PING_TIMO; 672 getnanotime(&iod->iod_lastrqsent); 673 vcp->vc_iod = iod; 674 smb_sl_init(&iod->iod_rqlock, "90rql"); --- 35 unchanged lines hidden --- |