Commit Graph

215 Commits

Author SHA1 Message Date
Matt Glazar
1057039562 Encapsulate EdenStats
Summary:
EdenStats is currently an alias for ThreadLocal<EdenThreadStats>. I want to split EdenThreadStats into two structs which are allocated independently, but EdenStats's interface makes this impossible.

Refactor EdenStats from an alias to a class and encapsulate the underlying ThreadLocal<EdenThreadStats> member.

This diff should not change behavior.

Reviewed By: simpkins

Differential Revision: D14822272

fbshipit-source-id: 691f4731aa22ecbdcd3535ee0bb0b99c816ffc3d
2019-04-14 20:45:16 -07:00
Matt Glazar
11195c2b0b Rename ThreadLocalEdenStats to EdenStats
Summary:
I'm confused by the naming of EdenThreadStats and ThreadLocalEdenStats. For example, when I see "ThreadLocalEdenStats", I think that such objects can only be accessed by one thread. That's definitely not what "ThreadLocalEdenStats" means!

I think the following naming scheme makes more sense:

* **EdenThreadStats**: Statistics which are updated by one thread. Currently called EdenThreadStats.
* **EdenStats**: Statistics for all threads. Provides access to EdenThreadStats. Currently called ThreadLocalEdenStats.

Implement my preferred scheme: rename ThreadLocalEdenStats to EdenStats.

This diff should not change behavior.

Note: Prior to D14822274, EdenThreadStats was called EdenStats.

Reviewed By: simpkins

Differential Revision: D14822271

fbshipit-source-id: bd20179b1010588e3fc16dc9ed0657d458606f16
2019-04-14 20:45:16 -07:00
Matt Glazar
8bfb4fe9cb Rename EdenStats to EdenThreadStats
Summary:
I'm confused by the naming of EdenStats and ThreadLocalEdenStats. For example, when I see "ThreadLocalEdenStats", I think that such objects can only be accessed by one thread. That's definitely not what "ThreadLocalEdenStats" means!

I think the following naming scheme makes more sense:

* **EdenThreadStats**: Statistics which are updated by one thread. Currently called EdenStats.
* **EdenStats**: Statistics for all threads. Provides access to EdenThreadStats. Currently called ThreadLocalEdenStats.

Implement half of my preferred scheme: rename EdenStats to EdenThreadStats. (Make this diff easier to read by renaming ThreadLocalEdenStats to EdenStats in a separate diff.) In effect, implement the following naming scheme:

* **EdenThreadStats**: Statistics which are updated by one thread. (was EdenStats)
* **ThreadLocalEdenStats**: Statistics for all threads. Provides access to EdenThreadStats. (no change)

This diff should not change behavior.

Reviewed By: simpkins

Differential Revision: D14822274

