mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
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:
parent
bdecf8b1f3
commit
a32c744daf
@ -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(
|
||||
|
@ -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_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -283,18 +283,14 @@ 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 ]() {
|
||||
self->materializeInParent();
|
||||
return shared_ptr<fusell::FileHandle>{
|
||||
std::make_shared<FileHandle>(self, flags)};
|
||||
});
|
||||
return materializeForWrite(fi.flags).then([self = inodePtrFromThis()]() {
|
||||
self->materializeInParent();
|
||||
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user