Page MenuHomeFreeBSD

mbuf: provide mc_uiotomc() a function to copy from uio(9) to mchain
ClosedPublic

Authored by glebius on Feb 29 2024, 7:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 17, 11:21 PM
Unknown Object (File)
Fri, Jan 10, 1:13 AM
Unknown Object (File)
Fri, Jan 10, 1:12 AM
Unknown Object (File)
Fri, Jan 10, 12:02 AM
Unknown Object (File)
Thu, Jan 9, 11:56 PM
Unknown Object (File)
Thu, Jan 9, 3:24 PM
Unknown Object (File)
Dec 11 2024, 4:27 PM
Unknown Object (File)
Dec 3 2024, 1:17 PM
Subscribers

Details

Summary

Implement m_uiotombuf() as a wrapper around mc_uiotomc(). The M_EXTPG is
left untouched. The m_uiotombuf() is left as a compat KPI. New code
should use either mc_uiotomc() or m_uiotombuf_nomap().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56345
Build 53233: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Feb 29 2024, 9:42 AM
markj added inline comments.
sys/kern/uipc_mbuf.c
1985

It would be nice to explain what "len" and "lspace" are.

2007

What's the purpose of trying to handle the overflow case? We are silently truncating the uio and creating a 4GB chain, which presumably isn't what the caller wants...?

2020

Can you get rid of progress and just use mc->mc_len?

This revision now requires review to proceed.Mar 16 2024, 6:11 PM
markj added inline comments.
sys/kern/uipc_mbuf.c
1998

I'd also assert that uio->uio_segflg == UIO_WRITE.

This revision is now accepted and ready to land.Mar 18 2024, 5:28 AM

Utilize mc_first/etc.
Add assertion uio->uio_segflg == UIO_WRITE.

This revision now requires review to proceed.Mar 18 2024, 6:12 PM
markj added inline comments.
sys/kern/uipc_mbuf.c
1998

Sorry, I meant uio_rw of course. But why do you assert segflg == UIO_USERSPACE? It should be valid for kernel UIOs as well.

This revision is now accepted and ready to land.Mar 19 2024, 5:03 AM

Don't assert uio is from userspace.

This revision now requires review to proceed.Mar 19 2024, 2:56 PM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 8 2024, 8:30 PM
This revision was automatically updated to reflect the committed changes.