Page MenuHomeFreeBSD

xdr: provide x_putmbuf method for kernel XDR
ClosedPublic

Authored by glebius on Mon, Jan 20, 9:01 PM.
Tags
None
Referenced Files
F109201821: D48547.diff
Sun, Feb 2, 12:26 AM
F109141927: D48547.diff
Sat, Feb 1, 9:02 AM
Unknown Object (File)
Sun, Jan 26, 7:33 PM
Unknown Object (File)
Sun, Jan 26, 7:32 PM
Unknown Object (File)
Sun, Jan 26, 12:24 PM
Unknown Object (File)
Wed, Jan 22, 6:07 PM
Unknown Object (File)
Wed, Jan 22, 3:51 PM
Unknown Object (File)
Wed, Jan 22, 1:01 PM
Subscribers

Details

Summary

Get it implemented for mbuf based XDR. Right now all existing consumers
use only mbuf based XDR. However, future changes will require appending
data stored in an mbuf to memory buffer based XDR.

Diff Detail

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

Event Timeline

sys/rpc/auth_unix.c
254

Above you return the value returned by xdr_putmbuf().
Maybe these other cases should do the same for consistency?
(I haven't looked to see if/when xdr_putmbuf() fails, so I am
not sure if it matters?)

There are several more examples of this below.

sys/rpc/auth_unix.c
254

The xdr_putmbuf() on the mbuf based xdr always succeeds. Just like xdrmbuf_append() was a void. I think in all cases where I omit returning return of xdr_putmbuf() is where we know that it is mbuf based xdr. But I will recheck this. Thanks!

Maybe bringing to the same style of return (xdr_putmbuf()), or asserting that that return value is TRUE is better than current version. What would you prefer?

sys/rpc/auth_unix.c
254

Either sounds fine to me.

Consistently either return return value of the method, or annotate with void.

Note that void annotated places all explicitly operate on mbuf-based xdr,
that was created few lines above. For this type of xdr, the method never
fails.

This revision is now accepted and ready to land.Sat, Jan 25, 8:54 PM
This revision was automatically updated to reflect the committed changes.