2016-05-12 23:43:17 +03:00
|
|
|
/*
|
2017-01-21 09:02:33 +03:00
|
|
|
* Copyright (c) 2016-present, Facebook, Inc.
|
2016-05-12 23:43:17 +03:00
|
|
|
* 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
|
2018-03-20 03:01:15 +03:00
|
|
|
#include "eden/fs/fuse/FileHandleBase.h"
|
2016-05-12 23:43:17 +03:00
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace eden {
|
2018-03-20 03:01:15 +03:00
|
|
|
|
|
|
|
class DirList;
|
2016-05-12 23:43:17 +03:00
|
|
|
|
|
|
|
class DirHandle : public FileHandleBase {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Read directory
|
|
|
|
*
|
|
|
|
* Send a DirList filled using DirList::add().
|
|
|
|
* Send an empty DirList on end of stream.
|
|
|
|
*/
|
|
|
|
virtual folly::Future<DirList> readdir(DirList&& list, off_t off) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronize directory contents
|
|
|
|
*
|
|
|
|
* If the datasync parameter is non-zero, then only the directory
|
|
|
|
* contents should be flushed, not the meta data.
|
|
|
|
*
|
|
|
|
* @param datasync flag indicating if only data should be flushed
|
|
|
|
*/
|
2018-04-27 06:41:40 +03:00
|
|
|
FOLLY_NODISCARD virtual folly::Future<folly::Unit> fsyncdir(
|
|
|
|
bool datasync) = 0;
|
2016-05-12 23:43:17 +03:00
|
|
|
};
|
2018-03-20 03:01:15 +03:00
|
|
|
|
2017-11-04 01:58:04 +03:00
|
|
|
} // namespace eden
|
|
|
|
} // namespace facebook
|