1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Use MBTOM() to convert mbuf allocator flags to malloc() flags, rather

than using the same compare/substitute in many places.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
This commit is contained in:
Robert Watson 2003-04-14 16:04:10 +00:00
parent cf0d8a1e48
commit aa65d9f538
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113480
2 changed files with 3 additions and 5 deletions

View File

@ -566,13 +566,12 @@ mb_pop_cont(struct mb_lstmngr *mb_list, int how, struct mb_pcpu_list *cnt_lst)
return (NULL); return (NULL);
bucket = malloc(sizeof(struct mb_bucket) + bucket = malloc(sizeof(struct mb_bucket) +
mb_list->ml_objbucks * sizeof(void *), M_MBUF, mb_list->ml_objbucks * sizeof(void *), M_MBUF, MBTOM(how));
how == M_TRYWAIT ? M_WAITOK : M_NOWAIT);
if (bucket == NULL) if (bucket == NULL)
return (NULL); return (NULL);
p = (caddr_t)kmem_malloc(mb_list->ml_map, mb_list->ml_objsize * p = (caddr_t)kmem_malloc(mb_list->ml_map, mb_list->ml_objsize *
mb_list->ml_objbucks, how == M_TRYWAIT ? M_WAITOK : M_NOWAIT); mb_list->ml_objbucks, MBTOM(how));
if (p == NULL) { if (p == NULL) {
free(bucket, M_MBUF); free(bucket, M_MBUF);
if (how == M_TRYWAIT) if (how == M_TRYWAIT)

View File

@ -140,8 +140,7 @@ m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int how)
mac_create_mbuf_from_mbuf(from, to); mac_create_mbuf_from_mbuf(from, to);
#endif #endif
SLIST_INIT(&to->m_pkthdr.tags); SLIST_INIT(&to->m_pkthdr.tags);
return (m_tag_copy_chain(to, from, (how & M_TRYWAIT) ? M_WAITOK : return (m_tag_copy_chain(to, from, MBTOM(how)));
M_NOWAIT));
} }
/* /*