summaryrefslogtreecommitdiffstats
path: root/sys/netsmb
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2003-01-21 08:56:16 +0000
committeralfred <alfred@FreeBSD.org>2003-01-21 08:56:16 +0000
commitbf8e8a6e8f0bd9165109f0a258730dd242299815 (patch)
treef16a2fb9fa7a7fbc4c19e981d278d5f6eb53234d /sys/netsmb
parent2180deee00350fff613a1d1d1328eddc4c0ba9c8 (diff)
downloadFreeBSD-src-bf8e8a6e8f0bd9165109f0a258730dd242299815.zip
FreeBSD-src-bf8e8a6e8f0bd9165109f0a258730dd242299815.tar.gz
Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
Diffstat (limited to 'sys/netsmb')
-rw-r--r--sys/netsmb/smb_conn.c4
-rw-r--r--sys/netsmb/smb_crypt.c8
-rw-r--r--sys/netsmb/smb_dev.c2
-rw-r--r--sys/netsmb/smb_iod.c6
-rw-r--r--sys/netsmb/smb_rq.c6
-rw-r--r--sys/netsmb/smb_smb.c12
-rw-r--r--sys/netsmb/smb_subr.c8
-rw-r--r--sys/netsmb/smb_trantcp.c4
8 files changed, 25 insertions, 25 deletions
diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c
index 9c52571..2a1e913 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, M_WAITOK);
+ vcp = smb_zmalloc(sizeof(*vcp), M_SMBCONN, 0);
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, M_WAITOK);
+ ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, 0);
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 8e35207..a636932 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, M_WAITOK);
+ ksp = malloc(sizeof(des_key_schedule), M_SMBTEMP, 0);
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, M_WAITOK);
+ p = malloc(14 + 21, M_SMBTEMP, 0);
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, M_WAITOK);
+ unipwd = malloc((len + 1) * sizeof(u_int16_t), M_SMBTEMP, 0);
/*
* S21 = concat(MD4(U(apwd)), zeros(5));
*/
smb_strtouni(unipwd, apwd);
- ctxp = malloc(sizeof(MD4_CTX), M_SMBTEMP, M_WAITOK);
+ ctxp = malloc(sizeof(MD4_CTX), M_SMBTEMP, 0);
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 3f22b16..12abf0a 100644
--- a/sys/netsmb/smb_dev.c
+++ b/sys/netsmb/smb_dev.c
@@ -131,7 +131,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, M_WAITOK);
+ sdp = malloc(sizeof(*sdp), M_NSMBDEV, 0);
dev->si_drv1 = (void*)sdp;
}
/*
diff --git a/sys/netsmb/smb_iod.c b/sys/netsmb/smb_iod.c
index 5ae5f14..12c9000 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, M_TRYWAIT);
+ m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, 0);
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, M_WAITOK);
+ evp = smb_zmalloc(sizeof(*evp), M_SMBIOD, 0);
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, M_WAITOK);
+ iod = smb_zmalloc(sizeof(*iod), M_SMBIOD, 0);
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 5e0c7a8..9fd14a6 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, M_WAITOK);
+ MALLOC(rqp, struct smb_rq *, sizeof(*rqp), M_SMBRQ, 0);
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, M_WAITOK);
+ MALLOC(t2p, struct smb_t2rq *, sizeof(*t2p), M_SMBRQ, 0);
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, M_TRYWAIT);
+ m0 = m_split(mtop, offset, 0);
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 b5e7c22..6a24de6 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, M_WAITOK);
- encpass = malloc(24, M_SMBTEMP, M_WAITOK);
+ pbuf = malloc(SMB_MAXPASSWORDLEN + 1, M_SMBTEMP, 0);
+ encpass = malloc(24, M_SMBTEMP, 0);
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, M_WAITOK);
+ ntencpass = malloc(uniplen, M_SMBTEMP, 0);
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, M_WAITOK);
+ ntencpass = malloc(uniplen, M_SMBTEMP, 0);
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, M_WAITOK);
- encpass = malloc(24, M_SMBTEMP, M_WAITOK);
+ pbuf = malloc(SMB_MAXPASSWORDLEN + 1, M_SMBTEMP, 0);
+ encpass = malloc(24, M_SMBTEMP, 0);
/*
* 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 fe10a5c..3ecfd8f 100644
--- a/sys/netsmb/smb_subr.c
+++ b/sys/netsmb/smb_subr.c
@@ -90,7 +90,7 @@ smb_strdup(const char *s)
int len;
len = s ? strlen(s) + 1 : 1;
- p = malloc(len, M_SMBSTR, M_WAITOK);
+ p = malloc(len, M_SMBSTR, 0);
if (s)
bcopy(s, p, len);
else
@@ -116,7 +116,7 @@ smb_strdupin(char *s, int maxlen)
if (bt == 0)
break;
}
- p = malloc(len, M_SMBSTR, M_WAITOK);
+ p = malloc(len, M_SMBSTR, 0);
copyin(s, p, len);
return p;
}
@@ -131,7 +131,7 @@ smb_memdupin(void *umem, int len)
if (len > 8 * 1024)
return NULL;
- p = malloc(len, M_SMBSTR, M_WAITOK);
+ p = malloc(len, M_SMBSTR, 0);
if (copyin(umem, p, len) == 0)
return p;
free(p, M_SMBSTR);
@@ -148,7 +148,7 @@ smb_memdup(const void *umem, int len)
if (len > 8 * 1024)
return NULL;
- p = malloc(len, M_SMBSTR, M_WAITOK);
+ p = malloc(len, M_SMBSTR, 0);
if (p == NULL)
return NULL;
bcopy(umem, p, len);
diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c
index cf0adcb..b631a52 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, M_WAITOK);
+ MALLOC(nbp, struct nbpcb *, sizeof *nbp, M_NBDATA, 0);
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, M_TRYWAIT);
+ M_PREPEND(m0, 4, 0);
if (m0 == NULL)
return ENOBUFS;
nb_sethdr(m0, NB_SSN_MESSAGE, m_fixhdr(m0) - 4);
OpenPOWER on IntegriCloud