Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe rf_CreateDiskQueueData() no longer uses wa...



details:   https://anonhg.NetBSD.org/src/rev/b3713abdd5d4
branches:  trunk
changeset: 984874:b3713abdd5d4
user:      oster <oster%NetBSD.org@localhost>
date:      Tue Jul 27 03:01:48 2021 +0000

description:
rf_CreateDiskQueueData() no longer uses waitflag, and will always succeed.
Cleanup the error path for the (no longer needed) PR_NOWAIT cases.

diffstat:

 sys/dev/raidframe/rf_copyback.c    |  10 ++++------
 sys/dev/raidframe/rf_dagfuncs.c    |  36 +++++++++++++-----------------------
 sys/dev/raidframe/rf_diskqueue.c   |   7 +++----
 sys/dev/raidframe/rf_diskqueue.h   |   4 ++--
 sys/dev/raidframe/rf_reconstruct.c |  10 +++++-----
 5 files changed, 27 insertions(+), 40 deletions(-)

diffs (196 lines):

diff -r dd5f798fd3bf -r b3713abdd5d4 sys/dev/raidframe/rf_copyback.c
--- a/sys/dev/raidframe/rf_copyback.c   Tue Jul 27 01:18:04 2021 +0000
+++ b/sys/dev/raidframe/rf_copyback.c   Tue Jul 27 03:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_copyback.c,v 1.54 2021/07/23 00:54:45 oster Exp $   */
+/*     $NetBSD: rf_copyback.c,v 1.55 2021/07/27 03:01:48 oster Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -38,7 +38,7 @@
  ****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.54 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.55 2021/07/27 03:01:48 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -335,12 +335,10 @@
        /* create reqs to read the old location & write the new */
        desc->readreq = rf_CreateDiskQueueData(RF_IO_TYPE_READ, spOffs,
            sectPerSU, desc->databuf, 0L, 0, rf_CopybackReadDoneProc, desc,
-           NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL,
-           PR_WAITOK);
+           NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL);
        desc->writereq = rf_CreateDiskQueueData(RF_IO_TYPE_WRITE, testOffs,
            sectPerSU, desc->databuf, 0L, 0, rf_CopybackWriteDoneProc, desc,
-           NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL,
-           PR_WAITOK);
+           NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL);
        desc->fcol = testCol;
 
        /* enqueue the read.  the write will go out as part of the callback on
diff -r dd5f798fd3bf -r b3713abdd5d4 sys/dev/raidframe/rf_dagfuncs.c
--- a/sys/dev/raidframe/rf_dagfuncs.c   Tue Jul 27 01:18:04 2021 +0000
+++ b/sys/dev/raidframe/rf_dagfuncs.c   Tue Jul 27 03:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagfuncs.c,v 1.32 2020/06/19 19:29:39 jdolecek Exp $        */
+/*     $NetBSD: rf_dagfuncs.c,v 1.33 2021/07/27 03:01:48 oster Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.32 2020/06/19 19:29:39 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.33 2021/07/27 03:01:48 oster Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -280,13 +280,10 @@
 #else
              NULL,
 #endif
-           (void *) (node->dagHdr->raidPtr), 0, node->dagHdr->bp, PR_NOWAIT);
-       if (!req) {
-               (node->wakeFunc) (node, ENOMEM);
-       } else {
-               node->dagFuncData = (void *) req;
-               rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
-       }
+           (void *) (node->dagHdr->raidPtr), 0, node->dagHdr->bp);
+
+       node->dagFuncData = (void *) req;
+       rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
 }
 
 
@@ -314,14 +311,10 @@
            NULL,
 #endif
            (void *) (node->dagHdr->raidPtr),
-           0, node->dagHdr->bp, PR_NOWAIT);
+           0, node->dagHdr->bp);
 
-       if (!req) {
-               (node->wakeFunc) (node, ENOMEM);
-       } else {
-               node->dagFuncData = (void *) req;
-               rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
-       }
+       node->dagFuncData = (void *) req;
+       rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
 }
 /*****************************************************************************
  * the undo function for disk nodes
@@ -343,13 +336,10 @@
             NULL,
 #endif
            (void *) (node->dagHdr->raidPtr),
-           0, NULL, PR_NOWAIT);
-       if (!req)
-               (node->wakeFunc) (node, ENOMEM);
-       else {
-               node->dagFuncData = (void *) req;
-               rf_DiskIOEnqueue(&(dqs[pda->col]), req, RF_IO_NORMAL_PRIORITY);
-       }
+           0, NULL);
+
+       node->dagFuncData = (void *) req;
+       rf_DiskIOEnqueue(&(dqs[pda->col]), req, RF_IO_NORMAL_PRIORITY);
 }
 
 /*****************************************************************************
diff -r dd5f798fd3bf -r b3713abdd5d4 sys/dev/raidframe/rf_diskqueue.c
--- a/sys/dev/raidframe/rf_diskqueue.c  Tue Jul 27 01:18:04 2021 +0000
+++ b/sys/dev/raidframe/rf_diskqueue.c  Tue Jul 27 03:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_diskqueue.c,v 1.61 2021/07/23 20:18:24 oster Exp $  */
+/*     $NetBSD: rf_diskqueue.c,v 1.62 2021/07/27 03:01:48 oster Exp $  */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -66,7 +66,7 @@
  ****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.61 2021/07/23 20:18:24 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.62 2021/07/27 03:01:48 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -373,8 +373,7 @@
                       RF_ReconUnitNum_t which_ru,
                       void (*wakeF) (void *, int), void *arg,
                       RF_AccTraceEntry_t *tracerec, RF_Raid_t *raidPtr,
