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)
Sat, Nov 30, 2:05 PM
Unknown Object (File)
Sun, Nov 10, 5:31 AM
Unknown Object (File)
Oct 25 2024, 10:23 AM
Unknown Object (File)
Oct 5 2024, 4:51 PM
Unknown Object (File)
Oct 3 2024, 10:05 AM
Unknown Object (File)
Oct 2 2024, 10:50 PM
Unknown Object (File)
Oct 2 2024, 9:10 PM
Unknown Object (File)
Oct 2 2024, 3:07 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 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.