smb_rq.c (107940) | smb_rq.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_rq.c 107940 2002-12-16 16:20:06Z robert $ | 32 * $FreeBSD: head/sys/netsmb/smb_rq.c 109623 2003-01-21 08:56:16Z alfred $ |
33 */ 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/endian.h> 37#include <sys/kernel.h> 38#include <sys/malloc.h> 39#include <sys/proc.h> 40#include <sys/lock.h> --- 21 unchanged lines hidden (view full) --- 62 63int 64smb_rq_alloc(struct smb_connobj *layer, u_char cmd, struct smb_cred *scred, 65 struct smb_rq **rqpp) 66{ 67 struct smb_rq *rqp; 68 int error; 69 | 33 */ 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/endian.h> 37#include <sys/kernel.h> 38#include <sys/malloc.h> 39#include <sys/proc.h> 40#include <sys/lock.h> --- 21 unchanged lines hidden (view full) --- 62 63int 64smb_rq_alloc(struct smb_connobj *layer, u_char cmd, struct smb_cred *scred, 65 struct smb_rq **rqpp) 66{ 67 struct smb_rq *rqp; 68 int error; 69 |
70 MALLOC(rqp, struct smb_rq *, sizeof(*rqp), M_SMBRQ, M_WAITOK); | 70 MALLOC(rqp, struct smb_rq *, sizeof(*rqp), M_SMBRQ, 0); |
71 if (rqp == NULL) 72 return ENOMEM; 73 error = smb_rq_init(rqp, layer, cmd, scred); 74 rqp->sr_flags |= SMBR_ALLOCED; 75 if (error) { 76 smb_rq_done(rqp); 77 return error; 78 } --- 284 unchanged lines hidden (view full) --- 363 */ 364int 365smb_t2_alloc(struct smb_connobj *layer, u_short setup, struct smb_cred *scred, 366 struct smb_t2rq **t2pp) 367{ 368 struct smb_t2rq *t2p; 369 int error; 370 | 71 if (rqp == NULL) 72 return ENOMEM; 73 error = smb_rq_init(rqp, layer, cmd, scred); 74 rqp->sr_flags |= SMBR_ALLOCED; 75 if (error) { 76 smb_rq_done(rqp); 77 return error; 78 } --- 284 unchanged lines hidden (view full) --- 363 */ 364int 365smb_t2_alloc(struct smb_connobj *layer, u_short setup, struct smb_cred *scred, 366 struct smb_t2rq **t2pp) 367{ 368 struct smb_t2rq *t2p; 369 int error; 370 |
371 MALLOC(t2p, struct smb_t2rq *, sizeof(*t2p), M_SMBRQ, M_WAITOK); | 371 MALLOC(t2p, struct smb_t2rq *, sizeof(*t2p), M_SMBRQ, 0); |
372 if (t2p == NULL) 373 return ENOMEM; 374 error = smb_t2_init(t2p, layer, setup, scred); 375 t2p->t2_flags |= SMBT2_ALLOCED; 376 if (error) { 377 smb_t2_done(t2p); 378 return error; 379 } --- 33 unchanged lines hidden (view full) --- 413 414static int 415smb_t2_placedata(struct mbuf *mtop, u_int16_t offset, u_int16_t count, 416 struct mdchain *mdp) 417{ 418 struct mbuf *m, *m0; 419 int len; 420 | 372 if (t2p == NULL) 373 return ENOMEM; 374 error = smb_t2_init(t2p, layer, setup, scred); 375 t2p->t2_flags |= SMBT2_ALLOCED; 376 if (error) { 377 smb_t2_done(t2p); 378 return error; 379 } --- 33 unchanged lines hidden (view full) --- 413 414static int 415smb_t2_placedata(struct mbuf *mtop, u_int16_t offset, u_int16_t count, 416 struct mdchain *mdp) 417{ 418 struct mbuf *m, *m0; 419 int len; 420 |
421 m0 = m_split(mtop, offset, M_TRYWAIT); | 421 m0 = m_split(mtop, offset, 0); |
422 if (m0 == NULL) 423 return EBADRPC; 424 len = m_length(m0, &m); 425 m->m_len -= len - count; 426 if (mdp->md_top == NULL) { 427 md_initm(mdp, m0); 428 } else 429 m_cat(mdp->md_top, m0); --- 325 unchanged lines hidden --- | 422 if (m0 == NULL) 423 return EBADRPC; 424 len = m_length(m0, &m); 425 m->m_len -= len - count; 426 if (mdp->md_top == NULL) { 427 md_initm(mdp, m0); 428 } else 429 m_cat(mdp->md_top, m0); --- 325 unchanged lines hidden --- |