mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-10 13:56:48 +00:00
Fix the logic of cacheable flag for dentry
This commit is contained in:
parent
c38e4f0800
commit
dbfb2e1a62
@ -531,9 +531,13 @@ impl Children {
|
||||
}
|
||||
|
||||
pub fn insert_dentry(&mut self, dentry: &Arc<Dentry>) {
|
||||
if dentry.vnode().is_dentry_cacheable() {
|
||||
DCACHE.lock().insert(dentry.key(), dentry.clone());
|
||||
// Do not cache it in DCACHE and children if is not cacheable.
|
||||
// When we look up it from the parent, it will always be newly created.
|
||||
if !dentry.vnode().is_dentry_cacheable() {
|
||||
return;
|
||||
}
|
||||
|
||||
DCACHE.lock().insert(dentry.key(), dentry.clone());
|
||||
self.inner.insert(dentry.name(), Arc::downgrade(dentry));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user