sapling/eden/fs/inodes
Wez Furlong 174d0b9b0a eden: assign our own file handle numbers and track all file handles
Summary:
Previously we would simply report the raw pointer address to the kernel and
rely on it to return that same number to us as the file handle, and make sure
that it told us to shut down the handle when it was closed.

This meant that we had no real idea about which files were still open.

For our future live upgrade plans we need to be able to know this so that we
can transfer the appropriate information to our replacement process.

To facilitate this this diff implements a FileHandleMap class that will assign
file handle numbers and keep track of the instances.  The number assignment
strategy is the same as it used to be in the common case: we take the address
of the newly created instance and use that 64-bit number as the file handle
number.  However, in the future when we transfer the mapping to a new process,
we may experience a collision when subsequently opening a file handle.  To deal
with that, we have a bounded number of attempts to assign a random file handle
number.

We don't yet offer a means to iterate the map, but it would be trivial to
expose such an accessor when we're ready to use it.

Since we now keep track of these things via shared_ptr this changes the
appropriate portions of the fuse interface from unique_ptr to shared_ptr.

Reviewed By: simpkins

Differential Revision: D3602364

fbshipit-source-id: dd996339c2838225a2caeee9da16ef99a06c1e2b
2016-07-26 10:00:11 -07:00
..
EdenMount.cpp begin adding a new ObjectStore class 2016-06-08 19:01:13 -07:00
EdenMount.h begin adding a new ObjectStore class 2016-06-08 19:01:13 -07:00
FileData.cpp eden: implement O_EXCL open flags 2016-07-05 19:54:21 -07:00
FileData.h eden: implement O_EXCL open flags 2016-07-05 19:54:21 -07:00
TARGETS Include build files that were inadvertently excluded from the initial export. 2016-05-12 16:08:34 -07:00
TreeEntryFileHandle.cpp eden: add FileData::write, enable writes 2016-05-16 14:59:49 -07:00
TreeEntryFileHandle.h eden: add FileData::materialize 2016-05-16 14:59:49 -07:00
TreeEntryFileInode.cpp eden: assign our own file handle numbers and track all file handles 2016-07-26 10:00:11 -07:00
TreeEntryFileInode.h eden: assign our own file handle numbers and track all file handles 2016-07-26 10:00:11 -07:00
TreeInode.cpp eden: assign our own file handle numbers and track all file handles 2016-07-26 10:00:11 -07:00
TreeInode.h eden: assign our own file handle numbers and track all file handles 2016-07-26 10:00:11 -07:00
TreeInodeDirHandle.cpp always show tree contents for (non-opaque) directories in the overlay 2016-06-15 14:24:12 -07:00
TreeInodeDirHandle.h Initial commit 2016-05-12 14:09:13 -07:00