Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe All IO is async in the RAIDframe kernel dr...



details:   https://anonhg.NetBSD.org/src/rev/91bdc4baa412
branches:  trunk
changeset: 1022505:91bdc4baa412
user:      oster <oster%NetBSD.org@localhost>
date:      Fri Jul 23 02:35:14 2021 +0000

description:
All IO is async in the RAIDframe kernel driver, so desc->async_flag
isn't needed.  Cleanup the flag from rf_DoAccess() and its caller as
well.

diffstat:

 sys/dev/raidframe/rf_desc.h        |   3 +--
 sys/dev/raidframe/rf_driver.c      |  13 +++++--------
 sys/dev/raidframe/rf_driver.h      |   4 ++--
 sys/dev/raidframe/rf_netbsdkintf.c |  12 +++---------
 sys/dev/raidframe/rf_states.c      |   9 ++-------
 5 files changed, 13 insertions(+), 28 deletions(-)

diffs (153 lines):

diff -r bef0804b54a1 -r 91bdc4baa412 sys/dev/raidframe/rf_desc.h
--- a/sys/dev/raidframe/rf_desc.h       Fri Jul 23 02:18:26 2021 +0000
+++ b/sys/dev/raidframe/rf_desc.h       Fri Jul 23 02:35:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_desc.h,v 1.21 2019/10/10 03:43:59 christos Exp $    */
+/*     $NetBSD: rf_desc.h,v 1.22 2021/07/23 02:35:14 oster Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -91,7 +91,6 @@
                                                 * I/O */
        void   *callbackArg;    /* arg to give to callback func */
        RF_RaidAccessDesc_t *next;
-       int     async_flag;
        RF_Etimer_t timer;      /* used for timing this access */
 };
 #endif                         /* !_RF__RF_DESC_H_ */
diff -r bef0804b54a1 -r 91bdc4baa412 sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c     Fri Jul 23 02:18:26 2021 +0000
+++ b/sys/dev/raidframe/rf_driver.c     Fri Jul 23 02:35:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_driver.c,v 1.138 2021/07/23 00:54:45 oster Exp $    */
+/*     $NetBSD: rf_driver.c,v 1.139 2021/07/23 02:35:14 oster Exp $    */
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.138 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.139 2021/07/23 02:35:14 oster Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_diagnostic.h"
@@ -665,13 +665,11 @@
  * when either the DAG library is incomplete or there are too many
  * failures in a parity group.
  *
- * type should be read or write async_flag should be RF_TRUE or
- * RF_FALSE bp_in is a buf pointer.  void *to facilitate ignoring it
- * outside the kernel
+ * type should be read or write.  bp_in is a buf pointer.  void *to
+ * facilitate ignoring it outside the kernel
  ********************************************************************/
 int
-rf_DoAccess(RF_Raid_t * raidPtr, RF_IoType_t type, int async_flag,
-           RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks,
+rf_DoAccess(RF_Raid_t * raidPtr, RF_IoType_t type, RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks,
            void *bufPtr, struct buf *bp, RF_RaidAccessFlags_t flags)
 {
        RF_RaidAccessDesc_t *desc;
@@ -704,7 +702,6 @@
 #if RF_ACC_TRACE > 0
        RF_ETIMER_START(desc->tracerec.tot_timer);
 #endif
-       desc->async_flag = async_flag;
 
        if (raidPtr->parity_map != NULL && 
            type == RF_IO_TYPE_WRITE)
diff -r bef0804b54a1 -r 91bdc4baa412 sys/dev/raidframe/rf_driver.h
--- a/sys/dev/raidframe/rf_driver.h     Fri Jul 23 02:18:26 2021 +0000
+++ b/sys/dev/raidframe/rf_driver.h     Fri Jul 23 02:35:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_driver.h,v 1.20 2015/12/26 00:58:45 pgoyette Exp $  */
+/*     $NetBSD: rf_driver.h,v 1.21 2021/07/23 02:35:14 oster Exp $     */
 /*
  * rf_driver.h
  */
@@ -52,7 +52,7 @@
                                         RF_RaidAccessFlags_t,
                                         const RF_AccessState_t *);
 void rf_FreeRaidAccDesc(RF_RaidAccessDesc_t *);
-int rf_DoAccess(RF_Raid_t *, RF_IoType_t, int, RF_RaidAddr_t,
+int rf_DoAccess(RF_Raid_t *, RF_IoType_t, RF_RaidAddr_t,
                RF_SectorCount_t, void *, struct buf *,
                RF_RaidAccessFlags_t);
 #if 0
diff -r bef0804b54a1 -r 91bdc4baa412 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Fri Jul 23 02:18:26 2021 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Fri Jul 23 02:35:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.395 2021/07/23 00:54:45 oster Exp $       */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.396 2021/07/23 02:35:14 oster Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.395 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.396 2021/07/23 02:35:14 oster Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -1904,7 +1904,6 @@
        RF_SectorCount_t num_blocks, pb, sum;
        RF_RaidAddr_t raid_addr;
        daddr_t blocknum;
-       int     do_async;
        int rc;
 
        rf_lock_mutex2(raidPtr->mutex);
@@ -1954,17 +1953,12 @@
        raidPtr->openings--;
        rf_unlock_mutex2(raidPtr->mutex);
 
-       /*
-        * Everything is async.
-        */
-       do_async = 1;
-
        /* don't ever condition on bp->b_flags & B_WRITE.
         * always condition on B_READ instead */
 
        rc = rf_DoAccess(raidPtr, (bp->b_flags & B_READ) ?
                         RF_IO_TYPE_READ : RF_IO_TYPE_WRITE,
-                        do_async, raid_addr, num_blocks,
+                        raid_addr, num_blocks,
                         bp->b_data, bp, RF_DAG_NONBLOCKING_IO);
 
 done:
diff -r bef0804b54a1 -r 91bdc4baa412 sys/dev/raidframe/rf_states.c
--- a/sys/dev/raidframe/rf_states.c     Fri Jul 23 02:18:26 2021 +0000
+++ b/sys/dev/raidframe/rf_states.c     Fri Jul 23 02:35:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_states.c,v 1.52 2021/07/23 00:54:45 oster Exp $     */
+/*     $NetBSD: rf_states.c,v 1.53 2021/07/23 02:35:14 oster Exp $     */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.52 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.53 2021/07/23 02:35:14 oster Exp $");
 
 #include <sys/errno.h>
 
@@ -216,11 +216,6 @@
        void * callbackArg = desc->callbackArg;
 
        /*
-        * We don't support non-async IO.
-        */
-       KASSERT(desc->async_flag);
-
-       /*
         * The parity_map hook has to go here, because the iodone
         * callback goes straight into the kintf layer.
         */



Home | Main Index | Thread Index | Old Index