Commit Graph

938 Commits

Author SHA1 Message Date
Xavier Deguillard
754d132783 Back out "prjfs: handle concurrent file/directory removal"
Summary: Something is wrong with this which causes Unity to freak out.

Reviewed By: fanzeyi

Differential Revision: D25453230

fbshipit-source-id: 89f61fd97817403fa65071ddac022a226b775e53
2020-12-10 07:42:38 -08:00
Xavier Deguillard
2bfdf6f481 prjfs: handle concurrent file/directory removal
Summary:
A while back, we saw that concurrent directory creation would lead to EdenFS
being confused and failing to record some of the created directories. This then
caused EdenFS to no longer being in sync with what was on disk. To handle this
case, we've had to manually creating these directories recursively.

What I didn't realize at the time was that these concurrent notifications could
also happen on removal this time, and if a directory removal notification wins
the race against the removal of its last children, that directory wouldn't be
removed and EdenFS would once again be confused about the state of the
repository.

Fixing this is a bit trickier than directory creation as it's more racier.
Consider a directory that is being removed, and then immediately recreated with
a file in it in a different process. The naive approach of simply force
removing all of the children of a directory when handling the removal
notification would clash with the file creation. We could argue that nobody
should be doing this, but there would be an unhandled race, and thus a bug
where data would potentially be lost[0].

We can however fix this bug slightly differently. For file/directory removal,
we can actually hook onto the pre-callback, ie: one that happens before the
file/directory is no longer visible on disk. This inherently eliminate the race
altogether as the callback will be guaranteed to run when none of its children
are present, and if a race happens with a file creation in it, we can simply
fail the removal properly.

The only tricky bit is for the renaming logic, as renaming a file is logically
a removal followed by a creation. For that reason, I've moved part of the
renaming bits to the pre-callback too.

In theory, this change may negatively affect workloads that do concurrent
directory removal as the duration during which a file/directory is visible
ondisk now includes the EdenFS callback while it didn't before. Such workflows
should be fairly rare and/or redirected to avoid EdenFS altogether if
performance matters.

[0]: This left-over file that EdenFS wouldn't be aware of would also later
cause the checkout code to fail due to invalidation failures triggered when
trying to invalidate that directory. This would be fairly hard to debug.

Reviewed By: fanzeyi

Differential Revision: D25112381

fbshipit-source-id: 9300499ce872ad93d0a687f0e61b7e2a9caf9556
2020-12-04 14:25:44 -08:00
Xavier Deguillard
446ae54b71 inodes: increment and decrement the fs refcount on Windows
Summary:
On Windows, the FS refcount is used to indicate that ProjectedFS knows about
this inode and either has a placeholder on disk, or a plain file. The first
event only occurs on lookup (similarly to Linux/macOS), while the second one
happens when files are created by the user and we receive a notification about
it.

In order to avoid races and to miss necessary invalidation, the refcount has to
be incremented after the placeholder has been created, and the refcount is
decremented before the invalidation is performed. This is straightforward to
achieve for notifications, but requires passing a callback to the PrfsChannel.

Reviewed By: chadaustin

Differential Revision: D24800819

fbshipit-source-id: 0e7ea7ed3a9ca0414e3e727fba975045546d82d1
2020-12-04 09:13:38 -08:00
Xavier Deguillard
b2bfbe2300 inodes: make the fs refcount a flag on Windows
Summary:
On Windows, the refcount will be increased when a placeholder is written on
disk, and decremented when it is invalidated. Since the invalidation completely
clears the inode on disk, we need to make sure we don't keep an inode loaded
after it is invalidated. For that reason, let's just allow the refcount to be
either 0 or 1.

Reviewed By: chadaustin

Differential Revision: D24764567

fbshipit-source-id: 5d09fb9f53bf36d517d0bfb083107f176c33c2a7
2020-12-04 09:13:37 -08:00
Xavier Deguillard
dceab3479b prjfs: thread notifications in PrjfsChannel
Summary:
EdenFS can now show notifications to the user in case something wrong is
happening.

Reviewed By: chadaustin

Differential Revision: D24864354

fbshipit-source-id: fabc30f14bc022b4367af562481235fe984df458
2020-12-03 10:45:30 -08:00
Xavier Deguillard
6d90ceea25 prjfs: add timeout to ProjectedFS callbacks
Summary:
One of the main sub-par user experience on Windows is the lack of notification
of any kind when EdenFS can't reach the Mercurial servers. Prior to this diff,
the callbacks would never return, causing commands to simply hangs for the
user.

