Fri Jul 23 02:35:14 2021 UTC ()
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.


(oster)
diff -r1.21 -r1.22 src/sys/dev/raidframe/rf_desc.h
diff -r1.138 -r1.139 src/sys/dev/raidframe/rf_driver.c
diff -r1.20 -r1.21 src/sys/dev/raidframe/rf_driver.h
diff -r1.395 -r1.396 src/sys/dev/raidframe/rf_netbsdkintf.c
diff -r1.52 -r1.53 src/sys/dev/raidframe/rf_states.c

cvs diff -r1.21 -r1.22 src/sys/dev/raidframe/rf_desc.h (expand / switch to context diff)
--- src/sys/dev/raidframe/rf_desc.h 2019/10/10 03:43:59 1.21
+++ src/sys/dev/raidframe/rf_desc.h 2021/07/23 02:35:14 1.22
@@ -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_ */

cvs diff -r1.138 -r1.139 src/sys/dev/raidframe/rf_driver.c (expand / switch to context diff)
--- src/sys/dev/raidframe/rf_driver.c 2021/07/23 00:54:45 1.138
+++ src/sys/dev/raidframe/rf_driver.c 2021/07/23 02:35:14 1.139
@@ -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)

cvs diff -r1.20 -r1.21 src/sys/dev/raidframe/rf_driver.h (expand / switch to context diff)
--- src/sys/dev/raidframe/rf_driver.h 2015/12/26 00:58:45 1.20
+++ src/sys/dev/raidframe/rf_driver.h 2021/07/23 02:35:14 1.21
@@ -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

cvs diff -r1.395 -r1.396 src/sys/dev/raidframe/rf_netbsdkintf.c (expand / switch to context diff)
--- src/sys/dev/raidframe/rf_netbsdkintf.c 2021/07/23 00:54:45 1.395
+++ src/sys/dev/raidframe/rf_netbsdkintf.c 2021/07/23 02:35:14 1.396
@@ -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:

cvs diff -r1.52 -r1.53 src/sys/dev/raidframe/rf_states.c (expand / switch to context diff)
--- src/sys/dev/raidframe/rf_states.c 2021/07/23 00:54:45 1.52
+++ src/sys/dev/raidframe/rf_states.c 2021/07/23 02:35:14 1.53
@@ -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>
 
@@ -214,11 +214,6 @@
 {
 	void    (*callbackFunc) (void *) = desc->callbackFunc;
 	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