From 36959b50e513d4e9d4d2be93965eec2537943de5 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 28 Dec 2012 16:36:42 -0500 Subject: [PATCH] afs: Consolidate ShakeLooseVCaches retry init Don't duplicate the initialization code in effectively three separate places. Just goto the top of the loop again. This should incur no functional change; it's just reorganization. Change-Id: I40548919a5fa9c4e472a4de0eada8d213d034097 Reviewed-on: http://gerrit.openafs.org/8848 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Derrick Brashear --- src/afs/afs_vcache.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 7620ed4..21c49f8 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -709,8 +709,10 @@ afs_ShakeLooseVCaches(afs_int32 anumber) int fv_slept, defersleep = 0; afs_int32 target = anumber; - i = 0; loop = 0; + + retry: + i = 0; for (tq = VLRU.prev; tq != &VLRU && anumber > 0; tq = uq) { tvc = QTOV(tq); uq = QPrev(tq); @@ -731,16 +733,12 @@ afs_ShakeLooseVCaches(afs_int32 anumber) if (fv_slept) { if (loop++ > 100) break; - uq = VLRU.prev; - i = 0; - continue; /* start over - may have raced. */ + goto retry; /* start over - may have raced. */ } if (uq == &VLRU) { if (anumber && !defersleep) { defersleep = 1; - uq = VLRU.prev; - i = 0; - continue; + goto retry; } break; } -- 1.9.4