Commit Graph

26 Commits

Author SHA1 Message Date
Zeyi (Rice) Fan
b9332b3673 adding ObjectFetchContext to getattr
Summary: This diff teaches `getattr` to accept `ObjectFetchContext` and pass along.

Reviewed By: chadaustin

Differential Revision: D21780970

fbshipit-source-id: 0f4b1295753281420323a3b33ce76af0ff386587
2020-06-18 10:40:41 -07:00
Adam Simpkins
c55781c666 move UserInfo to eden/fs/utils/
Summary:
Move the `UserInfo` code from `fuse/privhelper` to `utils`, and also unify the
POSIX and Windows implementations of this class.

This code was originally put in the `fuse/privhelper` directory since it was
written at the same time as the privhelper.  However, it's really a
lower-level library that doesn't depend on FUSE or any of the other code in
the `fuse/` subdirectory.

Reviewed By: wez

Differential Revision: D21296594

fbshipit-source-id: f58682f6ce86bba0328472c491bb4c0dc3370319
2020-04-29 17:21:12 -07:00
Chad Austin
61e738cd84 use enumValue instead of static_cast<int>
Summary:
Where appropriate, replace uses of `static_cast<int>` with
`enumValue`.

Reviewed By: simpkins

Differential Revision: D20975196

fbshipit-source-id: 581643366ea7eda5d1961238b0693cf45c4eec94
2020-04-28 18:59:34 -07:00
Ratnadeep Joshi
8e4b04107c Add an option to mount a checkout read-only
Summary: Added option to mount command

Reviewed By: chadaustin

Differential Revision: D20256352

fbshipit-source-id: e52fbd10f318221777b7e2d21ed9ba0a17ce1687
2020-03-11 21:38:48 -07:00
Chad Austin
65c93484e2 rename tracing to telemetry
Summary: Tracing was not an accurate name for what this directory had become. So rename it to telemetry.

Reviewed By: wez

Differential Revision: D17923303

fbshipit-source-id: fca07e8447d9b9b3ea5d860809a2d377e3c4f9f2
2019-10-15 13:39:41 -07:00
Chad Austin
8cac2bfe6a Remove dead includes in eden
Reviewed By: wez

Differential Revision: D17877514

fbshipit-source-id: e7f8ed8364bdb7a77f293cbdf4b48e8f15e64c30
2019-10-11 16:45:01 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Chad Austin
c89607f129 build fuse_tester with open source gflags
Summary: Allow building fuse_tester with open source gflags and glog.

Reviewed By: strager

Differential Revision: D16636221

fbshipit-source-id: 5128e936d5a6b6d0ed33bf34b770ee661728af3f
2019-08-21 17:22:46 -07:00
Adam Simpkins
aa5e6c7295 update license headers in C++ files
Summary:
Update the copyright & license headers in C++ files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487078

fbshipit-source-id: 19f24c933a64ecad0d3a692d0f8d2a38b4194b1d
2019-06-19 17:02:45 -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
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
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
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
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
e88177a2f3 count FUSE accesses by process ID
Summary: Begin tracking pids passed into FUSE in the ProcessAccessLog.

Reviewed By: strager

Differential Revision: D9595795

fbshipit-source-id: 02e5fefebcd0de860274409ba6258f14fa050b55
2018-09-10 13:52:51 -07:00
Adam Simpkins
dc84937e0b update PrivHelper to support detaching from an EventBase
Summary:
Add a PrivHelper::detachEventBase() method, and rename PrivHelper::start() to
attachEventBase().

This makes it possible to detach a running PrivHelper from its EventBase and
re-attach it to an EventBase later to restart it.  This will be useful in
upcoming diffs to allow performing calls to the PrivHelper before the main
thrift server EventBase has started.

Reviewed By: wez

Differential Revision: D8212777

fbshipit-source-id: d5a9bf672afa8b16e53201ac747d77337e1cc307
2018-06-18 17:22:18 -07:00
Adam Simpkins
011cc21e52 update privhelper code to use the UnixSocket helper class
Summary:
This updates the privhelper code to use the UnixSocket class for performing
I/O.  This reduces the number of separate implementations of code we have for
sending file descriptors across Unix domain sockets, and also makes the
privhelper APIs non-blocking.

This will make it easier to clean up some of the initialization ordering in
the future.  It will also make it easier to send file descriptors to the
privhelper server, instead of just receiving them.  This may be helpful for
passing a file descriptor to use for logging to the privhelper process, which
will make it easier to fork the privhelper before logging redirection has
occurred.

Reviewed By: bolinfest

Differential Revision: D8053422

fbshipit-source-id: 1f8fdf22afc797eead0213be1352ea530762140d
2018-06-11 18:32:25 -07:00
Adam Simpkins
5305edefc1 update PrivHelper APIs to return Futures
Summary:
Up until now all of the privhelper APIs have been blocking calls.  This
changes the privhelper functions to return Futures, and updates all users of
these APIs to be able to handle the results using Futures.

One benefit of this change is that all existing mount points are remounted in
parallel now during startup, rather than being mounted serially.  The old code
performed a blocking `get()` call on the future returned by
`EdenServer::mount()`.

