mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +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:
parent
cf0d8a1e48
commit
aa65d9f538
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113480
@ -566,13 +566,12 @@ mb_pop_cont(struct mb_lstmngr *mb_list, int how, struct mb_pcpu_list *cnt_lst)
|
||||
return (NULL);
|
||||
|
||||
bucket = malloc(sizeof(struct mb_bucket) +
|
||||
mb_list->ml_objbucks * sizeof(void *), M_MBUF,
|
||||
how == M_TRYWAIT ? M_WAITOK : M_NOWAIT);
|
||||
mb_list->ml_objbucks * sizeof(void *), M_MBUF, MBTOM(how));
|
||||
if (bucket == NULL)
|
||||
return (NULL);
|
||||
|
||||
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) {
|
||||
free(bucket, M_MBUF);
|
||||
if (how == M_TRYWAIT)
|
||||
|
@ -140,8 +140,7 @@ m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int how)
|
||||
mac_create_mbuf_from_mbuf(from, to);
|
||||
#endif
|
||||
SLIST_INIT(&to->m_pkthdr.tags);
|
||||
return (m_tag_copy_chain(to, from, (how & M_TRYWAIT) ? M_WAITOK :
|
||||
M_NOWAIT));
|
||||
return (m_tag_copy_chain(to, from, MBTOM(how)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user