diff options
author | imp <imp@FreeBSD.org> | 2003-02-19 05:47:46 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-02-19 05:47:46 +0000 |
commit | cf874b345d0f766fb64cf4737e1c85ccc78d2bee (patch) | |
tree | 9e20e320fe15ae4bf68f8335fcf9d3e71d3b3614 /sys/netsmb | |
parent | b72619cecb8265d3efb3781b0acff1380762c173 (diff) | |
download | FreeBSD-src-cf874b345d0f766fb64cf4737e1c85ccc78d2bee.zip FreeBSD-src-cf874b345d0f766fb64cf4737e1c85ccc78d2bee.tar.gz |
Back out M_* changes, per decision of the TRB.
Approved by: trb
Diffstat (limited to 'sys/netsmb')
-rw-r--r-- | sys/netsmb/smb_conn.c | 4 | ||||
-rw-r--r-- | sys/netsmb/smb_crypt.c | 8 | ||||
-rw-r--r-- | sys/netsmb/smb_dev.c | 2 | ||||
-rw-r--r-- | sys/netsmb/smb_iod.c | 6 | ||||
-rw-r--r-- | sys/netsmb/smb_rq.c | 6 | ||||
-rw-r--r-- | sys/netsmb/smb_smb.c | 12 | ||||
-rw-r--r-- | sys/netsmb/smb_subr.c | 8 | ||||
-rw-r--r-- | sys/netsmb/smb_trantcp.c | 4 |
8 files changed, 25 insertions, 25 deletions
diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c index 2a1e913..9c52571 100644 --- a/sys/netsmb/smb_conn.c +++ b/sys/netsmb/smb_conn.c @@ -393,7 +393,7 @@ smb_vc_create(struct smb_vcspec *vcspec, if (gid != SMBM_ANY_GROUP && !groupmember(gid, cred) && !isroot) return EPERM; - vcp = smb_zmalloc(sizeof(*vcp), M_SMBCONN, 0); + vcp = smb_zmalloc(sizeof(*vcp), M_SMBCONN, M_WAITOK); smb_co_init(VCTOCP(vcp), SMBL_VC, "smb_vc", td); vcp->obj.co_free = smb_vc_free; vcp->obj.co_gone = smb_vc_gone; @@ -690,7 +690,7 @@ smb_share_create(struct smb_vc *vcp, struct smb_sharespec *shspec, uid = realuid; if (gid == SMBM_ANY_GROUP) gid = cred->cr_groups[0]; - ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, 0); + ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, M_WAITOK); smb_co_init(SSTOCP(ssp), SMBL_SHARE, "smbss", td); ssp->obj.co_free = smb_share_free; ssp->obj.co_gone = smb_share_gone; diff --git a/sys/netsmb/smb_crypt.c b/sys/netsmb/smb_crypt.c index a636932..8e35207 100644 --- a/sys/netsmb/smb_crypt.c +++ b/sys/netsmb/smb_crypt.c @@ -73,7 +73,7 @@ smb_E(const u_char *key, u_char *data, u_char *dest) kk[5] = key[4] << 3 | (key[5] >> 5 & 0xfe); kk[6] = key[5] << 2 | (key[6] >> 6 & 0xfe); kk[7] = key[6] << 1; - ksp = malloc(sizeof(des_key_schedule), M_SMBTEMP, 0); + ksp = malloc(sizeof(des_key_schedule), M_SMBTEMP, M_WAITOK); des_set_key((des_cblock *)kk, *ksp); des_ecb_encrypt((des_cblock *)data, (des_cblock *)dest, *ksp, 1); free(ksp, M_SMBTEMP); @@ -87,7 +87,7 @@ smb_encrypt(const u_char *apwd, u_char *C8, u_char *RN) #ifdef NETSMBCRYPTO u_char *p, *P14, *S21; - p = malloc(14 + 21, M_SMBTEMP, 0); + p = malloc(14 + 21, M_SMBTEMP, M_WAITOK); bzero(p, 14 + 21); P14 = p; S21 = p + 14; @@ -120,12 +120,12 @@ smb_ntencrypt(const u_char *apwd, u_char *C8, u_char *RN) int len; len = strlen(apwd); - unipwd = malloc((len + 1) * sizeof(u_int16_t), M_SMBTEMP, 0); + unipwd = malloc((len + 1) * sizeof(u_int16_t), M_SMBTEMP, M_WAITOK); /* * S21 = concat(MD4(U(apwd)), zeros(5)); */ smb_strtouni(unipwd, apwd); - ctxp = malloc(sizeof(MD4_CTX), M_SMBTEMP, 0); + ctxp = malloc(sizeof(MD4_CTX), M_SMBTEMP, M_WAITOK); MD4Init(ctxp); MD4Update(ctxp, (u_char*)unipwd, len * sizeof(u_int16_t)); free(unipwd, M_SMBTEMP); diff --git a/sys/netsmb/smb_dev.c b/sys/netsmb/smb_dev.c index 2fc6a29..50b7e51 100644 --- a/sys/netsmb/smb_dev.c +++ b/sys/netsmb/smb_dev.c @@ -132,7 +132,7 @@ nsmb_dev_open(dev_t dev, int oflags, int devtype, struct thread *td) if (sdp && (sdp->sd_flags & NSMBFL_OPEN)) return EBUSY; if (sdp == NULL) { - sdp = malloc(sizeof(*sdp), M_NSMBDEV, 0); + sdp = malloc(sizeof(*sdp), M_NSMBDEV, M_WAITOK); dev->si_drv1 = (void*)sdp; } /* diff --git a/sys/netsmb/smb_iod.c b/sys/netsmb/smb_iod.c index 12c9000..5ae5f14 100644 --- a/sys/netsmb/smb_iod.c +++ b/sys/netsmb/smb_iod.c @@ -248,7 +248,7 @@ smb_iod_sendrq(struct smbiod *iod, struct smb_rq *rqp) } SMBSDEBUG("M:%04x, P:%04x, U:%04x, T:%04x\n", rqp->sr_mid, 0, 0, 0); m_dumpm(rqp->sr_rq.mb_top); - m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, 0); + m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, M_TRYWAIT); error = rqp->sr_lerror = m ? SMB_TRAN_SEND(vcp, m, td) : ENOBUFS; if (error == 0) { getnanotime(&rqp->sr_timesent); @@ -371,7 +371,7 @@ smb_iod_request(struct smbiod *iod, int event, void *ident) int error; SMBIODEBUG("\n"); - evp = smb_zmalloc(sizeof(*evp), M_SMBIOD, 0); + evp = smb_zmalloc(sizeof(*evp), M_SMBIOD, M_WAITOK); evp->ev_type = event; evp->ev_ident = ident; SMB_IOD_EVLOCK(iod); @@ -663,7 +663,7 @@ smb_iod_create(struct smb_vc *vcp) struct smbiod *iod; int error; - iod = smb_zmalloc(sizeof(*iod), M_SMBIOD, 0); + iod = smb_zmalloc(sizeof(*iod), M_SMBIOD, M_WAITOK); iod->iod_id = smb_iod_next++; iod->iod_state = SMBIOD_ST_NOTCONN; iod->iod_vc = vcp; diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c index 9fd14a6..5e0c7a8 100644 --- a/sys/netsmb/smb_rq.c +++ b/sys/netsmb/smb_rq.c @@ -67,7 +67,7 @@ smb_rq_alloc(struct smb_connobj *layer, u_char cmd, struct smb_cred *scred, struct smb_rq *rqp; int error; - MALLOC(rqp, struct smb_rq *, sizeof(*rqp), M_SMBRQ, 0); + MALLOC(rqp, struct smb_rq *, sizeof(*rqp), M_SMBRQ, M_WAITOK); if (rqp == NULL) return ENOMEM; error = smb_rq_init(rqp, layer, cmd, scred); @@ -368,7 +368,7 @@ smb_t2_alloc(struct smb_connobj *layer, u_short setup, struct smb_cred *scred, struct smb_t2rq *t2p; int error; - MALLOC(t2p, struct smb_t2rq *, sizeof(*t2p), M_SMBRQ, 0); + MALLOC(t2p, struct smb_t2rq *, sizeof(*t2p), M_SMBRQ, M_WAITOK); if (t2p == NULL) return ENOMEM; error = smb_t2_init(t2p, layer, setup, scred); @@ -418,7 +418,7 @@ smb_t2_placedata(struct mbuf *mtop, u_int16_t offset, u_int16_t count, struct mbuf *m, *m0; int len; - m0 = m_split(mtop, offset, 0); + m0 = m_split(mtop, offset, M_TRYWAIT); if (m0 == NULL) return EBADRPC; len = m_length(m0, &m); diff --git a/sys/netsmb/smb_smb.c b/sys/netsmb/smb_smb.c index 6a24de6..b5e7c22 100644 --- a/sys/netsmb/smb_smb.c +++ b/sys/netsmb/smb_smb.c @@ -280,8 +280,8 @@ again: error = smb_rq_alloc(VCTOCP(vcp), SMB_COM_SESSION_SETUP_ANDX, scred, &rqp); if (error) return error; - pbuf = malloc(SMB_MAXPASSWORDLEN + 1, M_SMBTEMP, 0); - encpass = malloc(24, M_SMBTEMP, 0); + pbuf = malloc(SMB_MAXPASSWORDLEN + 1, M_SMBTEMP, M_WAITOK); + encpass = malloc(24, M_SMBTEMP, M_WAITOK); if (vcp->vc_sopt.sv_sm & SMB_SM_USER) { /* * We try w/o uppercasing first so Samba mixed case @@ -302,7 +302,7 @@ again: if (vcp->vc_sopt.sv_sm & SMB_SM_ENCRYPT) { uniplen = plen = 24; smb_encrypt(pbuf, vcp->vc_ch, encpass); - ntencpass = malloc(uniplen, M_SMBTEMP, 0); + ntencpass = malloc(uniplen, M_SMBTEMP, M_WAITOK); if (SMB_UNICODE_STRINGS(vcp)) { strncpy(pbuf, smb_vc_getpass(vcp), SMB_MAXPASSWORDLEN); @@ -318,7 +318,7 @@ again: plen = strlen(pbuf) + 1; pp = pbuf; uniplen = plen * 2; - ntencpass = malloc(uniplen, M_SMBTEMP, 0); + ntencpass = malloc(uniplen, M_SMBTEMP, M_WAITOK); smb_strtouni(ntencpass, smb_vc_getpass(vcp)); plen--; @@ -500,8 +500,8 @@ again: pbuf = NULL; encpass = NULL; } else { - pbuf = malloc(SMB_MAXPASSWORDLEN + 1, M_SMBTEMP, 0); - encpass = malloc(24, M_SMBTEMP, 0); + pbuf = malloc(SMB_MAXPASSWORDLEN + 1, M_SMBTEMP, M_WAITOK); + encpass = malloc(24, M_SMBTEMP, M_WAITOK); /* * We try w/o uppercasing first so Samba mixed case * passwords work. If that fails we come back and try diff --git a/sys/netsmb/smb_subr.c b/sys/netsmb/smb_subr.c index ae21133..55c4c26 100644 --- a/sys/netsmb/smb_subr.c +++ b/sys/netsmb/smb_subr.c @@ -94,7 +94,7 @@ smb_strdup(const char *s) int len; len = s ? strlen(s) + 1 : 1; - p = malloc(len, M_SMBSTR, 0); + p = malloc(len, M_SMBSTR, M_WAITOK); if (s) bcopy(s, p, len); else @@ -120,7 +120,7 @@ smb_strdupin(char *s, int maxlen) if (bt == 0) break; } - p = malloc(len, M_SMBSTR, 0); + p = malloc(len, M_SMBSTR, M_WAITOK); copyin(s, p, len); return p; } @@ -135,7 +135,7 @@ smb_memdupin(void *umem, int len) if (len > 8 * 1024) return NULL; - p = malloc(len, M_SMBSTR, 0); + p = malloc(len, M_SMBSTR, M_WAITOK); if (copyin(umem, p, len) == 0) return p; free(p, M_SMBSTR); @@ -152,7 +152,7 @@ smb_memdup(const void *umem, int len) if (len > 8 * 1024) return NULL; - p = malloc(len, M_SMBSTR, 0); + p = malloc(len, M_SMBSTR, M_WAITOK); if (p == NULL) return NULL; bcopy(umem, p, len); diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c index b631a52..cf0adcb 100644 --- a/sys/netsmb/smb_trantcp.c +++ b/sys/netsmb/smb_trantcp.c @@ -514,7 +514,7 @@ smb_nbst_create(struct smb_vc *vcp, struct thread *td) { struct nbpcb *nbp; - MALLOC(nbp, struct nbpcb *, sizeof *nbp, M_NBDATA, 0); + MALLOC(nbp, struct nbpcb *, sizeof *nbp, M_NBDATA, M_WAITOK); bzero(nbp, sizeof *nbp); nbp->nbp_timo.tv_sec = 15; /* XXX: sysctl ? */ nbp->nbp_state = NBST_CLOSED; @@ -648,7 +648,7 @@ smb_nbst_send(struct smb_vc *vcp, struct mbuf *m0, struct thread *td) error = ENOTCONN; goto abort; } - M_PREPEND(m0, 4, 0); + M_PREPEND(m0, 4, M_TRYWAIT); if (m0 == NULL) return ENOBUFS; nb_sethdr(m0, NB_SSN_MESSAGE, m_fixhdr(m0) - 4); |