mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-27 18:34:35 +00:00
scoutfs: add 'end' to item_next to limit reads
Add an end key to the item_next calls to limit how many items will be read into the cache. Callers typically get this from the lock they hold that covers the iteration. We differentiate between iteration and caching so that a series of small iterations (listxattr on inodes, namespace walk in small dirs) can be satisfied by a single read of adjacent items from segments. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
+1
-1
@@ -933,7 +933,7 @@ int scoutfs_scan_orphans(struct super_block *sb)
|
||||
init_orphan_key(&last, &last_okey, sbi->node_id, ~0ULL);
|
||||
|
||||
while (1) {
|
||||
ret = scoutfs_item_next_same(sb, &key, &last, NULL);
|
||||
ret = scoutfs_item_next_same(sb, &key, &last, NULL, NULL);
|
||||
if (ret == -ENOENT) /* No more orphan items */
|
||||
break;
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user