git: staged mbuf(9): Add m_copyback2() for a better m_copyback()

Aaron LI aly at crater.dragonflybsd.org
Fri Dec 22 00:31:27 PST 2023


commit a754d566388ad1bf59dae942fe7fc64243233d58
Author: Aaron LI <aly at aaronly.me>
Date:   Fri Dec 22 14:51:49 2023 +0800

    mbuf(9): Add m_copyback2() for a better m_copyback()
    
    The existing m_copyback() may extends the mbuf chain if necessary, but
    it doesn't return a value to indicate whether the allocation fails.  In
    addition, it doesn't allow to specify the M_WAITOK/M_NOWAIT flag for
    mbuf allocation.
    
    Extend m_copyback() and name it m_copyback2() that has the 'how'
    parameter to specify M_WAITOK/M_NOWAIT flag and return an error code to
    indication the success/failure.
    
    Reimplement the original m_copyback() using m_copyback2() with
    how=M_NOWAIT.
    
    Referred-to: OpenBSD

Summary of changes:
 share/man/man9/Makefile |  1 +
 share/man/man9/mbuf.9   | 12 ++++++++++++
 sys/kern/uipc_mbuf.c    | 43 ++++++++++++++++++++++++++++++++-----------
 sys/sys/mbuf.h          |  1 +
 4 files changed, 46 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a754d566388ad1bf59dae942fe7fc64243233d58


-- 
DragonFly BSD source repository


More information about the Commits mailing list