From: Andrew Deason Date: Fri, 28 Dec 2012 21:36:42 +0000 (-0500) Subject: afs: Consolidate ShakeLooseVCaches retry init X-Git-Tag: upstream/1.8.0_pre1^2~1693 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=36959b50e513d4e9d4d2be93965eec2537943de5;p=packages%2Fo%2Fopenafs.git 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 --- diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 7620ed4ad..21c49f88c 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; }