Commit Graph

14419 Commits

Author SHA1 Message Date
Michael Bolin
a65e7fb98a Update directions for building Java thrift bindings with Java 7.
Summary:
Buck is [currently] built with Java 7, so it can only use third-party dependencies
that are also Java 7.

Reviewed By: simpkins

Differential Revision: D3342367

fbshipit-source-id: 4370fd152e7d2055495e783de68a6bb59867bee5
2016-05-24 21:53:00 -07:00
Michael Bolin
d6d5d6c695 Set up bind mounts for a client when mounting it.
Summary:
This adds a new API to `PrivHelper`: `privilegedBindMount()`.
Similar to `privilegedFuseMount()`, this sends a message to the privileged helper,
which is running as `root`, so it can set up the specified bind mount.
The changes in the `privhelper` directory parrot what was done to support `privilegedFuseMount()`.

Now, once the primary mount for a client is created, any bind mounts listed in the
config for the client are set up. This logic is introduced in `EdenServer.cpp`.

Reviewed By: simpkins

Differential Revision: D3296660

fbshipit-source-id: 61296f35e5c3a6f232a1c17e0f296dd5d3b5ec06
2016-05-23 21:33:20 -07:00
Michael Bolin
20ce44db52 Fix some errors I was seeing about raw pointer/unique_ptr consistency.
Reviewed By: wez

Differential Revision: D3333566

fbshipit-source-id: aae3bdbace416ab90ca32607951be3117dd4dbbb
2016-05-23 14:13:04 -07:00
Michael Bolin
cec2037036 Use glob() and local include.
Summary:
`glob()` prevents us from adding `.cpp` files to this directory that do not get compiled.

The header without the long path makes it clear that it is in the same directory as `PrivHelperTest.cpp`.

Reviewed By: simpkins

Differential Revision: D3301264

fbshipit-source-id: f58351a4f2857c8911f0bf82ae67136920fcb998
2016-05-23 12:24:58 -07:00
Adam Simpkins
53e821eb23 add an EdenMount class
Summary:
Add a new class to serve as a single location where we can store all
information about a single eden mount point.  Currently this contains the
MountPoint, LocalStore, and Overlay objects.  This allows the TreeInode class
to just store a single pointer to the EdenMount, rather than having to track
these three objects separately.

In the future we could consider also keeping a copy of the ClientConfig in the
EdenMount object, but I haven't done that for now.

Reviewed By: bolinfest

Differential Revision: D3321355

fbshipit-source-id: 8a39bb49822ca8e90c88b2a834b59230d2f91435
2016-05-20 10:34:07 -07:00
Wez Furlong
498a3b8aba eden: add mkdir support
Summary:
Enables mkdir in the overlay area.

I had to add some `lstat` calls in to the overlay dir reader because we depend
on knowing at least whether a node is a dir or not at the next level up.

When I run the test suite, the mounts are on my `/tmp` filesystem.  When I run
eden manually, they are on my `/data` filesystem.  The latter (xfs) does not
populate the type bits.  This meant that the test suite passed but manual
testing did not.

Adding the `lstat` calls is a little unfortunate.  On OS X there is a bulk
operation that combines `readdir` and `lstat` so that there are fewer syscalls.
We don't have an equivalent for Linux.

Reviewed By: bolinfest

Differential Revision: D3301532

fbshipit-source-id: e228f4a392f90aa491fec62e8b98471a8acecff2
2016-05-18 12:24:00 -07:00
Wez Furlong
103224b5df eden: remove naked pointers from FileInode::open and DirInode::opendir
Summary:
We still have naked pointers at the handoff to the kernel, but now
have a cleaner implementation at the level that we're going to be working at
day to day.

I also renamed `FileHandle::release` to `FileHandle::releasefile` so that it
isn't visually ambiguous with `std::unique_ptr::release` in the
`Dispatcher.cpp` code: `fh.release()` vs `fh->release()` look similar but are
dramatically different in behavior.

Reviewed By: bolinfest

Differential Revision: D3309455

fbshipit-source-id: f8cf055bcd51121048a20f0202988cf0aef1f085
2016-05-17 18:17:11 -07:00
Wez Furlong
f06b404b25 eden: remove PassThru inode classes
Summary: Now that we have integrated this functionality, we don't need these

Reviewed By: simpkins

Differential Revision: D3307034

