Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/chfs NFC - if/else blocks start with the same mutex_...



details:   https://anonhg.NetBSD.org/src/rev/f47cae040d8e
branches:  trunk
changeset: 1022455:f47cae040d8e
user:      andvar <andvar%NetBSD.org@localhost>
date:      Mon Jul 19 22:24:55 2021 +0000

description:
NFC - if/else blocks start with the same mutex_exit, just move it up.

diffstat:

 sys/ufs/chfs/chfs_gc.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r 76dbcf1a27e1 -r f47cae040d8e sys/ufs/chfs/chfs_gc.c
--- a/sys/ufs/chfs/chfs_gc.c    Mon Jul 19 22:21:36 2021 +0000
+++ b/sys/ufs/chfs/chfs_gc.c    Mon Jul 19 22:24:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chfs_gc.c,v 1.10 2021/07/16 21:18:41 andvar Exp $      */
+/*     $NetBSD: chfs_gc.c,v 1.11 2021/07/19 22:24:55 andvar Exp $      */
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -232,15 +232,13 @@
                                mutex_exit(&chmp->chm_lock_vnocache);
                                return NULL;
                        }
+                       mutex_exit(&chmp->chm_lock_vnocache);
                        if (vc->state != VNO_STATE_CHECKEDABSENT) {
-                               mutex_exit(&chmp->chm_lock_vnocache);
                                /* XXX why do we need the delay here?! */
                                KASSERT(mutex_owned(&chmp->chm_lock_mountfields));
                                cv_timedwait_sig(
                                        &chmp->chm_gc_thread.gcth_wakeup,
                                        &chmp->chm_lock_mountfields, mstohz(50));
-                       } else {
-                               mutex_exit(&chmp->chm_lock_vnocache);
                        }
                        return NULL;
                }



Home | Main Index | Thread Index | Old Index