From b5ee282f6b6e22e6c49ccac3e4011432820c54dc Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 6 Jun 2017 15:30:21 -0700 Subject: [PATCH] scoutfs: minor manifest ring comparison tracing It was nice to watch the ring compare nodes so leave behind the trace and clean up the callers so that uninitialized keys are cleanly null. Signed-off-by: Zach Brown --- kmod/src/manifest.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kmod/src/manifest.c b/kmod/src/manifest.c index e0eb9a9e..a04fbe50 100644 --- a/kmod/src/manifest.c +++ b/kmod/src/manifest.c @@ -414,6 +414,7 @@ scoutfs_manifest_find_range_entries(struct super_block *sb, nr = 0; /* get level 0 segments that overlap with the missing range */ + skey.key = NULL; skey.level = 0; skey.seq = ~0ULL; ment = scoutfs_ring_lookup_prev(&mani->ring, &skey); @@ -836,6 +837,8 @@ static int manifest_ring_compare_key(void *key, void *data) struct scoutfs_key_buf last; int cmp; + scoutfs_key_init(&first, NULL, 0); + if (skey->level < ment->level) { cmp = -1; goto out; @@ -861,6 +864,13 @@ static int manifest_ring_compare_key(void *key, void *data) } out: +#if 0 + /* pretty expensive to be on by default */ + SK_TRACE_PRINTK("%u,%llu,"SK_FMT" %c %u,%llu,"SK_FMT"\n", + skey->level, skey->seq, SK_ARG(skey->key), + cmp < 0 ? '<' : cmp == 0 ? '=' : '>', + ment->level, le64_to_cpu(ment->seq), SK_ARG(&first)); +#endif return cmp; }