Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2024 19:02:52 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 76f405ed6354 - main - mbuf: Add mbufq_empty
Message-ID:  <202401091902.409J2qJw098647@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=76f405ed63540aa2d989c231f70277062e76ccfb

commit 76f405ed63540aa2d989c231f70277062e76ccfb
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-01-09 19:00:19 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-01-09 19:00:19 +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
---
 sys/sys/mbuf.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index bb15557b5b6c..b84898fc268e 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1607,6 +1607,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)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401091902.409J2qJw098647>