From 793f84b86b7567082c0d56584d7f800309f28de0 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 17 Jun 2017 20:43:09 -0700 Subject: [PATCH] scoutfs: remove item reading limit The item reading limit was intended to minimize latency when we were directly reading cached manifests. We're now asking the server to walk the manifest for us and that's a lot more expensive than querying local cached blocks. Let's gulp in an entire segment's worth of items if we can. We'll have plenty of opportunity to tune this down later. Signed-off-by: Zach Brown --- kmod/src/manifest.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kmod/src/manifest.c b/kmod/src/manifest.c index faa7ef96..51e20802 100644 --- a/kmod/src/manifest.c +++ b/kmod/src/manifest.c @@ -482,8 +482,6 @@ out: * The segments are immutable at this point so we can use their contents * as long as we hold refs. */ -#define MAX_ITEMS_READ 32 - int scoutfs_manifest_read_items(struct super_block *sb, struct scoutfs_key_buf *key, struct scoutfs_key_buf *end) @@ -503,10 +501,10 @@ int scoutfs_manifest_read_items(struct super_block *sb, u8 item_flags; int found_ctr; bool found; + bool added; int ret = 0; int err; int cmp; - int n; trace_scoutfs_read_items(sb, key, end); @@ -564,8 +562,8 @@ int scoutfs_manifest_read_items(struct super_block *sb, found_ctr = 0; - for (n = 0; n < MAX_ITEMS_READ; n++) { - + added = false; + for (;;) { found = false; found_ctr++; @@ -628,10 +626,11 @@ int scoutfs_manifest_read_items(struct super_block *sb, ret = scoutfs_item_add_batch(sb, &batch, &found_key, found_val); if (ret) { - if (n > 0) + if (added) ret = 0; break; } + added = true; } /* the last successful key determines range end until run out */