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
F167913341: D44150.id135951.diff
Tue, Aug 25, 9:57 AM
F167902677: D44150.id.diff
Tue, Aug 25, 8:45 AM
F167897057: D44150.id136738.diff
Tue, Aug 25, 7:58 AM
F167892165: D44150.id135209.diff
Tue, Aug 25, 7:17 AM
F167889408: D44150.id135828.diff
Tue, Aug 25, 6:52 AM
F167881928: D44150.diff
Tue, Aug 25, 5:45 AM
Unknown Object (File)
Sun, Aug 23, 4:03 PM
Unknown Object (File)
Fri, Aug 21, 3:51 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 56648
Build 53536: 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
2015

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

2023–2024

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

2030

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.