Commit Graph

28 Commits

Author SHA1 Message Date
Giuseppe Ottaviano
4029be5d7b Remove useless comparator
Summary: Drive-by cleanup. `CompareString` is not used anywhere and `std::less<>` would be better anyway.

Reviewed By: wez

Differential Revision: D6655104

fbshipit-source-id: 0fee22172c93335493400e6317d92f9e1e77b40e
2018-01-03 11:25:52 -08:00
Philip Jameson
8604b8f5b0 Migrate TARGETS files from @/ to //
Summary:
This is a codemod to change from using @/ to // in basic cases.
- TARGETS files with lines starting with @/ (but excluding @/third-party:
- autodeps lines in source and TARGETS files ( (dep|manual)=@/ ), excluding @/third-party
- Targets in string macros

The only thing left of the old format should be @/third-party:foo:bar

drop-conflicts

Reviewed By: ttsugriy

Differential Revision: D6605465

fbshipit-source-id: ae50de2e1edb3f97c0b839d4021f38d77b7ab64c
2017-12-20 16:57:41 -08:00
Adam Simpkins
5ef9928f3b add a normalizeBestEffort() function
Summary:
Add a new function that attempts to normalize a path with `realpath()`, but
falls back to `canonicalPath()` if that fails.  This lets us attempt to resolve
symlinks if possible, but still perform best-effort normalization if that
fails.

Reviewed By: chadaustin

Differential Revision: D6527493

fbshipit-source-id: 9137d517452ca7fd825852c1f60ade07f1ee78fa
2017-12-14 12:41:47 -08:00
Chad Austin
2f22a9f534 introduce a type representing the unbounded eden cpu pool
Summary:
Add EdenCPUThreadPool and UnboundedQueueThreadPool types to make it clearer
that it's always okay for prefetch, deferred diff entry, and hg import to
shuttle work back to the main thread pool.

This diff changes no behavior - it just makes some invariants explicit.

Reviewed By: wez, simpkins

Differential Revision: D6504117

fbshipit-source-id: 3400ad55c00b3719ecba31807fd992442f622cd9
2017-12-12 12:35:35 -08:00
Chad Austin
f91ae520b2 introduce a Clock seam for testability
Summary:
Introduce a Clock seam.  This will allow us to write tests around
ctime, mtime, and atime logic.

Reviewed By: wez

Differential Revision: D6392543

fbshipit-source-id: 1721d76d2364b135b4ef5c078ef60f7f8526259e
2017-12-05 10:06:48 -08:00
Adam Simpkins
c8c1ba5eab remove eden/fs/utils/test/TestChecks.h
Summary:
The gtest macros in this file were moved to folly/test/TestUtils.h
Update everything to just use folly/test/TestUtils.h directly.

Reviewed By: chadaustin

Differential Revision: D6301759

fbshipit-source-id: 7f2841c12d5bea15376f782fb3bf3bfef16039c7
2017-11-15 12:53:55 -08:00
Adam Simpkins
fe8bdcda64 add EXPECT_THROW_RE() and EXPECT_THROW_ERRNO() test macros
Summary:
Add EXPECT_THROW_RE() and EXPECT_THROW_ERRNO() macros to folly/test/TestUtils.h
These allow more precise checks than the basic EXPECT_THROW() macro provided as
part of gtest.

These macros are being moved into folly from Facebook's eden repository
(https://github.com/facebookexperimental/eden)
This will allow us to use them in folly tests and in other projects that depend
on folly.

Reviewed By: yfeldblum

Differential Revision: D6301760

fbshipit-source-id: 1f434fb5bc9b7859f763171264fb0b2e1b4bda62
2017-11-15 12:53:55 -08:00
Chad Austin
8b9261f2a1 run clang-format across all C++ files
Summary:
Per discussion with bolinfest, this brings Eden in line with clang-format.

This diff was generated with `find . \( -iname '*.cpp' -o -iname '*.h' \) -exec bash -c "yes | arc lint {}" \;`

Reviewed By: bolinfest

Differential Revision: D6232695

fbshipit-source-id: d54942bf1c69b5b0dcd4df629f1f2d5538c9e28c
2017-11-03 16:02:03 -07:00
Yedidya Feldblum
9d990e6b6e CodeMod: Replace deps on folly:hash with folly/hash:hash
Summary: CodeMod: Replace deps on `folly:hash` with `folly/hash:hash`.

Reviewed By: meyering

Differential Revision: D6225250

fbshipit-source-id: 413cebd7bb7740ca78516ca816b8ac2ea8fd83a3
2017-11-03 01:30:06 -07:00
Yedidya Feldblum
dc496a363e CodeMod: Replace includes of folly/Hash.h with folly/hash/Hash.h
Summary: CodeMod: Replace includes of `folly/Hash.h` with `folly/hash/Hash.h`.

Reviewed By: luciang

Differential Revision: D6156195

fbshipit-source-id: 0941b3c9cf1d17d7cc62595111e506c06ee51236
2017-10-29 14:13:56 -07:00
James Sedgwick
bead588d50 move Iterator, Enumerate, EvictingCacheMap, Foreach, Merge, and
Summary: this is all non-hphp includes that are going in container/

Reviewed By: mzlee, yfeldblum

Differential Revision: D6121745

fbshipit-source-id: b024bde8835fc7f332686793d75eb8e71591c912
2017-10-23 12:30:26 -07:00
Yedidya Feldblum
1560a5bbf3 Revert D6050464: [Folly] Move folly/Hash.h to folly/hash/
Summary:
This reverts commit 64eb65aac8e3e7cd0126e65ca3998bfe167e2d73

bypass-lint

Differential Revision: D6050464

fbshipit-source-id: 1ed63f30837dc11ae57b316f1f7cb233a210894a
2017-10-19 02:35:00 -07:00
Yedidya Feldblum
5866f01d0d Move folly/Hash.h to folly/hash/
Summary: [Folly] Move `folly/Hash.h` to `folly/hash/`.

Reviewed By: jsedgwick

Differential Revision: D6050464

fbshipit-source-id: 64eb65aac8e3e7cd0126e65ca3998bfe167e2d73
2017-10-19 00:51:37 -07:00
Adam Simpkins
e1c54ad0bc add a new IoFuture helper class
Summary:
Add a helper class for waiting on socket I/O using an EventBase and fulfilling
a folly::Future when I/O is ready.

Reviewed By: bolinfest

Differential Revision: D6003899

fbshipit-source-id: ba9c1be425b102066eb585320fee495e4180e776
2017-10-10 15:51:15 -07:00
Adam Simpkins
bf8bf407ce add new ControlMsg helper class
Summary:
Add a new helper class for working with cmsghdr structs.

This updates the PrivHelperConn code to use this new class, and I will also use
this in the upcoming code for implementing graceful mount point takeover on
edenfs restart.

Reviewed By: bolinfest, wez

Differential Revision: D6003897

fbshipit-source-id: 634e9d8f1dc73010c9e9336872cf1270a344bdd2
2017-10-10 15:51:15 -07:00
Jyothsna Konisa
43f27195b6 Modification of unloadChildrenNow
Summary: Modified `TreeInode::unloadChildrenNow` such that inodes are unloaded whose age is greater than a specific age.

Reviewed By: simpkins

Differential Revision: D5526137

fbshipit-source-id: 91e2364d55e31befedcf43d98c26467e1a472ef9
2017-08-18 14:20:43 -07:00
Adam Simpkins
497a2ae765 update hg import tester to help benchmarking
Summary:
This makes several improvements to the hg import tester script:

- If no --edenDir flag is specified, initialize a new temporary directory to
  keep the RocksDB data store.

- Add a `--rocksdb_options_file` flag to allow controlling the options used for
  the RocksDB store.

- Add an --import_type flag to allow explicitly selecting if we should test
  the flat manifest or tree manifest import code.

- Add a --flat_import_file flag, to allow testing a pre-generated flat manifest
  input data file, rather than retrieving the data from mercurial.  This allows
  benchmarking only the C++ import code, and eliminating the python portion of
  the import.  The input file can be generated by running
  `hg_import_helper.py --manifest <revision>`

Reviewed By: wez

Differential Revision: D5541732

fbshipit-source-id: 340af4fea872412248d41453792b2179f0afa466
2017-08-03 18:00:22 -07:00
Adam Simpkins
61cac1cbea add a new UserInfo class for looking up UID/GID info
Summary:
This adds a new UserInfo class to store the UID, GID, as well as the username
and home directory.  This moves the determineUid() and determineGid() functions
from main.cpp into this new class, and makes the logic somewhat smarter now.

In addition to looking up the UID and GID, we now look up the username.  This
information is not used yet, but will be used in an upcoming diff to set
supplementary groups.

This also stores the home directory in the UserInfo class.  The home directory
is usually necessary to find the user's ~/.edenrc file.  Computing it as part
of UserInfo makes the most sense since we will likely have already looked up
the user's passwd entry.

Reviewed By: bolinfest

Differential Revision: D5501252

fbshipit-source-id: 1cb4be9f6c1493de4362da3393034e78bedd9db2
2017-07-27 19:38:59 -07:00
Adam Simpkins
05288c2b98 put PathFuncs.h in their own library rule
Summary:
This updates the eden/fs/utils/TARGETS file so that PathFuncs.h and
PathFuncs.cpp are in their own separate library.  The existing "utils" library
depends on it, but other users can now depend on PathFuncs.h without pulling in
the other code in utils.

I plan to make some of the privhelper code depend on PathFuncs.h in an upcoming
diff, and this makes it so that privhelper will not need to pull in the rest of
the utils code.

Reviewed By: bolinfest

Differential Revision: D5501253

fbshipit-source-id: 804067785ed663e223977d1c84ebcfc28b3f1642
2017-07-27 13:42:45 -07:00
Victor Gao
a477e9663f comment out unused parameters
Summary: This uses `clang-tidy` to comment out unused parameters (in functions, methods and lambdas) in fbcode. Cases that the tool failed to handle are fixed manually.

Reviewed By: igorsugak

Differential Revision: D5454343

fbshipit-source-id: 5dee339b4334e25e963891b519a5aa81fbf627b2
2017-07-21 15:01:05 -07:00
Christopher Dykes
0970c1e12a Merge StringBase.cpp into String.cpp
Summary: It doesn't need to exist anymore

Reviewed By: yfeldblum

Differential Revision: D5318746

fbshipit-source-id: c70b184f4b3fc12ede4632d6b3d43de16ed758c7
2017-06-29 20:20:11 -07:00
Adam Simpkins
429f737816 format eden/fs TARGETS files with autodeps
Summary:
Format all of the TARGETS files under eden/fs with the autodeps tool.

A few rocksdb include statements require comments so that autodeps can
correctly tell which dependency this include comes from.  The rocksdb library's
source file structure unfortunately does not match the layout of how its header
files get installed, so autodeps cannot figure this out automatically.

Reviewed By: wez

Differential Revision: D5316000

fbshipit-source-id: f8163adca79ee4a673440232d6467fb83e56aa10
2017-06-27 21:20:15 -07:00
Adam Simpkins
b0d1e57975 update logging statements to use folly logging APIs
Summary:
Update eden to log via the new folly logging APIs rather than with glog.

This adds a new --logging flag that takes a logging configuration string.
By default we set the log level to INFO for all eden logs, and WARNING for
everything else.  (I suspect we may eventually want to run with some
high-priority debug logs enabled for some or all of eden, but this seems like a
reasonable default to start with.)

Reviewed By: wez

Differential Revision: D5290783

fbshipit-source-id: 14183489c48c96613e2aca0f513bfa82fd9798c7
2017-06-22 13:50:13 -07:00
Andrew Gallagher
03bdaff954 codemod: format TARGETS with buildifier [4/5] (D5092623)
Reviewed By: igorsugak

fbshipit-source-id: 277a9d2bdc1d7e3ff3075bfe2d7307502fd0a507
2017-06-01 17:52:40 -07:00
wurzel parsons-keir
4e7af57e2d open(O_CREAT): supply required third argument on .cpp/.h files
Summary:
It is an error to not provide mode argument when open is
called with O_CREAT.

Reviewed By: oebeling

Differential Revision: D5020517

fbshipit-source-id: 87665ceb16ebdff797f8bf3d33bea082191e3121
2017-05-10 07:51:04 -07:00
Yedidya Feldblum
d5837dca4b Casing consistency for exception_wrapper::throw_exception
Summary: [Folly] Casing consistency for `exception_wrapper::throw_exception`.

Reviewed By: Orvid

Differential Revision: D4944818

fbshipit-source-id: 72056fb24ab6362e9a0319f73b5bbf8c92d658ca
2017-04-27 01:21:04 -07:00
Adam Simpkins
e9af688f90 fix missing space in EXPECT_THROW_* error messages
Summary:
The error messages for various failure cases in EXPECT_THROW_RE() and
EXPECT_THROW_ERRNO() were missing a space after the statement being executed.

Reviewed By: bolinfest

Differential Revision: D4941175

fbshipit-source-id: e10b4bff7db027acc5cc7ad5c12af248d55c7cd8
2017-04-24 18:20:50 -07:00
Adam Simpkins
a6ae3edab9 move eden/utils and eden/fuse into eden/fs
Summary:
This change makes it so that all of the C++ code related to the edenfs daemon
is now contained in the eden/fs subdirectory.

Reviewed By: bolinfest, wez

Differential Revision: D4889053

fbshipit-source-id: d0bd4774cc0bdb5d1d6b6f47d716ecae52391f37
2017-04-14 11:39:02 -07:00