fbshipit-source-id: 590469e9e7dec9c6b7d4f7b4e9a8d8c40d6ff552
2016-05-17 18:17:11 -07:00
Wez Furlong
deaf75a6b6 eden: init: require --mount and --repo options
Summary: This avoids an ugly error when --mount isn't passed.

Reviewed By: bolinfest

Differential Revision: D3302970

fbshipit-source-id: e60475e6b94fb4228e75fb392fb472886274aa0a
2016-05-17 18:17:11 -07:00
Wez Furlong
88c1b44aab eden: remove PassThru file handle usage
Summary:
`creat(2)` and `open(2)` could decide to create a PassThru file handle.

This diff removes that usage.  There is a TODO here around handling `O_EXCL` properly.
I'm punting this to a follow-up diff.

Reviewed By: bolinfest

Differential Revision: D3301387

fbshipit-source-id: d35104c536396e7fd064d786f3d5592ecfcbfecf
2016-05-17 17:23:02 -07:00
Wez Furlong
25dd9997d9 eden: add FileData::write, enable writes
Summary:
Centralize and delegate most (all?) of the content sensitive portions of file accesses into the FileData class.

Add tests to show that we can write to the overlay file and that the stat data is consistent with the result.

Reviewed By: bolinfest

Differential Revision: D3301251

fbshipit-source-id: a09316ad61c6ef4c656bc5d6dbd43f906abb7932
2016-05-16 14:59:49 -07:00
Wez Furlong
e9157c8b8b eden: add FileData::materialize
Summary:
This is the workhorse for adjusting the state that we track for the file data.

It handles both overlay and Tree backed data cases and moving from the latter
to the former depending on the open flags provided when a file handle is
opened.

This diff handles more cases than we have tests for.  Those will be covered later in this stack of diffs.

Reviewed By: bolinfest

Differential Revision: D3301213

fbshipit-source-id: c1dab40c0ad205ce6cee820043b70dd886e78431
2016-05-16 14:59:49 -07:00
Wez Furlong
1e3314f2dd eden: remove OverlayFileInode, fold into TreeEntryFileInode
Summary:
Another step towards making TreeEntryFileInode overlay aware, this diff implements:

- stat
- readlink (although it is not possible to create symlinks yet)
- open

Reviewed By: bolinfest

Differential Revision: D3255158

fbshipit-source-id: 3f90b624e629ef279d6cc32e1d82787ee24796eb
2016-05-16 14:59:49 -07:00
Wez Furlong
a34c8f1eac eden: factor out the filedata from the inode instance
Summary:
This allows us to share the same state between multiple open files and
also helps to reduce the size of inode instances that are otherwise inactive;
when there are no outstanding references to the data, we can drop it and forget
it.

Reviewed By: bolinfest

Differential Revision: D3301198

fbshipit-source-id: f0b3fc73a666ec2033c7a22e9eb587d3212cf966
2016-05-16 14:59:49 -07:00
Adam Simpkins
509467399a fix gcc opt build
Summary:
Update the PrivHelperConn code to copy file descriptors in and out of the cmsg
data using memcpy(), rather than dereferencing reinterpret_cast'ed pointers.
These cast's break C/C++'s strict aliasing rules, and gcc complains about this.

Reviewed By: bolinfest, wez

Differential Revision: D3306762

fbshipit-source-id: d36fb5ee02a52da2b60e86fb4a0fdb4910fc72d7
2016-05-16 13:18:05 -07:00
Michael Bolin
c2a0aa3af5 Modify EdenServiceHandler to get client info through ClientConfig.
Summary: This should set us up to have `eden mount` perform the bind mounts.

Reviewed By: simpkins

Differential Revision: D3296370

fbshipit-source-id: 5d8c21308074b357bad3ace72cec157adb5f8b56
2016-05-13 15:10:22 -07:00
Michael Bolin
3feb4c5c9a Change ClientConfig.getSnapshotID() to return a Hash instead of a string.
Reviewed By: wez

Differential Revision: D3296485

fbshipit-source-id: aef7abea6e4931c2129239dbfd44443b1141d549
2016-05-13 15:10:22 -07:00
Facebook Github Bot 8
83f42a9fa6 Include build files that were inadvertently excluded from the initial export.
fbshipit-source-id: 2c76f0d5e55d84859ad9f4841cbe6994a62446f8
2016-05-12 16:08:34 -07:00
Facebook Github Bot 5
2eeea32117 Initial commit
fbshipit-source-id: 2bcefbd0cd127cc5ea982e074ea6819d7aac3d7a
2016-05-12 14:09:13 -07:00