As a first step, let's add a timeout, a later step will hook the notification
mechanism used on macOS/Linux to display a notification when timeouts occurs.

The only callback that doesn't have a proper timeout is the notification one,
as timing out on these would mean that EdenFS won't have registered that some
files/directories have been materialized which will lead to inconsistencies
later.

Reviewed By: kmancini

Differential Revision: D24809645

fbshipit-source-id: 0ddd9d443a17db405a3edbaa8edecf3764c31d37
2020-12-03 10:45:29 -08:00
Xavier Deguillard
faf0985885 prjfs: wait for pending requests before unmounting
Summary:
As described in the previous diff, unmounting a repo while a request is pending
would lead to a use after free. To solve this, we can wrap the inner channel
with a shared_ptr, and set it to NULL whenever unmount is in progress.

While this solution has a fairly large overhead due to requiring at least 2
atomics per callbacks (one for the lock, the second one for the shared_ptr
copy), it is correct. A future improvement will swap these with an RCU pointer
to reduce the callback cost to almost nothing.

Reviewed By: chadaustin

Differential Revision: D25071423

fbshipit-source-id: 77d14a38403bef3e276d3e5e48e6fd95dd641964
2020-12-03 10:45:29 -08:00
Xavier Deguillard
8260e17f39 inodes: re-order some cache invalidation
Summary:
It feels like invalidating the entry before the directory makes slightly more
sense, so do it in that order.

Reviewed By: chadaustin

Differential Revision: D24800817

fbshipit-source-id: ed053d07bbae6954c276d1ad7a1ff247e5c055d9
2020-11-19 21:59:44 -08:00
Chad Austin
4299003775 return a better error message if something includes . or .. in their glob
Summary:
We used to produce a confusing error message during glob evaluation
when . or .. was specified as a glob component. Instead, fail early,
with an error message that more directly explains the problem.

Reviewed By: genevievehelsel

Differential Revision: D24969096

fbshipit-source-id: fe70a8f4db1fdce8eec13890d20913b63a516518
2020-11-17 12:53:39 -08:00
Xavier Deguillard
02ee056b71 inodes: make TraverseTest compile on Windows
Summary: The test wasn't compiling due to these 3 missing headers, add them.

Reviewed By: genevievehelsel

Differential Revision: D24997597

fbshipit-source-id: 6e3be0763362e41be138c670dc88a63bd9e88024
2020-11-16 16:25:22 -08:00
Xavier Deguillard
2b1d0a9483 inodes: rename the fuseRefcount in InodeMap
Summary:
This is a preparatory phase to make the refcount usuable on Windows. For more
details, see D24716801 (e50725d2cb)

Reviewed By: chadaustin

Differential Revision: D24764568

fbshipit-source-id: 1e8c6ab00d4c1ec79c347fd5ae7167b2ce1dff68
2020-11-16 09:03:18 -08:00
Xavier Deguillard
8b82dc96cb prjfs: make readdir asynchronous
Summary:
As of right now, opendir is the expensive callbacks due to fetching the sizes
for all the files in a directory. This strategy however breaks down when
timeouts are added as very large directories would trigger the timeout, not
because EdenFS is having a hard time reaching Mononoke, but because of
bandwidth limitation.

To avoid this issue, we need to have a per-file timeout and thus makes opendir
just trigger the futures, but not wait on them. The waiting bit will happen
at readdir time which will also enable having a timeout per file.

The one drawback to this is that the ObjectFetchContext that is passed in by
opendir cannot live long enough to be used in the size future. For now, we can
use a null context, but a proper context will need to be passed in, in the
future.

Reviewed By: wez

Differential Revision: D24895089

fbshipit-source-id: e10ceae2f7c49b4a006b15a34f85d06a2863ae3a
2020-11-13 14:27:26 -08:00
Genevieve Helsel
4cb299af60 externally log result of fsck scans
Summary:
It would be nice to see if there was a fsck on startup, the duration of the fsck, and if it was able to repair all of the problems or not. This diff adds external logging for fsck runs on daemon start.

duration: how long the fsck took
success: false if was not able to repair errors, true if repaired all errors or didn't have to repair at all
attempted_repair: true if we found problems, false otherwise

