summaryrefslogtreecommitdiff
path: root/jni/node-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'jni/node-inl.h')
-rw-r--r--jni/node-inl.h26
1 files changed, 7 insertions, 19 deletions
diff --git a/jni/node-inl.h b/jni/node-inl.h
index bb1b01331..01d6cbabb 100644
--- a/jni/node-inl.h
+++ b/jni/node-inl.h
@@ -127,15 +127,15 @@ class node {
public:
// Creates a new node with the specified parent, name and lock.
static node* Create(node* parent, const std::string& name, const std::string& io_path,
- bool should_invalidate, bool transforms_complete, const int transforms,
+ const bool transforms_complete, const int transforms,
const int transforms_reason, std::recursive_mutex* lock, ino_t ino,
NodeTracker* tracker) {
// Place the entire constructor under a critical section to make sure
// node creation, tracking (if enabled) and the addition to a parent are
// atomic.
std::lock_guard<std::recursive_mutex> guard(*lock);
- return new node(parent, name, io_path, should_invalidate, transforms_complete, transforms,
- transforms_reason, lock, ino, tracker);
+ return new node(parent, name, io_path, transforms_complete, transforms, transforms_reason,
+ lock, ino, tracker);
}
// Creates a new root node. Root nodes have no parents by definition
@@ -143,9 +143,8 @@ class node {
static node* CreateRoot(const std::string& path, std::recursive_mutex* lock, ino_t ino,
NodeTracker* tracker) {
std::lock_guard<std::recursive_mutex> guard(*lock);
- node* root = new node(nullptr, path, path, false /* should_invalidate */,
- true /* transforms_complete */, 0 /* transforms */,
- 0 /* transforms_reason */, lock, ino, tracker);
+ node* root = new node(nullptr, path, path, true /* transforms_complete */,
+ 0 /* transforms */, 0 /* transforms_reason */, lock, ino, tracker);
// The root always has one extra reference to avoid it being
// accidentally collected.
@@ -319,11 +318,6 @@ class node {
return false;
}
- bool ShouldInvalidate() const {
- std::lock_guard<std::recursive_mutex> guard(*lock_);
- return should_invalidate_;
- }
-
void SetName(std::string name) {
std::lock_guard<std::recursive_mutex> guard(*lock_);
name_ = std::move(name);
@@ -366,8 +360,8 @@ class node {
private:
node(node* parent, const std::string& name, const std::string& io_path,
- const bool should_invalidate, const bool transforms_complete, const int transforms,
- const int transforms_reason, std::recursive_mutex* lock, ino_t ino, NodeTracker* tracker)
+ const bool transforms_complete, const int transforms, const int transforms_reason,
+ std::recursive_mutex* lock, ino_t ino, NodeTracker* tracker)
: name_(name),
io_path_(io_path),
transforms_complete_(transforms_complete),
@@ -376,7 +370,6 @@ class node {
refcount_(0),
parent_(nullptr),
has_redacted_cache_(false),
- should_invalidate_(should_invalidate),
deleted_(false),
lock_(lock),
ino_(ino),
@@ -388,10 +381,6 @@ class node {
if (parent != nullptr) {
AddToParent(parent);
}
- // If the node requires transforms, we MUST never cache it in the VFS
- if (transforms) {
- CHECK(should_invalidate_);
- }
}
// Acquires a reference to a node. This maps to the "lookup count" specified
@@ -530,7 +519,6 @@ class node {
// List of directory handles associated with this node. Guarded by |lock_|.
std::vector<std::unique_ptr<dirhandle>> dirhandles_;
bool has_redacted_cache_;
- bool should_invalidate_;
bool deleted_;
std::recursive_mutex* lock_;
// Inode number of the file represented by this node.