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:
Zach Brown
2017-07-19 13:30:03 -07:00
parent 4f6f842efa
commit f611c769e2
6 changed files with 31 additions and 26 deletions
+1 -1
View File
@@ -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)