Reviewed By: chadaustin

Differential Revision: D24774065

fbshipit-source-id: 2fa911652abec889299c74aaa2d53718ed3b4f92
2020-11-12 13:47:50 -08:00
Xavier Deguillard
018ce042c8 prjfs: fail when directory listing can't add a single entry
Summary:
The documentation for PrjFillDirEntryBuffer states that if no entries could be
added, then the ERROR_INSUFFICIENT_BUFFER errors need to be returned as is, the
code didn't do that.

Reviewed By: chadaustin

Differential Revision: D24764566

fbshipit-source-id: d6411822eac71b2f9aa7cf07858d09115767cc59
2020-11-11 18:32:19 -08:00
Xavier Deguillard
34598d4337 remove dependency on glog
Summary:
The EdenFS codebase uses folly/logging/xlog to log, but we were still relying
on glog for the various CHECK macros. Since xlog also contains equivalent CHECK
macros, let's just rely on them instead.

This is mostly codemodded + arc lint + various fixes to get it compile.

Reviewed By: chadaustin

Differential Revision: D24871174

fbshipit-source-id: 4d2a691df235d6dbd0fbd8f7c19d5a956e86b31c
2020-11-10 16:31:15 -08:00
Xavier Deguillard
bb9b0b46e1 inodes: remove unecessary include of FuseChannel.h
Summary: This is unecessary, remove it.

Reviewed By: chadaustin

Differential Revision: D24743519

fbshipit-source-id: 5e10eafcd3f84d9ad053be35798df86b21f97d4f
2020-11-04 17:34:01 -08:00
Xavier Deguillard
e50725d2cb inodes: rename FUSE refcount to fs refcount
Summary:
One of the issue that EdenFS on Windows is currently facing is around
invalidation during an update. In effect, EdenFS is over invalidating, which
causes update to be slower than it should be, as well as EdenFS recursively
triggering ProjectedFS callbacks during invalidation. Both of these are a
sub-par UX.

The reason this issue exist is multi-faceted. First, the update code follows
the "kPreciseInodeNumberMemory" path which enforces that a directory that is
present in the overlay needs to be invalidated, even if it isn't materialized.
The second reason is that no reclamation is done for the overlay, combine the
two and you get an update that gets both slower over time and will issue
significantly more invalidation that is needed.

Solving this is a bit involved. We could for instance start by reclaiming
inodes from the overlay, but this wouldn't be effective as we use the fact that
an inode is present in the overlay as a way to know that the file is cached in
the overlay. If we reclaim from the overlay we simply won't be invalidating
enough and some files will be out of date.

It turns out that we already have a mechanism to track what is cached by the
kernel: the fuse refcount. On Linux/macOS, everytime an inode is returned to
the kernel, this refcount incremented, and the kernel then notifies us when it
forgot about it, at which point the refcount can be decremented. On Windows,
the rules are a bit different, and a simple flag is sufficient: set when we
write a placeholder on disk (either during a directory listing, or when
ProjectedFS asks for it), and unset at invalidation time during update. There
is however a small snag in this plan. On Linux, the refcount starts at 0 when
EdenFS starts as a mount/unmount will clear all the kernel references on the
inodes. On Windows, the placeholder aren't disappearing when EdenFS dies or is
stopped, so we need a way to scan the working copy when EdenFS starts to know
which inodes should be loaded (an UnloadedInode really).

The astute reader will have noticed that this last part is effectively a
O(materialized) operation that needs to happen at startup, which would be
fairly expensive in itself. It turns out that we really don't have choice and
we need to do it regardless due to Windows not disallowing writes to the
working copy when EdenFS is stopped, and thus for EdenFS to be aware of the
actual state of the working copy, it needs to scan it at startup...

The first step in doing all of this is to simply rename the various places that
uses "fuse refcount" to "fs refcount" which is what this diff does.

Reviewed By: chadaustin

Differential Revision: D24716801

fbshipit-source-id: e9e6ccff14c454e9f2626fab23daeb3930554b1a
2020-11-04 17:34:01 -08:00
Katie Mancini
de729d337c Avoid overfetching in checkout
Summary:
Eden can often overfetch files during checkout. There may be multiple things
going on here, but at least one of them is tied to aux data prefetching.

