remove FileHandle::openFlags_

Summary:
We're not doing anything with this today.  It's not
clear whether we should be doing sanity checks (eg: block attempts
to write to a handle that was opened only for reading) or whether
the kernel is going to do that for us, so I've broken this out
as a separate diff from the removal of FileData.

Reviewed By: bolinfest

Differential Revision: D5723064

fbshipit-source-id: b73452dfb4edf88b57fef1ad604bb2bde93bacc1
This commit is contained in:
Wez Furlong 2017-08-30 19:18:45 -07:00 committed by Facebook Github Bot
parent bdecf8b1f3
commit a32c744daf
3 changed files with 10 additions and 18 deletions

View File

@ -18,8 +18,7 @@
namespace facebook {
namespace eden {
FileHandle::FileHandle(FileInodePtr inode, int flags)
: inode_(std::move(inode)), openFlags_(flags) {}
FileHandle::FileHandle(FileInodePtr inode) : inode_(std::move(inode)) {}
folly::Future<fusell::Dispatcher::Attr> FileHandle::getattr() {
FB_LOGF(

View File

@ -20,9 +20,7 @@ class LocalStore;
class FileHandle : public fusell::FileHandle {
public:
explicit FileHandle(
FileInodePtr inode,
int flags);
explicit FileHandle(FileInodePtr inode);
~FileHandle() override {}
folly::Future<fusell::Dispatcher::Attr> getattr() override;
@ -40,7 +38,6 @@ class FileHandle : public fusell::FileHandle {
private:
FileInodePtr inode_;
int openFlags_;
};
}
}

View File

@ -283,17 +283,13 @@ folly::Future<std::shared_ptr<fusell::FileHandle>> FileInode::open(
}
if (fi.flags & (O_RDWR | O_WRONLY | O_CREAT | O_TRUNC)) {
return materializeForWrite(fi.flags).then(
[ self = inodePtrFromThis(), flags = fi.flags ]() {
return materializeForWrite(fi.flags).then([self = inodePtrFromThis()]() {
self->materializeInParent();
return shared_ptr<fusell::FileHandle>{
std::make_shared<FileHandle>(self, flags)};
return shared_ptr<fusell::FileHandle>{std::make_shared<FileHandle>(self)};
});
} else {
return ensureDataLoaded().then(
[ self = inodePtrFromThis(), flags = fi.flags ]() {
return shared_ptr<fusell::FileHandle>{
std::make_shared<FileHandle>(self, flags)};
return ensureDataLoaded().then([self = inodePtrFromThis()]() {
return shared_ptr<fusell::FileHandle>{std::make_shared<FileHandle>(self)};
});
}
}
@ -310,7 +306,7 @@ std::shared_ptr<FileHandle> FileInode::finishCreate() {
SCOPE_EXIT {
fileHandleDidClose();
};
return std::make_shared<FileHandle>(inodePtrFromThis(), 0);
return std::make_shared<FileHandle>(inodePtrFromThis());
}
Future<vector<string>> FileInode::listxattr() {