file_systems: add entry_cache_(add/missing) in btrfs,ext2,exfat lookup methods.
Change-Id: I77857421a65f371bc885f1d4eb66ef2ab4376e56 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5252 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
2cecdeed2e
commit
cf5f513b3b
@@ -382,8 +382,12 @@ btrfs_lookup(fs_volume* _volume, fs_vnode* _directory, const char* name,
|
|||||||
return status;
|
return status;
|
||||||
|
|
||||||
status = DirectoryIterator(directory).Lookup(name, strlen(name), _vnodeID);
|
status = DirectoryIterator(directory).Lookup(name, strlen(name), _vnodeID);
|
||||||
if (status != B_OK)
|
if (status != B_OK) {
|
||||||
|
if (status == B_ENTRY_NOT_FOUND)
|
||||||
|
entry_cache_add_missing(volume->ID(), directory->ID(), name);
|
||||||
return status;
|
return status;
|
||||||
|
}
|
||||||
|
entry_cache_add(volume->ID(), directory->ID(), name, *_vnodeID);
|
||||||
|
|
||||||
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
|
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -397,10 +397,13 @@ exfat_lookup(fs_volume* _volume, fs_vnode* _directory, const char* name,
|
|||||||
status = DirectoryIterator(directory).Lookup(name, strlen(name), _vnodeID);
|
status = DirectoryIterator(directory).Lookup(name, strlen(name), _vnodeID);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
ERROR("exfat_lookup: name %s (%s)\n", name, strerror(status));
|
ERROR("exfat_lookup: name %s (%s)\n", name, strerror(status));
|
||||||
|
if (status == B_ENTRY_NOT_FOUND)
|
||||||
|
entry_cache_add_missing(volume->ID(), directory->ID(), name);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("exfat_lookup: ID %" B_PRIdINO "\n", *_vnodeID);
|
TRACE("exfat_lookup: ID %" B_PRIdINO "\n", *_vnodeID);
|
||||||
|
entry_cache_add(volume->ID(), directory->ID(), name, *_vnodeID);
|
||||||
|
|
||||||
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
|
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -467,8 +467,12 @@ ext2_lookup(fs_volume* _volume, fs_vnode* _directory, const char* name,
|
|||||||
ObjectDeleter<DirectoryIterator> iteratorDeleter(iterator);
|
ObjectDeleter<DirectoryIterator> iteratorDeleter(iterator);
|
||||||
|
|
||||||
status = iterator->FindEntry(name, _vnodeID);
|
status = iterator->FindEntry(name, _vnodeID);
|
||||||
if (status != B_OK)
|
if (status != B_OK) {
|
||||||
|
if (status == B_ENTRY_NOT_FOUND)
|
||||||
|
entry_cache_add_missing(volume->ID(), directory->ID(), name);
|
||||||
return status;
|
return status;
|
||||||
|
}
|
||||||
|
entry_cache_add(volume->ID(), directory->ID(), name, *_vnodeID);
|
||||||
|
|
||||||
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
|
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user