git: c62e10adba63 - stable/13 - mbuf: Add mbufq_empty
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 18 Jan 2024 22:39:49 UTC
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=c62e10adba6391809ac20aaf942c1ab7ad2b255c
commit c62e10adba6391809ac20aaf942c1ab7ad2b255c
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-01-09 19:00:19 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-01-18 22:37:20 +0000
mbuf: Add mbufq_empty
Complement to the existing mbufq_full
Reviewed by: bz
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43337
(cherry picked from commit 76f405ed63540aa2d989c231f70277062e76ccfb)
---
sys/sys/mbuf.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index d44ff5e2afb7..a92c0924386b 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1563,6 +1563,12 @@ mbufq_last(const struct mbufq *mq)
return (STAILQ_LAST(&mq->mq_head, mbuf, m_stailqpkt));
}
+static inline bool
+mbufq_empty(const struct mbufq *mq)
+{
+ return (mq->mq_len == 0);
+}
+
static inline int
mbufq_full(const struct mbufq *mq)
{