Module Name:    src
Committed By:   oster
Date:           Fri Jul 23 02:35:14 UTC 2021

Modified Files:
        src/sys/dev/raidframe: rf_desc.h rf_driver.c rf_driver.h
            rf_netbsdkintf.c rf_states.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/raidframe/rf_desc.h
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/raidframe/rf_driver.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/raidframe/rf_driver.h
cvs rdiff -u -r1.395 -r1.396 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/raidframe/rf_states.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_desc.h
diff -u src/sys/dev/raidframe/rf_desc.h:1.21 src/sys/dev/raidframe/rf_desc.h:1.22
--- src/sys/dev/raidframe/rf_desc.h:1.21	Thu Oct 10 03:43:59 2019
+++ src/sys/dev/raidframe/rf_desc.h	Fri Jul 23 02:35:14 2021
@@ -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 @@ struct RF_RaidAccessDesc_s {
 						 * 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_ */

Index: src/sys/dev/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.138 src/sys/dev/raidframe/rf_driver.c:1.139
--- src/sys/dev/raidframe/rf_driver.c:1.138	Fri Jul 23 00:54:45 2021
+++ src/sys/dev/raidframe/rf_driver.c	Fri Jul 23 02:35:14 2021
@@ -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 @@ rf_FreeRaidAccDesc(RF_RaidAccessDesc_t *
  * 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 @@ rf_DoAccess(RF_Raid_t * raidPtr, RF_IoTy
 #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)

Index: src/sys/dev/raidframe/rf_driver.h
diff -u src/sys/dev/raidframe/rf_driver.h:1.20 src/sys/dev/raidframe/rf_driver.h:1.21
--- src/sys/dev/raidframe/rf_driver.h:1.20	Sat Dec 26 00:58:45 2015
+++ src/sys/dev/raidframe/rf_driver.h	Fri Jul 23 02:35:14 2021
@@ -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_RaidAccessDesc_t *rf_AllocRaidAccDesc
 					 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

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.395 src/sys/dev/raidframe/rf_netbsdkintf.c:1.396
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.395	Fri Jul 23 00:54:45 2021
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Fri Jul 23 02:35:14 2021
@@ -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 @@ raiddoaccess(RF_Raid_t *raidPtr, struct 
 	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 @@ raiddoaccess(RF_Raid_t *raidPtr, struct 
 	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:

Index: src/sys/dev/raidframe/rf_states.c
diff -u src/sys/dev/raidframe/rf_states.c:1.52 src/sys/dev/raidframe/rf_states.c:1.53
--- src/sys/dev/raidframe/rf_states.c:1.52	Fri Jul 23 00:54:45 2021
+++ src/sys/dev/raidframe/rf_states.c	Fri Jul 23 02:35:14 2021
@@ -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 @@ rf_State_LastState(RF_RaidAccessDesc_t *
 	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.
 	 */

Reply via email to