containers / composefs-rs

Rust library for the composefs filesystem
Apache License 2.0
7 stars 2 forks source link

Clean up tar header handling #2

Open allisonkarlitskaya opened 1 month ago

allisonkarlitskaya commented 1 month ago

One of the following needs to happen:

allisonkarlitskaya commented 1 month ago

Our home-brew header handling code is half decent at this point...

allisonkarlitskaya commented 1 month ago

Another idea for how we could maybe force the tar crate to do our bidding: we could try to return an error from our read() implementation that contained the object reference. I'm not sure if it's possible to encode that in an std::io::Result, though? Those seem kinda like they're basically an errno...

allisonkarlitskaya commented 1 month ago

Another thing to consider here is performance: our current approach is forced to allocate the path so that it can return a TarEntry (removing itself from the stack in the process).

If we did a callback instead of returning, then we could serve pointers directly out of the tar header. If we wanted to get very fancy we could take advantage of the fact that we only ever process one splitstream inline chunk at a time and also store slice pointers to the xattr and pax longname data.