From 0a61bbb3572074bd0c2cecc407cc5416866a26f2 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 21 May 2015 18:48:06 -0700 Subject: [PATCH] hammer2 - Fix hammer2_cluster_load_async() issue * Fix a hammer2_cluster_load_async() issue. Old code hardwired the cluster index to 0, but this might not be a validated chain. Use cluster->focus instead. --- sys/vfs/hammer2/hammer2_cluster.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/sys/vfs/hammer2/hammer2_cluster.c b/sys/vfs/hammer2/hammer2_cluster.c index b6fc43fd30..5354a9aaa5 100644 --- a/sys/vfs/hammer2/hammer2_cluster.c +++ b/sys/vfs/hammer2/hammer2_cluster.c @@ -1765,20 +1765,8 @@ hammer2_cluster_load_async(hammer2_cluster_t *cluster, hammer2_blockref_t *bref; int i; - /* - * Try to find a chain whos data is already resolved. If none can - * be found, start with the first chain. - */ - chain = NULL; - for (i = 0; i < cluster->nchains; ++i) { - chain = cluster->array[i].chain; - if (chain && chain->data) - break; - } - if (i == cluster->nchains) { - chain = cluster->array[0].chain; - i = 0; - } + i = cluster->focus_index; + chain = cluster->focus; iocb = &cluster->iocb; iocb->callback = callback; -- 2.11.4.GIT