Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Introduce a temp variable, and allocate th...



details:   https://anonhg.NetBSD.org/src/rev/71049cea0321
branches:  trunk
changeset: 537820:71049cea0321
user:      oster <oster%NetBSD.org@localhost>
date:      Sun Oct 06 05:23:55 2002 +0000

description:
Introduce a temp variable, and allocate the ReconCtrl structure before
we protect raidPtr.  One less thing for LOCKDEBUG to complain about.

diffstat:

 sys/dev/raidframe/rf_reconstruct.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 19cc8bfc3fb8 -r 71049cea0321 sys/dev/raidframe/rf_reconstruct.c
--- a/sys/dev/raidframe/rf_reconstruct.c        Sun Oct 06 03:16:25 2002 +0000
+++ b/sys/dev/raidframe/rf_reconstruct.c        Sun Oct 06 05:23:55 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_reconstruct.c,v 1.45 2002/09/23 03:40:28 oster Exp $        */
+/*     $NetBSD: rf_reconstruct.c,v 1.46 2002/10/06 05:23:55 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  ************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.45 2002/09/23 03:40:28 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.46 2002/10/06 05:23:55 oster Exp $");
 
 #include <sys/time.h>
 #include <sys/buf.h>
@@ -628,7 +628,7 @@
        RF_RowCol_t srow = reconDesc->srow;
        RF_RowCol_t scol = reconDesc->scol;
        RF_ReconMap_t *mapPtr;
-
+       RF_ReconCtrl_t *tmp_reconctrl;
        RF_ReconEvent_t *event;
        struct timeval etime, elpsd;
        unsigned long xor_s, xor_resid_us;
@@ -659,11 +659,14 @@
 
        case 1:
 
+               /* allocate our RF_ReconCTRL_t before we protect raidPtr->reconControl[row] */
+               tmp_reconctrl = rf_MakeReconControl(reconDesc, row, col, srow, scol);
+
                RF_LOCK_MUTEX(raidPtr->mutex);
 
                /* create the reconstruction control pointer and install it in
                 * the right slot */
-               raidPtr->reconControl[row] = rf_MakeReconControl(reconDesc, row, col, srow, scol);
+               raidPtr->reconControl[row] = tmp_reconctrl;
                mapPtr = raidPtr->reconControl[row]->reconMap;
                raidPtr->status[row] = rf_rs_reconstructing;
                raidPtr->Disks[row][col].status = rf_ds_reconstructing;



Home | Main Index | Thread Index | Old Index