The privhelper calls themselves are still blocking for now--they block until
complete and always return completed Future objects.  I will update the
privhelper code in a subsequent diff to actually make it asynchronous.

Reviewed By: bolinfest

Differential Revision: D8053421

fbshipit-source-id: 342d38697f67518f6ca96a37c12dd9812ddb151d
2018-06-11 18:32:25 -07:00
Adam Simpkins
684fa29593 update folly::Init to call folly::initLogging()
Summary:
Update the folly::Init code to define a `--logging` command line flag, and call
`folly::initLoggingOrDie()` with the value of this command line during
initialization.

This is similar to the existing code that initializes the glog library.
(Programs can use both glog and folly logging together in the same program, and
I expect that many programs will do so as parts get converted to folly::logging
and parts remain using glog.)

Reviewed By: yfeldblum

Differential Revision: D7827344

fbshipit-source-id: 8aa239fbad43bc0b551cbe40cad7b92fa97fcdde
2018-05-15 12:38:01 -07:00
Adam Simpkins
8e3c09a99a move folly/experimental/logging to folly/logging/
Summary:
Promote the folly logging code out of the experimental subdirectory.
We have been using this for several months in a few projects and are pretty
happy with it so far.

After moving it out of the experimental/ subdirectory I plan to update
folly::Init() to automatically support configuring it via a `--logging` command
line flag (similar to the initialization it already does today for glog).

Reviewed By: yfeldblum, chadaustin

Differential Revision: D7755455

fbshipit-source-id: 052db34c97f7516728f7cbb1a5ad959def2f6efb
2018-04-30 21:29:29 -07:00
Adam Simpkins
19122feb19 add a FOLLY_INIT_LOGGING_CONFIG() helper macro
Summary:
Add a macro to help users define the `getBaseLoggingConfig()` function.

While I would prefer to avoid macros if possible, this seems worthwhile.  This
saves 4 or 5 lines of boilerplate code in each program that sets a custom base
logger setting.  It also reduces the likelihood of a developer accidentally
having a typo in the function name, which would still build successfully but
not have the desired results.

Reviewed By: chadaustin

Differential Revision: D7457652

fbshipit-source-id: 1c316c7ea6949c16bd7b61c0440cc1ee69ecb83e
2018-04-10 11:42:27 -07:00
Adam Simpkins
bfcf4c574a remove the fusell namespace
Summary: Move everything in the `facebook::eden::fusell` namespace to `facebook::eden`

Reviewed By: chadaustin

Differential Revision: D7314458

fbshipit-source-id: db56d3e5fb898235e1376ac76077cf780d9b4698
2018-03-19 17:01:52 -07:00
Adam Simpkins
1c46d4c9e1 have FuseChannel return its FD in the completion future
Summary:
Remove the `FuseChannel::stealFuseDevice()` method, and instead change the
session completion future to return the FUSE device FD if it is still valid.

This ensures we only extract the FUSE device when it is still valid: if an
unmount event is being processed by a FUSE worker thread simultaneously with a
call to `FuseChannel::takeoverStop()` the session completion future will return
an empty `folly::File` since the FUSE device has been shut down.

This also helps clarify the synchronization semantics around modification to
the `fuseDevice_` member variable.

Reviewed By: wez

Differential Revision: D7300847

fbshipit-source-id: 02ced8fc9d24e7cd526d911782949d0bfbf0e5a7
2018-03-16 17:39:13 -07:00
Adam Simpkins
8dea095b8f eliminate some unnecessary header includes
Summary:
Eliminate a few unnecessary includes from Dispatcher.h and one from
RequestData.h

Reviewed By: wez

Differential Revision: D7300846

fbshipit-source-id: 0cde1f70f605fcb5c95ed13950f4fa8d353fd72f
2018-03-16 12:35:19 -07:00
Adam Simpkins
8eff641bf3 prevent FuseChannel from being destroyed with outstanding requests
Summary:
The FuseChannel destructor previously could be invoked while there are still
outstanding requests, which would cause problems when responses were generated
for these requests.

This makes the FuseChannel destructor private, requiring users to always
allocate FuseChannel objects on the heap and destroy them using a destroy()
method.  The destroy() method still blocks waiting for the FUSE worker threads
to exit, but if there are still outstanding FUSE requests it defers the
deletion of the FuseChannel until they are complete.

The EdenMount class currently couldn't ever destroy FuseChannel objects with
outstanding requests, since it waits for the completion future to fire before
invoking the destructor.  Fixing this behavior is mostly for correctness of the
FuseChannel API and for the benefit of our unit tests.

Reviewed By: chadaustin

Differential Revision: D7297829

fbshipit-source-id: 643d1332be84a1f25ee30ba2a2ea3515806f00ef
2018-03-16 12:35:19 -07:00
Adam Simpkins
55630ecab9 add a very basic test program for exercising FuseChannel
Summary:
Add a simple test program that starts a FUSE mount.  At the moment the only
call it actually responds to is getattr() for the root inode.  However this is
sufficient for exercising the FuseChannel startup and shutdown code.

Reviewed By: chadaustin

Differential Revision: D7297827

fbshipit-source-id: 1bae6015def37913a5bf57541a14c3c8c050eff5
2018-03-16 12:35:19 -07:00