sapling/eden/fs/fuse/FileHandleBase.h
Chad Austin 369d85108f remove getattr and setattr from FileHandleBase
Summary:
Always send setattr and getattr straight to the inode rather than
going through the FileHandle.

Reviewed By: wez

Differential Revision: D10187876

fbshipit-source-id: 4c3aaa977cd568d5f9cc4b28583e164119c07c1b
2018-10-08 13:17:03 -07:00

68 lines
1.7 KiB
C++

/*
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <folly/futures/Future.h>
#include "eden/fs/fuse/BufVec.h"
#include "eden/fs/fuse/Dispatcher.h"
#include "eden/fs/fuse/PollHandle.h"
namespace facebook {
namespace eden {
class Dispatcher;
class FileHandleBase {
public:
virtual ~FileHandleBase();
/* The result of an ioctl operation */
struct Ioctl {
int result;
BufVec buf;
};
/**
* Ioctl
*
* Only well-formed (restricted) ioctls are supported. These are ioctls
* that have the argument size encoded using _IOR, _IOW, _IOWR macros.
*
* @param arg is the argument passed in from userspace
* @param inputData is a copy of the arg data from userspace
* @param outputSize is the maximum size of the output data
*/
virtual folly::Future<Ioctl> ioctl(
int cmd,
const void* arg,
folly::ByteRange inputData,
size_t outputSize);
/**
* Poll for IO readiness
*
* Introduced in version 2.8
*
* Note: If ph is non-NULL, the client should notify
* when IO readiness events occur by calling
* ph->notify().
*
* Regardless of the number of times poll with a non-NULL ph
* is received, single notification is enough to clear all.
* Notifying more times incurs overhead but doesn't harm
* correctness.
*
* Return the poll(2) revents mask.
*/
virtual folly::Future<unsigned> poll(std::unique_ptr<PollHandle> ph);
};
} // namespace eden
} // namespace facebook