mirror of
https://github.com/facebook/sapling.git
synced 2025-01-08 22:56:44 +03:00
stop handling opendir and releasedir on kernels with FUSE_NO_OPENDIR_SUPPORT
Summary: Eden requires no state in its directory handles, so tell the kernel it doesn't need to send opendir() and releasedir() requests, provided it has FUSE_NO_OPENDIR_SUPPORT. Reviewed By: strager Differential Revision: D13594734 fbshipit-source-id: ebd4b69f4efcd1428a69024c4bdffb1ae455fa40
This commit is contained in:
parent
a9d9689d3d
commit
cc1c841004
@ -1013,6 +1013,9 @@ void FuseChannel::readInitPacket() {
|
||||
// File handles are stateless so the kernel does not need to send open() and
|
||||
// release().
|
||||
want |= FUSE_NO_OPEN_SUPPORT;
|
||||
// File handles are stateless so the kernel does not need to send
|
||||
// open() and release().
|
||||
want |= FUSE_NO_OPENDIR_SUPPORT;
|
||||
#endif
|
||||
|
||||
// Only return the capabilities the kernel supports.
|
||||
|
@ -80,6 +80,15 @@ folly::Future<Dispatcher::Attr> EdenDispatcher::getattr(InodeNumber ino) {
|
||||
folly::Future<uint64_t> EdenDispatcher::opendir(InodeNumber ino, int flags) {
|
||||
FB_LOGF(
|
||||
mount_->getStraceLogger(), DBG7, "opendir({}, flags={:x})", ino, flags);
|
||||
#ifdef FUSE_NO_OPENDIR_SUPPORT
|
||||
if (getConnInfo().flags & FUSE_NO_OPENDIR_SUPPORT) {
|
||||
// If the kernel understands FUSE_NO_OPENDIR_SUPPORT, then returning ENOSYS
|
||||
// means that no further opendir() nor releasedir() calls will make it into
|
||||
// Eden.
|
||||
folly::throwSystemErrorExplicit(
|
||||
ENOSYS, "Eden opendir() calls are stateless and not required");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user