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)
Mon, May 27, 2:25 AM
Unknown Object (File)
Sat, May 25, 4:14 PM
Unknown Object (File)
Sun, May 19, 5:13 PM
Unknown Object (File)
Sun, May 19, 5:12 PM
Unknown Object (File)
Sun, May 19, 5:12 PM
Unknown Object (File)
Thu, May 16, 5:28 PM
Unknown Object (File)
Sun, May 12, 11:29 AM
Unknown Object (File)
Sun, May 12, 5:27 AM
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 Not Applicable
Unit
Tests Not Applicable

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
2014

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

2022–2023

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

2029

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...?

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

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
2000

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.