fbshipit-source-id: 236cd9878cd249a06d14e124050ee01329667a18
2019-04-14 20:45:16 -07:00
Matt Glazar
d9e4eabc9d Move EdenStats into eden/fs/tracing/
Summary:
I want to use EdenStats in eden/fs/store/. EdenStats currently lives in eden/fs/fuse/, and making eden/fs/store/ depend upon eden/fs/fuse/ is confusing. (It's also confusing that some code in eden/fs/fuse/ is used on Windows.)

Reorganize the code: move EdenStats into eden/fs/tracing/.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D14677337

fbshipit-source-id: af26d214bcc3a9919920fbd4e59e6098fe4e3834
2019-04-01 17:41:57 -07:00
Chad Austin
c804232e52 opt into readdir caching if the kernel supports it but not FUSE_NO_OPENDIR_SUPPORT
Summary:
When Eden runs on kernel 4.20 (has readdir caching but not
FUSE_NO_OPENDIR_SUPPORT) indicate to the kernel that Eden wants
readdir results to be cached.

Reviewed By: wez

Differential Revision: D13893922

fbshipit-source-id: 3092adb16dabc4273bdba1e6e9f15e9e3bd7bb87
2019-03-22 15:57:33 -07:00
Chad Austin
cc1c841004 stop handling opendir and releasedir on kernels with FUSE_NO_OPENDIR_SUPPORT
Summary:
Eden requires no state in its directory handles, so tell the kernel it
doesn't need to send opendir() and releasedir() requests, provided it
has FUSE_NO_OPENDIR_SUPPORT.

Reviewed By: strager

Differential Revision: D13594734

fbshipit-source-id: ebd4b69f4efcd1428a69024c4bdffb1ae455fa40
2019-03-22 15:57:33 -07:00
Chad Austin
1a1dbccb1d add osxfuse kernel header
Summary:
Eden needs the osxfuse version of the FUSE protocol on mac. The open
source cmake build pulls in osxfuse with getdeps.py, but that doesn't
work in the Buck build, and all we need is this one (old) copy of the
Linux kernel headers.

Reviewed By: strager

Differential Revision: D14506747

fbshipit-source-id: 028ddbaf80be9cad412462f3338c30b8f2a70087
2019-03-19 10:26:24 -07:00
Zeyi Fan
2b086dfe3e fix oss macOS build
Summary: This diff fixes Eden build on macOS.

Reviewed By: chadaustin

Differential Revision: D14507115

fbshipit-source-id: fdf460ebadc2e69b1cf3fc40a6fd3e104dbc2833
2019-03-18 14:12:57 -07:00
Adam Simpkins
0e9d62783d tweak error log messages for unhandled fuse opcodes.
Summary:
Update the FuseChannel code to explicitly handle `FUSE_LSEEK` and `FUSE_POLL`
to avoid emitting error log messages about these calls not being implemented.
We intentionally do not implement these operations at the moment.

Also drop the log about other unknown opcodes from an error log to a warning
message.

Reviewed By: chadaustin

Differential Revision: D14453246

fbshipit-source-id: 2605cf7e5c160cda92460a80187438ac3549ade5
2019-03-14 13:07:09 -07:00
Adam Simpkins
d529f75e9e tweak the log levels of some FUSE log messages
Summary:
I want to change some of the StartupLogger behavior to automatically show all
INFO and higher level log messages to the user during start-up.  These two
messages from the FUSE code are currently logged at the INFO level, but don't
really seem important enough to show to the user.

This drops their level to DBG1.  These messages will therefore still be shown
in the normal `edenfs.log` file, since it includes everything from DBG2 and
up.

Reviewed By: chadaustin

Differential Revision: D14453247

fbshipit-source-id: 5d79766f87e658b807029d82ac035cb94ae68832
2019-03-14 13:07:09 -07:00
Matt Glazar
201fef1c2e Create exception type for FUSE unmount-during-init
Summary:
FuseChannel::initialize throws runtime_error when the FUSE connection is interrupted. I want EdenMount::startFuse to handle unexpected-unmount errors from FuseChannel::initialize, but catching runtime_error would catch unrelated errors too.

When the FUSE connection is interrupted during initialization, make FuseChannel throw FuseDeviceUnmountedDuringInitialization instead of runtime_error.

Reviewed By: chadaustin

Differential Revision: D14077848

fbshipit-source-id: ed7b7d370a83ed1a9c36a443d8bb06ba940dc032
2019-03-11 20:48:27 -07:00
Yedidya Feldblum
92a8e3f59f Stop checking EventBase::runInEventBaseThread result
Summary:
[Folly] Stop checking `EventBase::runInEventBaseThread` result, as the function will soon be changed not to return any result.

It returned `false` when failing to enqueue a task. But it cannot really fail anyway besides allocation failure, unless in the `EventBase` destructor and while draining and the `AlwaysEnqueue` variant is called.

Reviewed By: andriigrynenko

Differential Revision: D14254969

fbshipit-source-id: a6a9199cbafa18b61488a240e4318ce946953f51
2019-02-28 02:36:15 -08:00
Chad Austin
015c45872b split privhelper and privhelper_base
Summary:
We're not that far from building privhelper on mode/mac but it does
require figuring out how to depend on osxfuse from the Buck build, so
bypass that by breaking the inodes target's dependency on privhelper's
<fuse_ioctl.h> include.

Reviewed By: strager

Differential Revision: D14218709

fbshipit-source-id: edbb2a21df06d6f2a4f860ef13718ad05d445e98
2019-02-27 19:06:00 -08:00
Chad Austin
b8dc8a80c3 only include selinux on linux
Summary: We should only attempt to include selinux on Linux, not macOS.

Reviewed By: strager

Differential Revision: D14181109

fbshipit-source-id: be47b7bdadc3409577fa114559e905214848ebd8
2019-02-22 16:14:48 -08:00
Michael Liu
b626f922ce Apply modernize-use-override (2nd iteration)
Summary:
Use C++11’s override and remove virtual where applicable.
Change are automatically generated.

Reviewed By: simpkins

Differential Revision: D14087291

fbshipit-source-id: 80e6a393c5ed8ea1656855da3832bcee10635004
2019-02-14 17:29:27 -08:00
Chad Austin
1c84f3f115 split InodeNumber into its own file
Summary:
It's common for code to use InodeNumber without needing to include the
main FUSE headers or vice versa. Split them into two separate headers.

Reviewed By: strager

Differential Revision: D13979868

fbshipit-source-id: c5eeb6a3697bb538729a403434dc4f0f7408cda0
2019-02-08 16:21:35 -08:00
Matt Glazar
25327947e0 Delete dead definition of InodeNumber
Summary: FuseTypes.h defines the InodeNumber struct, but also has a comment which implies that InodeNumber is an alias of uint64_t. Delete this misleading commented-out definition of InodeNumber.

Reviewed By: chadaustin

Differential Revision: D13892907

fbshipit-source-id: 8e9710db29d8e0d708ee1785956f6953a0b2a49f
2019-01-31 12:59:48 -08:00
Chad Austin
c97631eba4 log sendInvalidateInode and sendInvalidateEntry calls and ENOENT errors
Summary:
When debugging Eden's behavior under a kernel that caches readdir
calls, I observed that directories were not returning the correct
entries after a checkout. The issue is that Eden calls INVAL_ENTRY
when new entries are added, but INVAL_ENTRY is a no-op and returns
ENOENT if the kernel doesn't know about that entry.

Reviewed By: strager

Differential Revision: D13864281

fbshipit-source-id: 56b3a67d0bc6f8ed1733acaf5e889414b753cbc7
2019-01-30 23:00:38 -08:00
Matt Glazar
0b151df7b3 Delete unused function declaration
Summary: PrivHelperServer::initLogging is declared in the .h file, but it's never defined. Remove the useless declaration.

Reviewed By: simpkins

Differential Revision: D13814416

fbshipit-source-id: 25cb47442a19947da08d13d9bed9b4631a1c9739
2019-01-28 11:32:56 -08:00
Jon Maltiel Swenson
79b7db4d91 Make EventBase destruction callbacks safely cancellable
Summary: Currently, `runOnDestruction` aims to be thread-safe; new callbacks are added to the `onDestructionCallbacks_` list while the associated mutex is held. However, the caller may own the `LoopCallback` and wish to destroy/cancel it before the `EventBase` destructor runs, and this callback cancellation is not thread-safe, since unlinking does not happen under the lock protecting `onDestructionCallbacks_`. The primary motivation of this diff is to make on-destruction callback cancellation thread-safe; in particular, it is safe to cancel an on-destruction callback concurrently with `~EventBase()`.

Reviewed By: spalamarchuk

Differential Revision: D13440552

fbshipit-source-id: 65cee1e361d37647920baaad4490dd26b791315d
2019-01-24 15:57:39 -08:00
Chad Austin
4f532889d1 reenable ProcessNameCache
Summary:
Now that the deadlock in ProcessNameCache has been fixed, bring it
back.

Reviewed By: strager

Differential Revision: D13742965

fbshipit-source-id: f407105e06b9954766bdb48ef1303e2003c07284
2019-01-24 15:45:29 -08:00
Wez Furlong
2ba72dc18e eden: have priv helper load the fuse kext if needed
Summary:
This is something that is not needed on linux because
the kernel module is typically already loaded (at least on the systems
on which we run).

On macos, since fuse is not part of the kernel, libfuse has some code
that loads it when needed.

This diff performs the equivalent actions for eden.

Reviewed By: simpkins

Differential Revision: D13721489

fbshipit-source-id: 627bc90681141d0e7da3d5b5e06756a36839958c
2019-01-17 18:52:53 -08:00
Wez Furlong
4e596a944b eden: implement mount/unmount for osxfuse
Summary:
Note that the concept of bind mounts doesn't exist on macos, so that
portion of the server just throws.

Reviewed By: simpkins

Differential Revision: D13480147

fbshipit-source-id: 92225188c0af42574d090004490f3926d393747b
2019-01-17 18:52:53 -08:00
Wez Furlong
1fac9783e3 eden: remove fuse request interrupt code, track requests by internal id
Summary:
This is really a continuation of D13479516; the issue is that
the osxfuse kernel module is very eager to recycle `unique` request
id values, recycling them before our code has had a chance to update
internal state.

This diff re-keys the requests map so that we generate our own sequence
of identifiers to use as the key rather than the fuse protocol `unique`
value.

Because we cannot reliably track by `unique` value we also cannot
reliably implement interrupt support.  We've never really tested
interrupt support, and it relies on functionality in folly futures
that hasn't really been tested or proven either, so I've removed
that functionality as part of this diff.

That allows simplifying some code in RequestData and FuseChannel;
we're now able to simply tack an `.ensure` on the end of the
future chain to ensure that we remove the entry from the map
once the future is resolved, successfully or otherwise.

Reviewed By: chadaustin

Differential Revision: D13679964

fbshipit-source-id: c1081a868c4061de2a725589ec1614959a8e9316
2019-01-16 14:35:33 -08:00
Wez Furlong
8dcc59c36b eden: improve debug logging for errors and requests
Summary: This just makes the debug a little easier to follow.

Reviewed By: chadaustin

Differential Revision: D13680020

fbshipit-source-id: e4045822e56ba42a831ccb0ceaa9baaba5b79a10
2019-01-15 17:29:24 -08:00
Wez Furlong
54d86f2574 eden: fixup attributes with osxfuse
Summary:
the osxfuse implementation includes some additional
fields in the `fuse_attr` struct.  One of those fields is
`flags`.  We were not initializing this field when converting
the stat data to fuse attributes which resulted in it holding
"random" data.  In debug builds this seemed to usually end up
zeroed out but in release builds it was usually a bit pattern
that caused the kernel to respond with EPERM when attempting
to access the files.   I didn't capture exactly what that
bit pattern was, just that initializing the struct to zeroes
reliably fixed up the EPERM issues in the Release build.

Reviewed By: chadaustin

Differential Revision: D13680004

fbshipit-source-id: 6b2ce6c10ef8f7db4a8a50bd3f2ddcfdddc3bb45
2019-01-15 17:29:24 -08:00
Wez Furlong
13c2d03331 eden: fixup compilation warning with clang
Summary:
Address this error with clang:

```
In file included from /Users/wez/fbsource/fbcode/eden/oss/eden/fs/service/main.cpp:25:
/Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/privhelper/PrivHelper.h:22:1: warning: class 'Unit' was previously declared as a struct [-Wmismatched-tags]
class Unit;
^
/Users/wez/fbsource/fbcode/eden/oss/external/install/include/folly/Unit.h:36:8: note: previous use is here
struct Unit {
       ^
/Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/privhelper/PrivHelper.h:22:1: note: did you mean struct here?
class Unit;
^~~~~
struct
```

Reviewed By: strager

Differential Revision: D13602383

fbshipit-source-id: 6e69716498680660181ab441c3c007b074ec1d40
2019-01-14 13:52:36 -08:00
Chad Austin
09a27f492a debug logging (once) when ENODEV is received from the fuse device
Summary:
To determine the precise behavior of unmounting an Eden mount with
MNT_FORCE, I needed to see whether ENODEV was being returned from the
FUSE socket.

This helps us clarify the documentation in libfuse
https://github.com/libfuse/libfuse/issues/333

Reviewed By: strager

Differential Revision: D13630289

fbshipit-source-id: 90e6f0afc927c042a24cd6c82deac644c15ed066
2019-01-11 15:11:14 -08:00
Matt Glazar
e9f5639b1f Make ProcessNameCache optional for ProcessAccessLog
Summary:
To mitigate a deadlock, I want to make ProcessAccessLog not access /proc/. Allow this by making ProcessNameCache optional.

This diff should not change behavior.

Reviewed By: simpkins

Differential Revision: D13540948

fbshipit-source-id: 4c5d68c972c04122de1d2414084debfec078dd4c
2018-12-21 15:43:51 -08:00
Chad Austin
26a244f8c8 enable FUSE_PARALLEL_DIROPS
Summary:
Eden can handle parallel readdir and lookup so don't require the
kernel to acquire a mutex just to serialize the requests.

5c672ab3f0

Reviewed By: strager

Differential Revision: D13386133

fbshipit-source-id: aa935af941ff2901b07b63751c97052c295f7076
2018-12-18 13:03:45 -08:00
Wez Furlong
8190b08254 eden: fixup some fuse version differences for osxfuse
Summary:
The fuse opcodes are defined as an enum so we have to use
the relatively coarse and indirect apple vs linux preprocessor
checks in the maps for the opcode names.

The osxfuse implementation branched off from the 7.19 fuse
implementation, so add a light dusting of some preprocessor
checks around enabling the performance optimization features
we desire on Linux.

We also need to relax the compile time check for the min
fuse version; I've constrained this to be apple specific,
although I suppose it wouldn't hurt to make it more broadly
applicable.

Reviewed By: chadaustin

Differential Revision: D13480145

fbshipit-source-id: 010ac114e22ea942dfcebf1105cb1f01b766f297
2018-12-17 20:16:19 -08:00
Wez Furlong
0774b2c457 eden: pull in osxfuse kernel headers
Summary:
There's nothing nice about this; the full set of kernel headers are
not installed with the binary distribution, and since the kernel distribution
has to be signed to be loaded on osx, there's no benefit to us building it
for ourselves.

This diff adds a nop builder and tweaks the cmake to point into the osxfuse
repo.

The osxfuse repo aggregates a couple of related repos using the git
submodule feature, so trigger that from getdeps.py too.

Reviewed By: strager

Differential Revision: D13480148

fbshipit-source-id: 84e09a86f6a83f83ffd1e3fe113dc7b15b3ea208
2018-12-17 20:16:19 -08:00
Wez Furlong
b69536b6d4 eden: no SOCK_CLOEXEC on darwin
Summary:
handle this best-effort by setting this bit on each fd after
allocating them.

Reviewed By: strager

Differential Revision: D13475712

fbshipit-source-id: 46be80f025b21967f75822f983bc327c5e2d20af
2018-12-17 20:16:18 -08:00
Wez Furlong
60645f897d eden: forward decl of DirList is insufficient for clang on macos
Summary:
Avoid this compilation error:

```
[ 23%] Building CXX object eden/fs/fuse/CMakeFiles/eden_fuse.dir/Dispatcher.cpp.o
In file included from /Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/Dispatcher.cpp:10:
In file included from /Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/Dispatcher.h:12:
In file included from /Users/wez/fbsource/fbcode/eden/oss/external/install/include/folly/Portability.h:19:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/cstddef:110:
/Library/Developer/CommandLineTools/usr/include/c++/v1/type_traits:3141:38: error: incomplete type 'facebook::eden::DirList' used in type trait expression
    : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
                                     ^
/Users/wez/fbsource/fbcode/eden/oss/external/install/include/folly/futures/Future.h:146:36: note: in instantiation of template class 'std::__1::is_constructible<facebook::eden::DirList>' requested here
      typename std::enable_if<std::is_constructible<T, Args&&...>::value, int>::
                                   ^
/Users/wez/fbsource/fbcode/eden/oss/external/install/include/folly/futures/Future.h:148:12: note: while substituting prior template arguments into non-type template parameter [with Args = <>]
  explicit FutureBase(in_place_t, Args&&... args);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/wez/fbsource/fbcode/eden/oss/external/install/include/folly/futures/Future.h:115:7: note: while substituting deduced template arguments into function template 'FutureBase' [with Args = <>, $1 = (no value)]
class FutureBase {
      ^
/Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/Dispatcher.cpp:175:13: note: in instantiation of template class 'folly::Future<facebook::eden::DirList>' requested here
Dispatcher::readdir(InodeNumber, DirList&&, off_t, uint64_t) {
            ^
/Users/wez/fbsource/fbcode/eden/oss/eden/fs/fuse/Dispatcher.h:35:7: note: forward declaration of 'facebook::eden::DirList'
class DirList;
      ^
1 error generated.
```

Reviewed By: chadaustin

Differential Revision: D13475720

fbshipit-source-id: 2da1692010a82b73cbed71d996993cf5fc13af0e
2018-12-17 15:53:15 -08:00
Wez Furlong
299e22d940 eden: avoid DCHECK in FuseChannel code on macOS
Summary:
It appears as though osxfuse is a bit eager to re-use `header->unique`
values, as this DCHECK to ensure that we erased our request at the end of a
request is frequently triggered.  It's not for 100% of requests, but I did
notice that the `header->unique` values tend to be in the range 1-6.

We don't check for collisions when we emplace requests in the dispatching
logic, and this particular check happens after we've acked the kernel, so it
doesn't seem like a safe thing to check and abort on really, so let's remove
it.

Reviewed By: chadaustin

Differential Revision: D13479516

fbshipit-source-id: a01e6c3e47b78b651f65fc3f5138168c71968030
2018-12-17 15:53:15 -08:00
Wez Furlong
3dbcd058d6 eden: add helper for accessing stat fields as timespecs
Summary:
ported forward from D4209167, add a couple of helpers
to access these fields on mac and linux, centralizing/minimizing ifdefs.

Simplify some of the logic in FileChangeMonitor.

Reviewed By: chadaustin

Differential Revision: D13475717

fbshipit-source-id: d7b39999808bc41a6dc17a87189501cb34e68b30
2018-12-16 18:31:46 -08:00
Wez Furlong
ae390beb6e eden: prctl is linux specific
Summary: only include and use it on linux

Reviewed By: simpkins

Differential Revision: D13475715

fbshipit-source-id: 6b0b9da1b32088e01cbb932f9b3ed62532dfe00f
2018-12-15 13:43:31 -08:00
Wez Furlong
31eb2b1c8c eden: selinux is linux specific, adjust cmake accordingly
Summary: only add the selinux deps if we found selinux

Reviewed By: simpkins

Differential Revision: D13475711

fbshipit-source-id: c3375282b61881317f9a6c4c8e321ce717d1f9ab
2018-12-15 13:43:31 -08:00
Wez Furlong
3b5315ca43 eden: handlemap.thrift was removed, but not from cmake build
Summary: overlooked because there is no CI exercising this today

Reviewed By: simpkins

Differential Revision: D13475721

fbshipit-source-id: 3e8fe280ab73d249da374129b37d32cd7e17f472
2018-12-15 13:43:31 -08:00
Chad Austin
008497c69a remove SerializedFileHandleMap
Summary: SerializedFileHandleMap is dead code now.

Reviewed By: strager

Differential Revision: D13381629

fbshipit-source-id: ba872aaf8335d2be68d6af0465bd04e4ca59d578
2018-12-13 12:29:13 -08:00
Chad Austin
1e83ec3df0 remove FileHandleMap
Summary:
Eden no longer tracks any state in file handles, and has no plans to in the future.
Therefore, remove all related code.

Reviewed By: strager

Differential Revision: D13354307

fbshipit-source-id: 341d081f64c6c8fb2b4b1b5a5ff42f2cc7d38039
2018-12-13 12:29:13 -08:00
Chad Austin
6e0ce0ace0 stop handling FUSE_OPEN
Summary:
Now that all file access in Eden is stateless, we no longer need to handle open() or release().
If the kernel advertises FUSE_NO_OPEN_SUPPORT, return ENOSYS from open().

Reviewed By: simpkins

Differential Revision: D13325759

fbshipit-source-id: 38486848f27ffeb005f74407888e94d891496f98
2018-12-12 21:49:07 -08:00
Adam Simpkins
4ddda70198 unbreak open()
Summary:
D13325746 changed `EdenDispatcher::open()` to no longer return a file handle.
However the code in `FuseChannel::fuseOpen()` throws an exception if the
dispatcher does not create a file handle.  This breaks most file operations in
Eden.

The Dispatcher check is removed in D13354307, but that hasn't landed yet.
That change probably just needed to be part of D13325746.

Reviewed By: chadaustin

Differential Revision: D13445570

fbshipit-source-id: 70d639142057740766bcbe02a0df50b14f7c9937
2018-12-12 20:32:32 -08:00
Chad Austin
5222e339e6 remove EdenFileHandle and FileInode::open
Summary: Title says it all.

Reviewed By: strager

Differential Revision: D13325746

fbshipit-source-id: 22f1b12ba0bf47eba62c2312e5069c45b1c28ef3
2018-12-12 17:10:29 -08:00
Chad Austin
a978af2c62 stop looking up file handles in FuseChannel
Summary:
Previously, a file handle must have been held for the entirety of a write operation. That is no
longer true. Stop looking up file handles on write.

Reviewed By: strager

Differential Revision: D13325662

fbshipit-source-id: 9ae31b467d17d633c388917d18098e6e5a620b89
2018-12-12 17:10:29 -08:00
Chad Austin
ef141a6585 remove DirHandle
Summary: DirHandle no longer does anything. Remove it.

Reviewed By: strager

Differential Revision: D13288298

fbshipit-source-id: 3edebbcdf60982608ddb87c1ff82ebff1c3d2067
2018-12-05 01:34:53 -08:00
Chad Austin
1b9fc49bfc simplify readdir implementation
Summary:
Write tests for readdir's semantics (we really do want to return . and
..) and simplify the logic. It's still quadratic in large directories,
but there aren't any allocations anymore.