Responding to a FUSE request for aux data will result in the inode for that
file being loaded. During checkout if we don't short circuit the checkout
then we will create a CheckoutAction for each loaded inode. And previously
CheckoutActions will always load their inodes contents.

To fix this we have two options
1. avoid creating the CheckoutAction in the first place.
2. Avoid downloading in CheckoutAction.

1 Turns out to be more difficult. I did some thinking through this here if
you want to see: https://fb.quip.com/LeqSAb3OlpWb

2 We don't actually need to be downloading blob data here, we only really
need the eden hash and content sha1 of the blob in this code path (this is
all that is used to compare the old and new file). So we should really only
be fetching the metadata (which should be avaiable locally since the inode
was loaded unless the caches have been cleared).

This implements fix 2.

I think there is likely still over fetching having to do with trees in checkout.
And potentially we can avoid looking at metadata at all in some cases.
I will look at this next.

Reviewed By: chadaustin

Differential Revision: D23432810

fbshipit-source-id: 17c0503bf95eb360de902a370948338bf04c1887
2020-11-03 10:58:22 -08:00
Xavier Deguillard
1ed7eeef95 inodes: unload inodes before checkout on Windows
Summary:
On Windows, we never unload any inodes until EdenFS is restarted, thus,
checkout times go up over time as more and more inodes are being loaded. While
on Windows we don't keep track of what is referenced by the kernel, the
checkout code will use the "precise inodes" code path when deciding what to
update. This means that every inode that is in the overlay will get updated
properly, and since the overlay is a superset of what is hydrated, we are
guaranteed to always invalidate what we need to.

Due to the above, this shouldn't result in any changes as we never gc the
overlay, but that will come later, at which point checkout times will stop
being more and more expensive as time goes.

Reviewed By: chadaustin

Differential Revision: D24634253

fbshipit-source-id: c7b838edc20589bbf92ff4e2b3abd079b9a4443d
2020-11-02 21:03:58 -08:00
Xavier Deguillard
e3c3133fd3 inodes: rename future notification should be run non-inline
Summary:
Futures are by default run inline, meaning that when the previous future is
completed, the future will run in the same context as the previous one. In the
case where the previous one is completed by another thread setting up its
promise, the future will be completed in the context of that other thread.

