Closed wmanley closed 3 years ago
@cberner: I now consider this ready for review. I've not yet deduplicated async_api/reply.rs
as I have a more extensive deduplication planned for a future PR and I don't want to duplicate that work.
Great! I'm in the process of reverting the async changes, since #133 is abandoned, but then will take a look at this
Started going through the commits one at a time, since there are so many.
Yeah, there's a lot. I tried to break them up to make it easier to review/bisect.
Also, mind rebasing?
Done
Started going through the commits one at a time, since there are so many.
Yeah, there's a lot. I tried to break them up to make it easier to review/bisect.
Yep, definitely appreciated! It's much easier to review this way
@wmanley I think I'm missing some context. There are a bunch of new .reply()
methods on the types in ll::request
, but they're all marked as dead code. What are they intended for?
Noticed one typo. Otherwise the commits up through "ReplyRaw: Check for integer overflow" look good.
I've raised #137 with the commits up till there so as to allow merging incrementally. I've fixed the typo there. I'll rebase this PR once that's merged.
@wmanley I think I'm missing some context. There are a bunch of new
.reply()
methods on the types inll::request
, but they're all marked as dead code. What are they intended for?
Yes indeed, they are not used yet. With this PR and #119 I've been working towards creating #136 - an enum based API which I believe offers significant advantages as compared to a trait based one. You can get a feel for how the .reply()
will be used looking here: https://github.com/cberner/fuser/pull/136/commits/f05d437f5b3c5aa05ccfb821ad7787401549e8a8?diff=unified&w=1 (view hiding whitespace changes to get a better feel for it). Basically: users can't create Response
s directly because the Response::new_*
methods are pub(crate)
. They instead create them by calling .reply()
on the operation they've been passed. op.reply
will always return a Response
of the correct type for that Request
type.
reply
isn't used in this PR, but it seemed natural to include it here as I was working through each reply type.
Ah, I see. Cool, I'll take a look at that. I merged #137 :)
Rebased since #137 is merged
I just fixed some clippy lints and have rebased them into the relevant commits. No exciting changes made.
Ok, now that I understand how #136 works I think I see what these are for. I'd like to merge this work in a way that doesn't involve adding dead code though. Is there an obvious way to break it up into medium sized PRs that add end-to-end functionality?
Ok, now that I understand how #136 works I think I see what these are for. I'd like to merge this work in a way that doesn't involve adding dead code though. Is there an obvious way to break it up into medium sized PRs that add end-to-end functionality?
Unfortunately I don't know how to do this. I'm trying to gradually work towards #136, but until we make these types public there is going to be code in this crate that is unused, because it's not yet callable from outside the crate. I see the #[allow(dead_code)]
as an advantage really - if this work does come to naught then it's easy to find the code that can be deleted by grepping for that.
Two alternatives:
reply
functions in this PR, but instead merge them all in big PR later along with the #136 and any other code that is required for the enum API.I think it's a bit premature for the former, and the latter seems like it would be hard to review.
I see, ok I'll review this as-is then! Should have time this weekend. Maybe sooner.
One thing, I may end up asking for changes to these pieces, when we get to the future PRs and I see how everything fits together. Just fair warning :)
I see, ok I'll review this as-is then! Should have time this weekend. Maybe sooner.
Thanks
One thing, I may end up asking for changes to these pieces, when we get to the future PRs and I see how everything fits together. Just fair warning :)
Yeah, I'm expecting the API will continue to evolve before it's ready to be made public. Porting simple.rs to this API has been really helpful in identifying areas where the API could be better, and when I port ostree-fuse to this API I'm expecting to learn more about how the API could be improved.
Merged. Thanks!
Raising for early visibility.
Should help reduce duplication between sync and async APIs, e.g. with #130.
TODO