sapling/eden/fs/fuse
Marshall Cline dfac9dda4a use rvalue-qual Future::ensure(): pass 2
Summary:
This is part of "the great r-valuification of folly::Future":

* This is something we should do for safety in general.
* Several of folly::Future's methods are lvalue-qualified even though they act as though they are rvalue-qualified, that is, they provide a postcondition that says, in effect, callers should act as though the method invalidated its `this` object (regardless of whether that invalidation was actual or logical).
* This violates the C++ principle to "Express ideas directly in code" (see Core Guidelines), and generally makes it more confusing for callers as well as hiding the actual semantics from tools (linters, compilers, etc.).
* This dichotomy and confusion has manifested itself by some failures around D7840699 since lvalue-qualification hides that operation's move-out semantics - leads to some use of future operations that are really not correct, but are not obviously incorrect.
* The goal of rvalueification is to make sure methods that are logically rvalue-qualified are actually rvalue-qualified, which forces callsites to acknowledge that rvalueification, e.g., `std::move(f).ensure(...)` instead of `f.ensure(...)`. This syntactic change in the callsites forces callers to acknowledge the method's rvalue semantics.

This diff started as a Codemod, then required manual fixes. Here were the codemod steps:

* expr.ensure(...) ==> std::move(expr).ensure(...)  // if expr is not already an xvalue
* expr->ensure(...) ==> std::move(*expr).ensure(...)

Note: operator precedence of that last step is safe - no need to parenthesize `expr`. Reason: `->` binds more tightly than unary `*`.

Reviewed By: yfeldblum

Differential Revision: D9332070

fbshipit-source-id: 882121fe82c05fdb196ce676db686b6bc254974b
2018-08-16 20:37:45 -07:00
..
fuse_tester update PrivHelper to support detaching from an EventBase 2018-06-18 17:22:18 -07:00
privhelper use rvalue-qual Future::ensure(): pass 2 2018-08-16 20:37:45 -07:00
test Fix data race in Eden fuse driver handling of FUSE_INTERRUPT 2018-07-27 14:36:42 -07:00
BufVec.cpp remove the fusell namespace 2018-03-19 17:01:52 -07:00
BufVec.h remove the fusell namespace 2018-03-19 17:01:52 -07:00
CMakeLists.txt add CMake build files 2018-04-30 14:37:46 -07:00
DirHandle.h mark a bunch of folly::Future<folly::Unit> functions with FOLLY_NODISCARD 2018-04-26 21:00:25 -07:00
DirList.cpp remove the fusell namespace 2018-03-19 17:01:52 -07:00
DirList.h remove the fusell namespace 2018-03-19 17:01:52 -07:00
Dispatcher.cpp move folly/experimental/logging to folly/logging/ 2018-04-30 21:29:29 -07:00
Dispatcher.h Enabled additional compiler warnings in Eden. 2018-06-01 11:39:01 -07:00
EdenStats.cpp Enabled additional compiler warnings in Eden. 2018-06-01 11:39:01 -07:00
EdenStats.h Enabled additional compiler warnings in Eden. 2018-06-01 11:39:01 -07:00
FileHandle.cpp remove the fusell namespace 2018-03-19 17:01:52 -07:00
FileHandle.h mark a bunch of folly::Future<folly::Unit> functions with FOLLY_NODISCARD 2018-04-26 21:00:25 -07:00
FileHandleBase.cpp remove the fusell namespace 2018-03-19 17:01:52 -07:00
FileHandleBase.h remove the fusell namespace 2018-03-19 17:01:52 -07:00
FileHandleMap.cpp move folly/experimental/logging to folly/logging/ 2018-04-30 21:29:29 -07:00
FileHandleMap.h remove the fusell namespace 2018-03-19 17:01:52 -07:00
FuseChannel.cpp Fix data race in Eden fuse driver handling of FUSE_INTERRUPT 2018-07-27 14:36:42 -07:00
FuseChannel.h declare the FuseChannel::InvalidationEntry move constructor noexcept 2018-03-30 15:16:13 -07:00
FuseTypes.cpp remove the fusell namespace 2018-03-19 17:01:52 -07:00
FuseTypes.h remove the fusell namespace 2018-03-19 17:01:52 -07:00
handlemap.thrift move InodeMap serialization to new takeover.thrift file 2018-01-17 11:51:30 -08:00
PollHandle.cpp remove the fusell namespace 2018-03-19 17:01:52 -07:00
PollHandle.h remove the fusell namespace 2018-03-19 17:01:52 -07:00
RequestData.cpp Fix data race in Eden fuse driver handling of FUSE_INTERRUPT 2018-07-27 14:36:42 -07:00
RequestData.h Fix data race in Eden fuse driver handling of FUSE_INTERRUPT 2018-07-27 14:36:42 -07:00