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.diff -r1.21 -r1.22 src/sys/dev/raidframe/rf_desc.h
(oster)
--- 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,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rf_desc.h,v 1.21 2019/10/10 03:43:59 christos Exp $ */ | 1 | /* $NetBSD: rf_desc.h,v 1.22 2021/07/23 02:35:14 oster Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1995 Carnegie-Mellon University. | 3 | * Copyright (c) 1995 Carnegie-Mellon University. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * Author: Mark Holland | 6 | * Author: Mark Holland | |
7 | * | 7 | * | |
8 | * Permission to use, copy, modify and distribute this software and | 8 | * Permission to use, copy, modify and distribute this software and | |
9 | * its documentation is hereby granted, provided that both the copyright | 9 | * its documentation is hereby granted, provided that both the copyright | |
10 | * notice and this permission notice appear in all copies of the | 10 | * notice and this permission notice appear in all copies of the | |
11 | * software, derivative works or modified versions, and any portions | 11 | * software, derivative works or modified versions, and any portions | |
12 | * thereof, and that both notices appear in supporting documentation. | 12 | * thereof, and that both notices appear in supporting documentation. | |
13 | * | 13 | * | |
14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | 14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
@@ -81,17 +81,16 @@ struct RF_RaidAccessDesc_s { | @@ -81,17 +81,16 @@ struct RF_RaidAccessDesc_s { | |||
81 | RF_VoidPointerListElem_t *iobufs; /* iobufs that need to be cleaned | 81 | RF_VoidPointerListElem_t *iobufs; /* iobufs that need to be cleaned | |
82 | up at the end of this IO */ | 82 | up at the end of this IO */ | |
83 | RF_VoidPointerListElem_t *stripebufs; /* stripe buffers that need to | 83 | RF_VoidPointerListElem_t *stripebufs; /* stripe buffers that need to | |
84 | be cleaned up at the end of | 84 | be cleaned up at the end of | |
85 | this IO */ | 85 | this IO */ | |
86 | RF_AccessStripeMapHeader_t *asmap; /* the asm for this I/O */ | 86 | RF_AccessStripeMapHeader_t *asmap; /* the asm for this I/O */ | |
87 | struct buf *bp; /* buf pointer for this RAID acc */ | 87 | struct buf *bp; /* buf pointer for this RAID acc */ | |
88 | RF_AccTraceEntry_t tracerec; /* perf monitoring information for a | 88 | RF_AccTraceEntry_t tracerec; /* perf monitoring information for a | |
89 | * user access (not for dag stats) */ | 89 | * user access (not for dag stats) */ | |
90 | void (*callbackFunc) (void *); /* callback function for this | 90 | void (*callbackFunc) (void *); /* callback function for this | |
91 | * I/O */ | 91 | * I/O */ | |
92 | void *callbackArg; /* arg to give to callback func */ | 92 | void *callbackArg; /* arg to give to callback func */ | |
93 | RF_RaidAccessDesc_t *next; | 93 | RF_RaidAccessDesc_t *next; | |
94 | int async_flag; | |||
95 | RF_Etimer_t timer; /* used for timing this access */ | 94 | RF_Etimer_t timer; /* used for timing this access */ | |
96 | }; | 95 | }; | |
97 | #endif /* !_RF__RF_DESC_H_ */ | 96 | #endif /* !_RF__RF_DESC_H_ */ |
--- 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,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rf_driver.c,v 1.138 2021/07/23 00:54:45 oster Exp $ */ | 1 | /* $NetBSD: rf_driver.c,v 1.139 2021/07/23 02:35:14 oster Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Greg Oster | 7 | * by Greg Oster | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -56,27 +56,27 @@ | @@ -56,27 +56,27 @@ | |||
56 | * rights to redistribute these changes. | 56 | * rights to redistribute these changes. | |
57 | */ | 57 | */ | |
58 | 58 | |||
59 | /****************************************************************************** | 59 | /****************************************************************************** | |
60 | * | 60 | * | |
61 | * rf_driver.c -- main setup, teardown, and access routines for the RAID driver | 61 | * rf_driver.c -- main setup, teardown, and access routines for the RAID driver | |
62 | * | 62 | * | |
63 | * all routines are prefixed with rf_ (raidframe), to avoid conficts. | 63 | * all routines are prefixed with rf_ (raidframe), to avoid conficts. | |
64 | * | 64 | * | |
65 | ******************************************************************************/ | 65 | ******************************************************************************/ | |
66 | 66 | |||
67 | 67 | |||
68 | #include <sys/cdefs.h> | 68 | #include <sys/cdefs.h> | |
69 | __KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.138 2021/07/23 00:54:45 oster Exp $"); | 69 | __KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.139 2021/07/23 02:35:14 oster Exp $"); | |
70 | 70 | |||
71 | #ifdef _KERNEL_OPT | 71 | #ifdef _KERNEL_OPT | |
72 | #include "opt_raid_diagnostic.h" | 72 | #include "opt_raid_diagnostic.h" | |
73 | #endif | 73 | #endif | |
74 | 74 | |||
75 | #include <sys/param.h> | 75 | #include <sys/param.h> | |
76 | #include <sys/systm.h> | 76 | #include <sys/systm.h> | |
77 | #include <sys/ioctl.h> | 77 | #include <sys/ioctl.h> | |
78 | #include <sys/fcntl.h> | 78 | #include <sys/fcntl.h> | |
79 | #include <sys/vnode.h> | 79 | #include <sys/vnode.h> | |
80 | 80 | |||
81 | 81 | |||
82 | #include "rf_archs.h" | 82 | #include "rf_archs.h" | |
@@ -655,33 +655,31 @@ rf_FreeRaidAccDesc(RF_RaidAccessDesc_t * | @@ -655,33 +655,31 @@ rf_FreeRaidAccDesc(RF_RaidAccessDesc_t * | |||
655 | rf_lock_mutex2(raidPtr->rad_lock); | 655 | rf_lock_mutex2(raidPtr->rad_lock); | |
656 | raidPtr->nAccOutstanding--; | 656 | raidPtr->nAccOutstanding--; | |
657 | if (raidPtr->waitShutdown) { | 657 | if (raidPtr->waitShutdown) { | |
658 | rf_signal_cond2(raidPtr->outstandingCond); | 658 | rf_signal_cond2(raidPtr->outstandingCond); | |
659 | } | 659 | } | |
660 | rf_unlock_mutex2(raidPtr->rad_lock); | 660 | rf_unlock_mutex2(raidPtr->rad_lock); | |
661 | } | 661 | } | |
662 | /********************************************************************* | 662 | /********************************************************************* | |
663 | * Main routine for performing an access. | 663 | * Main routine for performing an access. | |
664 | * Accesses are retried until a DAG can not be selected. This occurs | 664 | * Accesses are retried until a DAG can not be selected. This occurs | |
665 | * when either the DAG library is incomplete or there are too many | 665 | * when either the DAG library is incomplete or there are too many | |
666 | * failures in a parity group. | 666 | * failures in a parity group. | |
667 | * | 667 | * | |
668 | * type should be read or write async_flag should be RF_TRUE or | 668 | * type should be read or write. bp_in is a buf pointer. void *to | |
669 | * RF_FALSE bp_in is a buf pointer. void *to facilitate ignoring it | 669 | * facilitate ignoring it outside the kernel | |
670 | * outside the kernel | |||
671 | ********************************************************************/ | 670 | ********************************************************************/ | |
672 | int | 671 | int | |
673 | rf_DoAccess(RF_Raid_t * raidPtr, RF_IoType_t type, int async_flag, | 672 | rf_DoAccess(RF_Raid_t * raidPtr, RF_IoType_t type, RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks, | |
674 | RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks, | |||
675 | void *bufPtr, struct buf *bp, RF_RaidAccessFlags_t flags) | 673 | void *bufPtr, struct buf *bp, RF_RaidAccessFlags_t flags) | |
676 | { | 674 | { | |
677 | RF_RaidAccessDesc_t *desc; | 675 | RF_RaidAccessDesc_t *desc; | |
678 | void *lbufPtr = bufPtr; | 676 | void *lbufPtr = bufPtr; | |
679 | 677 | |||
680 | raidAddress += rf_raidSectorOffset; | 678 | raidAddress += rf_raidSectorOffset; | |
681 | 679 | |||
682 | #if RF_ACCESS_DEBUG | 680 | #if RF_ACCESS_DEBUG | |
683 | if (rf_accessDebug) { | 681 | if (rf_accessDebug) { | |
684 | 682 | |||
685 | printf("logBytes is: %d %d %d\n", raidPtr->raidid, | 683 | printf("logBytes is: %d %d %d\n", raidPtr->raidid, | |
686 | raidPtr->logBytesPerSector, | 684 | raidPtr->logBytesPerSector, | |
687 | (int) rf_RaidAddressToByte(raidPtr, numBlocks)); | 685 | (int) rf_RaidAddressToByte(raidPtr, numBlocks)); | |
@@ -694,27 +692,26 @@ rf_DoAccess(RF_Raid_t * raidPtr, RF_IoTy | @@ -694,27 +692,26 @@ rf_DoAccess(RF_Raid_t * raidPtr, RF_IoTy | |||
694 | (long) bufPtr); | 692 | (long) bufPtr); | |
695 | } | 693 | } | |
696 | #endif | 694 | #endif | |
697 | 695 | |||
698 | desc = rf_AllocRaidAccDesc(raidPtr, type, raidAddress, | 696 | desc = rf_AllocRaidAccDesc(raidPtr, type, raidAddress, | |
699 | numBlocks, lbufPtr, bp, flags, raidPtr->Layout.map->states); | 697 | numBlocks, lbufPtr, bp, flags, raidPtr->Layout.map->states); | |
700 | 698 | |||
701 | if (desc == NULL) { | 699 | if (desc == NULL) { | |
702 | return (ENOMEM); | 700 | return (ENOMEM); | |
703 | } | 701 | } | |
704 | #if RF_ACC_TRACE > 0 | 702 | #if RF_ACC_TRACE > 0 | |
705 | RF_ETIMER_START(desc->tracerec.tot_timer); | 703 | RF_ETIMER_START(desc->tracerec.tot_timer); | |
706 | #endif | 704 | #endif | |
707 | desc->async_flag = async_flag; | |||
708 | 705 | |||
709 | if (raidPtr->parity_map != NULL && | 706 | if (raidPtr->parity_map != NULL && | |
710 | type == RF_IO_TYPE_WRITE) | 707 | type == RF_IO_TYPE_WRITE) | |
711 | rf_paritymap_begin(raidPtr->parity_map, raidAddress, | 708 | rf_paritymap_begin(raidPtr->parity_map, raidAddress, | |
712 | numBlocks); | 709 | numBlocks); | |
713 | 710 | |||
714 | rf_ContinueRaidAccess(desc); | 711 | rf_ContinueRaidAccess(desc); | |
715 | 712 | |||
716 | return (0); | 713 | return (0); | |
717 | } | 714 | } | |
718 | #if 0 | 715 | #if 0 | |
719 | /* force the array into reconfigured mode without doing reconstruction */ | 716 | /* force the array into reconfigured mode without doing reconstruction */ | |
720 | int | 717 | int |
--- 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,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rf_driver.h,v 1.20 2015/12/26 00:58:45 pgoyette Exp $ */ | 1 | /* $NetBSD: rf_driver.h,v 1.21 2021/07/23 02:35:14 oster Exp $ */ | |
2 | /* | 2 | /* | |
3 | * rf_driver.h | 3 | * rf_driver.h | |
4 | */ | 4 | */ | |
5 | /* | 5 | /* | |
6 | * Copyright (c) 1996 Carnegie-Mellon University. | 6 | * Copyright (c) 1996 Carnegie-Mellon University. | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
8 | * | 8 | * | |
9 | * Author: Jim Zelenka | 9 | * Author: Jim Zelenka | |
10 | * | 10 | * | |
11 | * Permission to use, copy, modify and distribute this software and | 11 | * Permission to use, copy, modify and distribute this software and | |
12 | * its documentation is hereby granted, provided that both the copyright | 12 | * its documentation is hereby granted, provided that both the copyright | |
13 | * notice and this permission notice appear in all copies of the | 13 | * notice and this permission notice appear in all copies of the | |
14 | * software, derivative works or modified versions, and any portions | 14 | * software, derivative works or modified versions, and any portions | |
@@ -42,25 +42,25 @@ | @@ -42,25 +42,25 @@ | |||
42 | #endif | 42 | #endif | |
43 | 43 | |||
44 | extern rf_declare_mutex2(rf_printf_mutex); | 44 | extern rf_declare_mutex2(rf_printf_mutex); | |
45 | int rf_BootRaidframe(bool); | 45 | int rf_BootRaidframe(bool); | |
46 | int rf_UnbootRaidframe(void); | 46 | int rf_UnbootRaidframe(void); | |
47 | int rf_Shutdown(RF_Raid_t *); | 47 | int rf_Shutdown(RF_Raid_t *); | |
48 | int rf_Configure(RF_Raid_t *, RF_Config_t *, RF_AutoConfig_t *); | 48 | int rf_Configure(RF_Raid_t *, RF_Config_t *, RF_AutoConfig_t *); | |
49 | RF_RaidAccessDesc_t *rf_AllocRaidAccDesc(RF_Raid_t *, RF_IoType_t, | 49 | RF_RaidAccessDesc_t *rf_AllocRaidAccDesc(RF_Raid_t *, RF_IoType_t, | |
50 | RF_RaidAddr_t, RF_SectorCount_t, | 50 | RF_RaidAddr_t, RF_SectorCount_t, | |
51 | void *, void *, | 51 | void *, void *, | |
52 | RF_RaidAccessFlags_t, | 52 | RF_RaidAccessFlags_t, | |
53 | const RF_AccessState_t *); | 53 | const RF_AccessState_t *); | |
54 | void rf_FreeRaidAccDesc(RF_RaidAccessDesc_t *); | 54 | void rf_FreeRaidAccDesc(RF_RaidAccessDesc_t *); | |
55 | int rf_DoAccess(RF_Raid_t *, RF_IoType_t, int, RF_RaidAddr_t, | 55 | int rf_DoAccess(RF_Raid_t *, RF_IoType_t, RF_RaidAddr_t, | |
56 | RF_SectorCount_t, void *, struct buf *, | 56 | RF_SectorCount_t, void *, struct buf *, | |
57 | RF_RaidAccessFlags_t); | 57 | RF_RaidAccessFlags_t); | |
58 | #if 0 | 58 | #if 0 | |
59 | int rf_SetReconfiguredMode(RF_Raid_t *, RF_RowCol_t, RF_RowCol_t); | 59 | int rf_SetReconfiguredMode(RF_Raid_t *, RF_RowCol_t, RF_RowCol_t); | |
60 | #endif | 60 | #endif | |
61 | int rf_FailDisk(RF_Raid_t *, RF_RowCol_t, int); | 61 | int rf_FailDisk(RF_Raid_t *, RF_RowCol_t, int); | |
62 | void rf_SignalQuiescenceLock(RF_Raid_t *); | 62 | void rf_SignalQuiescenceLock(RF_Raid_t *); | |
63 | int rf_SuspendNewRequestsAndWait(RF_Raid_t *); | 63 | int rf_SuspendNewRequestsAndWait(RF_Raid_t *); | |
64 | void rf_ResumeNewRequests(RF_Raid_t *); | 64 | void rf_ResumeNewRequests(RF_Raid_t *); | |
65 | 65 | |||
66 | #endif /* !_RF__RF_DRIVER_H_ */ | 66 | #endif /* !_RF__RF_DRIVER_H_ */ |
--- 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,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rf_netbsdkintf.c,v 1.395 2021/07/23 00:54:45 oster Exp $ */ | 1 | /* $NetBSD: rf_netbsdkintf.c,v 1.396 2021/07/23 02:35:14 oster Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Greg Oster; Jason R. Thorpe. | 8 | * by Greg Oster; Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -91,27 +91,27 @@ | @@ -91,27 +91,27 @@ | |||
91 | * Pittsburgh PA 15213-3890 | 91 | * Pittsburgh PA 15213-3890 | |
92 | * | 92 | * | |
93 | * any improvements or extensions that they make and grant Carnegie the | 93 | * any improvements or extensions that they make and grant Carnegie the | |
94 | * rights to redistribute these changes. | 94 | * rights to redistribute these changes. | |
95 | */ | 95 | */ | |
96 | 96 | |||
97 | /*********************************************************** | 97 | /*********************************************************** | |
98 | * | 98 | * | |
99 | * rf_kintf.c -- the kernel interface routines for RAIDframe | 99 | * rf_kintf.c -- the kernel interface routines for RAIDframe | |
100 | * | 100 | * | |
101 | ***********************************************************/ | 101 | ***********************************************************/ | |
102 | 102 | |||
103 | #include <sys/cdefs.h> | 103 | #include <sys/cdefs.h> | |
104 | __KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.395 2021/07/23 00:54:45 oster Exp $"); | 104 | __KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.396 2021/07/23 02:35:14 oster Exp $"); | |
105 | 105 | |||
106 | #ifdef _KERNEL_OPT | 106 | #ifdef _KERNEL_OPT | |
107 | #include "opt_raid_autoconfig.h" | 107 | #include "opt_raid_autoconfig.h" | |
108 | #include "opt_compat_netbsd32.h" | 108 | #include "opt_compat_netbsd32.h" | |
109 | #endif | 109 | #endif | |
110 | 110 | |||
111 | #include <sys/param.h> | 111 | #include <sys/param.h> | |
112 | #include <sys/errno.h> | 112 | #include <sys/errno.h> | |
113 | #include <sys/pool.h> | 113 | #include <sys/pool.h> | |
114 | #include <sys/proc.h> | 114 | #include <sys/proc.h> | |
115 | #include <sys/queue.h> | 115 | #include <sys/queue.h> | |
116 | #include <sys/disk.h> | 116 | #include <sys/disk.h> | |
117 | #include <sys/device.h> | 117 | #include <sys/device.h> | |
@@ -1894,27 +1894,26 @@ raidstart(RF_Raid_t *raidPtr) | @@ -1894,27 +1894,26 @@ raidstart(RF_Raid_t *raidPtr) | |||
1894 | printf("raid%d: raidstart not ready\n", raidPtr->raidid); | 1894 | printf("raid%d: raidstart not ready\n", raidPtr->raidid); | |
1895 | return; | 1895 | return; | |
1896 | } | 1896 | } | |
1897 | 1897 | |||
1898 | dk_start(dksc, NULL); | 1898 | dk_start(dksc, NULL); | |
1899 | } | 1899 | } | |
1900 | 1900 | |||
1901 | static int | 1901 | static int | |
1902 | raiddoaccess(RF_Raid_t *raidPtr, struct buf *bp) | 1902 | raiddoaccess(RF_Raid_t *raidPtr, struct buf *bp) | |
1903 | { | 1903 | { | |
1904 | RF_SectorCount_t num_blocks, pb, sum; | 1904 | RF_SectorCount_t num_blocks, pb, sum; | |
1905 | RF_RaidAddr_t raid_addr; | 1905 | RF_RaidAddr_t raid_addr; | |
1906 | daddr_t blocknum; | 1906 | daddr_t blocknum; | |
1907 | int do_async; | |||
1908 | int rc; | 1907 | int rc; | |
1909 | 1908 | |||
1910 | rf_lock_mutex2(raidPtr->mutex); | 1909 | rf_lock_mutex2(raidPtr->mutex); | |
1911 | if (raidPtr->openings == 0) { | 1910 | if (raidPtr->openings == 0) { | |
1912 | rf_unlock_mutex2(raidPtr->mutex); | 1911 | rf_unlock_mutex2(raidPtr->mutex); | |
1913 | return EAGAIN; | 1912 | return EAGAIN; | |
1914 | } | 1913 | } | |
1915 | rf_unlock_mutex2(raidPtr->mutex); | 1914 | rf_unlock_mutex2(raidPtr->mutex); | |
1916 | 1915 | |||
1917 | blocknum = bp->b_rawblkno; | 1916 | blocknum = bp->b_rawblkno; | |
1918 | 1917 | |||
1919 | db1_printf(("Blocks: %d, %d\n", (int) bp->b_blkno, | 1918 | db1_printf(("Blocks: %d, %d\n", (int) bp->b_blkno, | |
1920 | (int) blocknum)); | 1919 | (int) blocknum)); | |
@@ -1944,37 +1943,32 @@ raiddoaccess(RF_Raid_t *raidPtr, struct | @@ -1944,37 +1943,32 @@ raiddoaccess(RF_Raid_t *raidPtr, struct | |||
1944 | */ | 1943 | */ | |
1945 | 1944 | |||
1946 | if (bp->b_bcount & raidPtr->sectorMask) { | 1945 | if (bp->b_bcount & raidPtr->sectorMask) { | |
1947 | rc = ENOSPC; | 1946 | rc = ENOSPC; | |
1948 | goto done; | 1947 | goto done; | |
1949 | } | 1948 | } | |
1950 | db1_printf(("Calling DoAccess..\n")); | 1949 | db1_printf(("Calling DoAccess..\n")); | |
1951 | 1950 | |||
1952 | 1951 | |||
1953 | rf_lock_mutex2(raidPtr->mutex); | 1952 | rf_lock_mutex2(raidPtr->mutex); | |
1954 | raidPtr->openings--; | 1953 | raidPtr->openings--; | |
1955 | rf_unlock_mutex2(raidPtr->mutex); | 1954 | rf_unlock_mutex2(raidPtr->mutex); | |
1956 | 1955 | |||
1957 | /* | |||
1958 | * Everything is async. | |||
1959 | */ | |||
1960 | do_async = 1; | |||
1961 | ||||
1962 | /* don't ever condition on bp->b_flags & B_WRITE. | 1956 | /* don't ever condition on bp->b_flags & B_WRITE. | |
1963 | * always condition on B_READ instead */ | 1957 | * always condition on B_READ instead */ | |
1964 | 1958 | |||
1965 | rc = rf_DoAccess(raidPtr, (bp->b_flags & B_READ) ? | 1959 | rc = rf_DoAccess(raidPtr, (bp->b_flags & B_READ) ? | |
1966 | RF_IO_TYPE_READ : RF_IO_TYPE_WRITE, | 1960 | RF_IO_TYPE_READ : RF_IO_TYPE_WRITE, | |
1967 | do_async, raid_addr, num_blocks, | 1961 | raid_addr, num_blocks, | |
1968 | bp->b_data, bp, RF_DAG_NONBLOCKING_IO); | 1962 | bp->b_data, bp, RF_DAG_NONBLOCKING_IO); | |
1969 | 1963 | |||
1970 | done: | 1964 | done: | |
1971 | return rc; | 1965 | return rc; | |
1972 | } | 1966 | } | |
1973 | 1967 | |||
1974 | /* invoke an I/O from kernel mode. Disk queue should be locked upon entry */ | 1968 | /* invoke an I/O from kernel mode. Disk queue should be locked upon entry */ | |
1975 | 1969 | |||
1976 | int | 1970 | int | |
1977 | rf_DispatchKernelIO(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req) | 1971 | rf_DispatchKernelIO(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req) | |
1978 | { | 1972 | { | |
1979 | int op = (req->type == RF_IO_TYPE_READ) ? B_READ : B_WRITE; | 1973 | int op = (req->type == RF_IO_TYPE_READ) ? B_READ : B_WRITE; | |
1980 | struct buf *bp; | 1974 | struct buf *bp; |
--- 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,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rf_states.c,v 1.52 2021/07/23 00:54:45 oster Exp $ */ | 1 | /* $NetBSD: rf_states.c,v 1.53 2021/07/23 02:35:14 oster Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1995 Carnegie-Mellon University. | 3 | * Copyright (c) 1995 Carnegie-Mellon University. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * Author: Mark Holland, William V. Courtright II, Robby Findler | 6 | * Author: Mark Holland, William V. Courtright II, Robby Findler | |
7 | * | 7 | * | |
8 | * Permission to use, copy, modify and distribute this software and | 8 | * Permission to use, copy, modify and distribute this software and | |
9 | * its documentation is hereby granted, provided that both the copyright | 9 | * its documentation is hereby granted, provided that both the copyright | |
10 | * notice and this permission notice appear in all copies of the | 10 | * notice and this permission notice appear in all copies of the | |
11 | * software, derivative works or modified versions, and any portions | 11 | * software, derivative works or modified versions, and any portions | |
12 | * thereof, and that both notices appear in supporting documentation. | 12 | * thereof, and that both notices appear in supporting documentation. | |
13 | * | 13 | * | |
14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | 14 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
@@ -17,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
17 | * | 17 | * | |
18 | * Carnegie Mellon requests users of this software to return to | 18 | * Carnegie Mellon requests users of this software to return to | |
19 | * | 19 | * | |
20 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | 20 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
21 | * School of Computer Science | 21 | * School of Computer Science | |
22 | * Carnegie Mellon University | 22 | * Carnegie Mellon University | |
23 | * Pittsburgh PA 15213-3890 | 23 | * Pittsburgh PA 15213-3890 | |
24 | * | 24 | * | |
25 | * any improvements or extensions that they make and grant Carnegie the | 25 | * any improvements or extensions that they make and grant Carnegie the | |
26 | * rights to redistribute these changes. | 26 | * rights to redistribute these changes. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.52 2021/07/23 00:54:45 oster Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.53 2021/07/23 02:35:14 oster Exp $"); | |
31 | 31 | |||
32 | #include <sys/errno.h> | 32 | #include <sys/errno.h> | |
33 | 33 | |||
34 | #include "rf_archs.h" | 34 | #include "rf_archs.h" | |
35 | #include "rf_threadstuff.h" | 35 | #include "rf_threadstuff.h" | |
36 | #include "rf_raid.h" | 36 | #include "rf_raid.h" | |
37 | #include "rf_dag.h" | 37 | #include "rf_dag.h" | |
38 | #include "rf_desc.h" | 38 | #include "rf_desc.h" | |
39 | #include "rf_aselect.h" | 39 | #include "rf_aselect.h" | |
40 | #include "rf_general.h" | 40 | #include "rf_general.h" | |
41 | #include "rf_states.h" | 41 | #include "rf_states.h" | |
42 | #include "rf_dagutils.h" | 42 | #include "rf_dagutils.h" | |
43 | #include "rf_driver.h" | 43 | #include "rf_driver.h" | |
@@ -206,31 +206,26 @@ rf_ContinueDagAccess(RF_DagList_t *dagLi | @@ -206,31 +206,26 @@ rf_ContinueDagAccess(RF_DagList_t *dagLi | |||
206 | #endif | 206 | #endif | |
207 | } | 207 | } | |
208 | dagList->numDagsDone++; | 208 | dagList->numDagsDone++; | |
209 | rf_ContinueRaidAccess(desc); | 209 | rf_ContinueRaidAccess(desc); | |
210 | } | 210 | } | |
211 | 211 | |||
212 | int | 212 | int | |
213 | rf_State_LastState(RF_RaidAccessDesc_t *desc) | 213 | rf_State_LastState(RF_RaidAccessDesc_t *desc) | |
214 | { | 214 | { | |
215 | void (*callbackFunc) (void *) = desc->callbackFunc; | 215 | void (*callbackFunc) (void *) = desc->callbackFunc; | |
216 | void * callbackArg = desc->callbackArg; | 216 | void * callbackArg = desc->callbackArg; | |
217 | 217 | |||
218 | /* | 218 | /* | |
219 | * We don't support non-async IO. | |||
220 | */ | |||
221 | KASSERT(desc->async_flag); | |||
222 | ||||
223 | /* | |||
224 | * The parity_map hook has to go here, because the iodone | 219 | * The parity_map hook has to go here, because the iodone | |
225 | * callback goes straight into the kintf layer. | 220 | * callback goes straight into the kintf layer. | |
226 | */ | 221 | */ | |
227 | if (desc->raidPtr->parity_map != NULL && | 222 | if (desc->raidPtr->parity_map != NULL && | |
228 | desc->type == RF_IO_TYPE_WRITE) | 223 | desc->type == RF_IO_TYPE_WRITE) | |
229 | rf_paritymap_end(desc->raidPtr->parity_map, | 224 | rf_paritymap_end(desc->raidPtr->parity_map, | |
230 | desc->raidAddress, desc->numBlocks); | 225 | desc->raidAddress, desc->numBlocks); | |
231 | 226 | |||
232 | /* printf("Calling raiddone on 0x%x\n",desc->bp); */ | 227 | /* printf("Calling raiddone on 0x%x\n",desc->bp); */ | |
233 | raiddone(desc->raidPtr, desc->bp); /* access came through ioctl */ | 228 | raiddone(desc->raidPtr, desc->bp); /* access came through ioctl */ | |
234 | 229 | |||
235 | if (callbackFunc) | 230 | if (callbackFunc) | |
236 | callbackFunc(callbackArg); | 231 | callbackFunc(callbackArg); |