Reviewed By: strager

Differential Revision: D13287764

fbshipit-source-id: 5e0d4b86eb16dbd7a16cdeb324e4b43363512e25
2018-12-05 01:34:53 -08:00
Chad Austin
c55edc9036 route readdir straight to TreeInode
Summary:
Send readdir requests to TreeInode. This may not sound like a good
idea: the FUSE documentation suggests that stateful directory handles
are required to implement correct readdir semantics under concurrent
deletes and renames. However, the 63-bit offset value is treated as a
cookie that is passed from one readdir call into the next, and 63 bits
should be sufficient to implement readdir concurrent with
rename/unlink. So move readdir's implementation into TreeInode in
preparation for the complete removal of TreeInodeDirHandle.

Reviewed By: strager

Differential Revision: D13287664

fbshipit-source-id: c0d615675edd9b83353534468a69b89068bba923
2018-12-04 16:37:41 -08:00
Chad Austin
c6617a0649 don't route fsyncdir through DirHandle
Summary:
Send fsyncdir straight through the inode rather than going through
DirHandle. This is the better design anyway, since the DirHandle does
not receive directory-mutating requests like mkdir.

Reviewed By: strager

Differential Revision: D13287610

fbshipit-source-id: 154fa32a3877c89a204a2d10b4e2b637410d9486
2018-12-03 17:43:34 -08:00
Chad Austin
84c5fe913d be explicit that we don't plan to use ATOMIC_O_TRUNC
Summary:
FUSE_NO_OPEN_SUPPORT is better than ATOMIC_O_TRUNC for Eden's use
case. Remove the code that pretended we might support ATOMIC_O_TRUNC
again someday.

(Note: this ignores all push blocking failures!)

Reviewed By: strager

Differential Revision: D13163382

fbshipit-source-id: 948d701571a8d2977da3d2532fdc9538c5011636
2018-11-29 11:22:58 -08:00