sapling/eden/fs/inodes/CacheHint.h
Chad Austin a6b4e0f2ff add CacheHint parameters to FileInode reads
Summary:
The new blob cache wants to know, given a request, whether the blob is
expected to be needed or not. The answer, in general, is yes if the
request came from Thrift and no if it came from FUSE, because the kernel
will cache the result of the request in its own page and dentry caches.
Propagate this information through FileInode.

Reviewed By: strager

Differential Revision: D12813838

fbshipit-source-id: 7a359686149cd4daff41630c94085b680c448c4f
2018-11-22 00:45:25 -08:00

35 lines
821 B
C++

/*
* Copyright (c) 2018-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
namespace facebook {
namespace eden {
/**
* A hint to read or fetch APIs about whether they should internally cache or
* not.
*/
enum class CacheHint {
/**
* The result of this fetch will be cached by the caller and thus does not
* need to be cached internally.
*/
NotNeededAgain,
/**
* The result of this read or fetch will likely be requested again, so it
* should be cached if possible.
*/
LikelyNeededAgain,
};
} // namespace eden
} // namespace facebook