search for: foreignownable

Displaying 2 results from an estimated 2 matches for "foreignownable".

2023 Apr 05
3
[PATCH v2 0/2] rust: virtio: add virtio support
This used to be a single patch, but I split it into two with the addition of struct Scatterlist. Again a bit new with Rust submissions. I was told by Gary Guo to rebase on top of rust-next, but it seems *very* behind? The first patch does not build on its own due to a dead_code warning. It is hard to not have dead code when one is adding infrastructure to be used by others at a later
2023 Apr 07
0
[PATCH v2 2/2] rust: virtio: add virtio support
...data.into_foreign() as _, > + gfp, > + ) > + }; > + Note the comment here: > + // SAFETY: if there is a buffer token, it came from > + // `into_foreign()` as called in `add_sgs()`. > + <T::PrivateData as ForeignOwnable>::from_foreign(buf) To be honest, I tried coming up with something clever to solve this, but couldn't. Ideally this should happen when this function is called: > + extern "C" fn remove_callback(virtio_device: *mut bindings::virtio_device) { But I did not find a way to it...