Use TAILQ_FOREACH_SAFE() in a couple of places.

This commit is contained in:
John Baldwin 2006-08-01 15:32:25 +00:00
parent 38affe135a
commit be698f1e7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160880
2 changed files with 2 additions and 5 deletions

View File

@ -360,8 +360,7 @@ nfsrv_cleancache(void)
NFSD_LOCK_ASSERT();
for (rp = TAILQ_FIRST(&nfsrvlruhead); rp != 0; rp = nextrp) {
nextrp = TAILQ_NEXT(rp, rc_lru);
TAILQ_FOREACH_SAFE(rp, &nfsrvlruhead, rc_lru, nextrp) {
LIST_REMOVE(rp, rc_hash);
TAILQ_REMOVE(&nfsrvlruhead, rp, rc_lru);
if (rp->rc_flag & RC_REPMBUF)

View File

@ -720,9 +720,7 @@ nfsrv_init(int terminating)
panic("nfsd init");
nfssvc_sockhead_flag |= SLP_INIT;
if (terminating) {
for (slp = TAILQ_FIRST(&nfssvc_sockhead); slp != NULL;
slp = nslp) {
nslp = TAILQ_NEXT(slp, ns_chain);
TAILQ_FOREACH_SAFE(slp, &nfssvc_sockhead, ns_chain, nslp) {
if (slp->ns_flag & SLP_VALID)
nfsrv_zapsock(slp);
TAILQ_REMOVE(&nfssvc_sockhead, slp, ns_chain);