In most cases, this is OK, in others, this can cause a deadlock. And this is
exactly what we're seeing here. When a file is renamed concurrently to an `hg
update`, the inode the rename operates on might not be loaded, and thus both
update and the rename callback will race to load that inode. When update wins
that race, the rename callback will wait on a promise that update will then
set. When that happens, the rest of the rename callback will be run in the
update context, but that will in turn cause update to try to re-acquire the
rename lock that it already holds...

To fix this, we need to make sure that the rename callback doesn't run inline.

Reviewed By: chadaustin

Differential Revision: D24657422

fbshipit-source-id: 23b08765afae7bda4a628f0c23675bff9f486b6b
2020-11-02 21:03:58 -08:00
Chad Austin
93238b82b4 skip InodeTable entries with zero InodeNumbers
Summary:
Until fanzeyi gets InodeMetadata moved over to SQLite, remove some
excessive logging when the InodeMetadataTable contains zeroes because
its buffers weren't flushed to disk.

Reviewed By: genevievehelsel

Differential Revision: D24377026

fbshipit-source-id: e6ffa54244730388aaf66dc53cd29a0069fba685
2020-11-02 14:57:13 -08:00
Chad Austin
87def59c62 remove dead getDebugStatus
Summary: Kill some dead code.

Reviewed By: xavierd

Differential Revision: D24300170

fbshipit-source-id: 86748dc58046f22c3116d64d8674684538c16e4a
2020-11-02 13:52:38 -08:00
Chad Austin
a6ac98a5a7 thriftfmt
Summary:
Apply automated Thrift formatter. Even if the format is a bit off in a
couple places, and the bikeshed is still being painted, this avoids
unrelated formatting changes later in the stack.

Reviewed By: xavierd

Differential Revision: D24511057

fbshipit-source-id: f1b23578733a8ecf788509e407bc419fa073428d
2020-11-02 13:52:37 -08:00
Xavier Deguillard
a16e62b234 inodes: add missing override
Summary: This method is an override of its parent class, thus the need for the override.

Reviewed By: chadaustin

Differential Revision: D24657424

fbshipit-source-id: 5ce7200eeb4ef28fb51fabbe0ebb38ded51ae34e
2020-11-02 12:26:56 -08:00
Xavier Deguillard
d42a8c971d inodes: move path into the Dispatcher callbacks
Summary:
Dealing with non-owned path in futures is mind bending and can lead to use
after free fairly easily if not careful. It turns out that this code is
actually a bit buggy and in some cases will attempt to use a path that is
already freed. Since the callsite doesn't need to hold onto the paths, let's
just move them, which resolves the issuue.

Reviewed By: chadaustin

Differential Revision: D24657423

fbshipit-source-id: 47bbaccf18cd86e53860491e3cbfeadb4363499c
2020-11-02 12:26:56 -08:00
Xavier Deguillard
1aeb62309f inodes: remove one ifdef from processCheckoutEntry
Summary:
We don't need an ifdef here as folly::kIsWindows works just as well. The astute
reader will notice that we now call isInodeRemembered while we weren't before.
On Windows, this will pretty much always return false as this can only return
true if the fuse refcount is positive. Since we don't keep track of a fuse
refcount on Windows, this is OK to do.

Reviewed By: genevievehelsel

Differential Revision: D24636432

fbshipit-source-id: c6db7c66f7eb27894cdd276a9368149ec8056cf4
2020-10-30 12:34:46 -07:00
Katie Mancini
f616872079 Allow specifying commits to match against and prefetch in globFiles
Summary:
We want to be able to fetch prefetch profiles on pull. That means we will need
to prefetch the contents of prefetch profiles for commits that we are not
currently on. Thus globFiles (the thrift endpoint used for prefetch profiles
fetching) needs to be able to take commit hashes to match and fetch against.

Why fetch prefetch profiles on pull? This would get the prefetch started earlier so
the files are hopefully fetched by the time the user needs them.

Reviewed By: chadaustin, genevievehelsel

Differential Revision: D23858659

fbshipit-source-id: 123e423d5117274b92405dbb5c2df690298a1c18
2020-10-29 13:34:06 -07:00
Xavier Deguillard
9c2bb705a1 inodes: fix use after free in LookupProcessor
Summary:
The LookupProcessor class is built with the purpose of iterating all the inodes
in the passed in path. However, the LookupProcessor object may outlive the
lifetime of the path, and thus we need to build an iterator on the copied path,
not on the argument.

Differential Revision: D24581874

fbshipit-source-id: b66dc007920b7adad5272bf56d3034acb211fec6
2020-10-27 21:45:43 -07:00
Chad Austin
45112fbf19 fix compilation warnings
Summary: Fix some build warnings that show up on macOS.

Reviewed By: wez

Differential Revision: D24436572

fbshipit-source-id: bd300110df79fe9d259c8f5ce2b1085cb85a0cac
2020-10-26 13:43:48 -07:00
Chad Austin
81d18bde42 allow querying Overlay file size outside of FileInode
Summary: Allow calling into OverlayFileAccess::getFileSize from outside of FileInode.

Reviewed By: xavierd

Differential Revision: D24300035

fbshipit-source-id: 2a5fc730122a79220fd38c928b74342433c4e9f2
2020-10-23 11:16:10 -07:00
Chad Austin
cc8c4c4ceb refactor debugInodeStatus
Summary:
Before replacing the existing debugInodeStatus changes, make some
small refactorings to help me understand it.

Reviewed By: xavierd

Differential Revision: D24299970

fbshipit-source-id: 3b60aa8365bb9a45e12357374282ba837ccc36eb
2020-10-23 11:16:10 -07:00
Chad Austin
ba39580899 add observed inode traversal functions
Summary:
Add a function that makes it easy to traverse EdenFS's view of the
traversed-so-far filesystem.

Reviewed By: xavierd

Differential Revision: D24299962

fbshipit-source-id: 275c849846bf45a2e80780411d60266b961d825b
2020-10-23 11:16:10 -07:00
Xavier Deguillard
a75af7a63d PathFuncs: allow paths on Windows to be '\' separated
Summary:
Previously, when that code was ported on Windows, paths separator were
converted from '\' to '/' when a wide string was provided, all the other paths
were treated as is.

The main issue with this strategy is that not all paths can be converted, the
non-stored ones for instance are immutable, which leads to some subtle bugs
down the line. For instance, the paths: "Z:/foo/bar/baz" and "Z:\foo/bar\baz"
would not be equal as the path separator isn't the same, but both of these are
actually the same path underneath.

To solve this, this diff first introduce a Windows path separator, and then
modifies the path comparison functions to ignore the path separator and only
compare the components.

I'm definitively not a fan of the pattern I use for searching for both / and \
in paths, suggestions are welcome for how to improve that.

Reviewed By: chadaustin

Differential Revision: D24376980

fbshipit-source-id: 0702bf775c7c3937b2138abd5a63d339ac80aaed
2020-10-22 16:24:17 -07:00
Xavier Deguillard
5917e7306e inodes: enable tests on @mode/win
Summary: Comment out the tests that do not compile on Windows.

Reviewed By: fanzeyi

Differential Revision: D24458438

fbshipit-source-id: 14bd4803ccd68ea6e02f95f868b8a801161518ea
2020-10-22 14:11:10 -07:00
Chad Austin
f6fcff3151 move strace logging into FuseChannel
Summary:
Instead of logging in the Dispatcher, move strace logging to
FuseChannel where it can be standardized for all FUSE request types.

Reviewed By: wez

Differential Revision: D24035838

fbshipit-source-id: c84d8c27b62f9944e2d26a35a7ed7bbbeeb5bf0e
2020-10-20 09:34:03 -07:00
Chad Austin
83dbe9d985 compute deterministic paths in debugInodeStatus
Summary:
InodeBase::getPath is not deterministic under concurrent
renames. Instead, thread the paths down through the recursion so
they're consistent.

Reviewed By: genevievehelsel

Differential Revision: D24297724

fbshipit-source-id: 3e8664ce2bc5159e464d1d76ed37294c4eac1709
2020-10-16 19:13:19 -07:00
Xavier Deguillard
9db1fcdee8 inodes: do not ignore errors when computing sha1
Summary:
On Windows, computing the sha1 of a materialized file requires opening up the
file in the working copy, as the file is cached there. Interestingly, this
potentially means that for computing the sha1 of a file, EdenFS may receive a
callback from ProjectedFS about that file or a parent directory. At this point,
EdenFS just refuses to serve this callback, as doing so may trigger an infinite
loop, or simply deadlocks. While this may sound weird, recursive callbacks are
not expected, as this signify that EdenFS view of the working copy doesn't
match what it actually is.

To close the loop, and from a code perspective, this means that computing the
sha1 of a file can fail and can throw an exception. Unfortunately, the code
didn't reflect this fact and exceptions were simply ignored, when that happens
during a checkout operation, this can leave the working copy in a weird state,
further agravating the mismatch between EdenFS view of the working copy, and
what it actually is.

Reviewed By: wez

Differential Revision: D24282048

fbshipit-source-id: 745af03189fe345150f0b1792ee1b37a1b8fb0d4
2020-10-15 23:57:11 -07:00
Xavier Deguillard
18a313cba0 inodes: make invalidating inodes fallible
Summary:
While on Linux these can't fail (or, to be more precise: it doesnt' matter),
they can on Windows. One such exemple is when a user lock a file and triggers
an update that modifies this file. The invalidation will fail, and thus the
update should keep track of that file not being updated properly.

Previously, the invalidation would raise an exception, but that proved to be
the wrong approach as some state would need to be rolled back which the
exception didn't help in. For that, let's just return a Try and make sure that
we handle all the cases properly.

Reviewed By: chadaustin

Differential Revision: D24163672

fbshipit-source-id: ac881984138eefa65c053478a160e2a653fd3fdf
2020-10-15 17:31:13 -07:00
Chad Austin
9f651a8f28 Remove dead includes in eden
Reviewed By: simpkins

Differential Revision: D23864216

fbshipit-source-id: e1e3803ee47398639bf3cf85e3347d54ecaff424
2020-10-09 15:25:47 -07:00
Xavier Deguillard
d8d841ae80 prjfs: add partial support for debug processfetch on Windows
Summary:
This will enable to gather a bit more debugging regarding what processes are
fetching data. The one missing bit on Windows is to collect the process name,
for now, a "NOT IMPLEMENTED" placeholder is put in place.

Reviewed By: wez

Differential Revision: D23946258

fbshipit-source-id: 9f7642c7b9207c5b48ffff0f4eb0333af00bc7d5
2020-10-05 15:46:02 -07:00
Xavier Deguillard
1fef8cbc1a prjfs: remove FsChannel.h
Summary: This is not needed, we can use the PrjfsChannel class directly where needed.

Reviewed By: chadaustin

Differential Revision: D23946259

fbshipit-source-id: eafcd38c0927fa282d62ada0986a7ef8b612174b
2020-09-28 18:14:30 -07:00
Xavier Deguillard
f7ea4e2747 inodes: fix signed comparison warning
Summary:
These shows up on Windows when building with mode/win, silencing them is easy,
so let's do it.

Reviewed By: wez

Differential Revision: D23871727

fbshipit-source-id: 7d7ea9504c397b72903e98967188a5295f2f1040
2020-09-23 12:20:42 -07:00
Xavier Deguillard
695c24f493 fs: ifdef linux/macos only files
Summary:
These don't compile on Windows, and in order to get mode/win to compile, we
need to avoid compiling their contents. Ideally, we could do that in the
TARGETS files with the select statement, but that's not available in fbcode.
Thus, we do the next best thing: ifdef the file entirely.

Reviewed By: wez

Differential Revision: D23871728

fbshipit-source-id: b4d9df6503eaa008e649afd7bdc665cd37a9585d
2020-09-23 12:20:41 -07:00
Xavier Deguillard
65a19aadfe inodes: always include SqliteOverlay.h
Summary: This can be included in all the supported platforms, thus don't #ifdef it.

Reviewed By: wez

Differential Revision: D23858664

fbshipit-source-id: e61da33a97d87cbfab5bb96d2bdaa865d2c01801
2020-09-23 09:43:35 -07:00
Xavier Deguillard
4c2019197a prjfs: add TARGETS file
Summary:
This enables autodeps, and brings us one step closer to building EdenFS with
Buck on Windows.

Reviewed By: fanzeyi

Differential Revision: D23857794

fbshipit-source-id: c8587a6f7b9e4d9575a62f592c1d0737dff2a8f0
2020-09-23 09:43:35 -07:00
Xavier Deguillard
eaa270730f inodes: move prjfs/EdenDispatcher to inodes/
Summary:
Now that prjfs/EdenDispatcher is no longer directly tied to ProjectedFS (sort
of, this is still a bit WIP), we can move it out of the prjfs directory onto
the inodes one. This allows breaking the circular dependency cycle mentioned in
the previous diff where prjfs and inodes depend on each other.

For now, this is merely a copy/paste of the code enclosed in big #ifdef _WIN32,
we might be able to do better later, but for now this is properly good enough.

Reviewed By: wez

Differential Revision: D23857539

fbshipit-source-id: 77c620bac1656d01d7daee4dbf8b10694a589751
2020-09-23 09:43:34 -07:00
Xavier Deguillard
36f4a1246a inodes: thread an ObjectFetchContext in getInode()
Summary:
Most of the non-tests callers have an ObjectFetchContext available, let's use
it instead of a static null context. This will help in understanding why some
files/trees are being fetched.

Reviewed By: chadaustin

Differential Revision: D23745752

fbshipit-source-id: b2e145d9e559bde0542adbc5b20ff56ccfc59ece
2020-09-23 09:43:34 -07:00
Xavier Deguillard
77ab04daf2 win: thread the request context to readdir
Summary:
This allows removal of a NullContext which will provide more details as to why
fetches are triggered.

Reviewed By: chadaustin

Differential Revision: D23745755

fbshipit-source-id: c26f648b8695b86caf8fe15c4bc6c4128d345aa1
2020-09-23 09:43:34 -07:00
Xavier Deguillard
a4f6a1abe0 prjfs: move win/mount into prjfs
Summary:
Now that the win directory only contains the mount directory, we can rename it
to be more faithful to its intent. Since this is about ProjectedFS, let's
rename it "prjfs".

Reviewed By: chadaustin

Differential Revision: D23828561

fbshipit-source-id: cb31fe4652fd4356dc2579028d3ae2c7935371a7
2020-09-22 09:09:56 -07:00
Xavier Deguillard
c6b9788af8 win: move win/utils onto utils/
Summary: This will make it easier to build with Buck.

Reviewed By: fanzeyi

Differential Revision: D23827754

fbshipit-source-id: bf3bf4d607a08b9831f9dfea172b2e923a219561
2020-09-22 09:09:56 -07:00