-                      RF_DiskQueueDataFlags_t flags, const struct buf *mbp,
-                      int waitflag)
+                      RF_DiskQueueDataFlags_t flags, const struct buf *mbp)
 {
        RF_DiskQueueData_t *p;
 
diff -r dd5f798fd3bf -r b3713abdd5d4 sys/dev/raidframe/rf_diskqueue.h
--- a/sys/dev/raidframe/rf_diskqueue.h  Tue Jul 27 01:18:04 2021 +0000
+++ b/sys/dev/raidframe/rf_diskqueue.h  Tue Jul 27 03:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_diskqueue.h,v 1.28 2021/07/23 20:18:24 oster Exp $  */
+/*     $NetBSD: rf_diskqueue.h,v 1.29 2021/07/27 03:01:48 oster Exp $  */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -142,7 +142,7 @@
                                           void *,
                                           RF_AccTraceEntry_t *, RF_Raid_t *,
                                           RF_DiskQueueDataFlags_t,
-                                          const struct buf *, int);
+                                          const struct buf *);
 void rf_FreeDiskQueueData(RF_DiskQueueData_t *);
 int rf_ConfigureDiskQueue(RF_Raid_t *, RF_DiskQueue_t *,
                          RF_RowCol_t, const RF_DiskQueueSW_t *,
diff -r dd5f798fd3bf -r b3713abdd5d4 sys/dev/raidframe/rf_reconstruct.c
--- a/sys/dev/raidframe/rf_reconstruct.c        Tue Jul 27 01:18:04 2021 +0000
+++ b/sys/dev/raidframe/rf_reconstruct.c        Tue Jul 27 03:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_reconstruct.c,v 1.126 2021/07/23 00:54:45 oster Exp $       */
+/*     $NetBSD: rf_reconstruct.c,v 1.127 2021/07/27 03:01:48 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.126 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.127 2021/07/27 03:01:48 oster Exp $");
 
 #include <sys/param.h>
 #include <sys/time.h>
@@ -1313,7 +1313,7 @@
 #else
                                     NULL,
 #endif
-                                    (void *) raidPtr, 0, NULL, PR_WAITOK);
+                                    (void *) raidPtr, 0, NULL);
 
        ctrl->rbuf->arg = (void *) req;
        rf_DiskIOEnqueue(&raidPtr->Queues[col], req, RF_IO_RECON_PRIORITY);
@@ -1501,7 +1501,7 @@
 #else
                                     NULL,
 #endif
-           (void *) raidPtr, 0, NULL, PR_WAITOK);
+           (void *) raidPtr, 0, NULL);
 
        rbuf->arg = (void *) req;
        rf_lock_mutex2(raidPtr->reconControl->rb_mutex);
@@ -1827,7 +1827,7 @@
                                            psid, which_ru,
                                            ForceReconReadDoneProc,
                                            (void *) new_rbuf,
-                                           NULL, (void *) raidPtr, 0, NULL, PR_WAITOK);
+                                           NULL, (void *) raidPtr, 0, NULL);
 
                                        new_rbuf->arg = req;
                                        rf_DiskIOEnqueue(&raidPtr->Queues[diskno], req, RF_IO_NORMAL_PRIORITY); /* enqueue the I/O */



Home | Main Index | Thread Index | Old Index