summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2021-07-27 03:01:48 +0000
committeroster <oster@NetBSD.org>2021-07-27 03:01:48 +0000
commit7a378c3e22a3aedd8a859082453d261fb61125a0 (patch)
tree70b6ad75b94a2a7f9dd6731b2ce1ec374cee9044 /sys/dev/raidframe
parente361878a261e7579d20511c7dbb5adb4e17d445e (diff)
rf_CreateDiskQueueData() no longer uses waitflag, and will always succeed.
Cleanup the error path for the (no longer needed) PR_NOWAIT cases.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_copyback.c10
-rw-r--r--sys/dev/raidframe/rf_dagfuncs.c36
-rw-r--r--sys/dev/raidframe/rf_diskqueue.c7
-rw-r--r--sys/dev/raidframe/rf_diskqueue.h4
-rw-r--r--sys/dev/raidframe/rf_reconstruct.c10
5 files changed, 27 insertions, 40 deletions
diff --git a/sys/dev/raidframe/rf_copyback.c b/sys/dev/raidframe/rf_copyback.c
index f76ab771381..418f3ebb180 100644
--- a/sys/dev/raidframe/rf_copyback.c
+++ b/sys/dev/raidframe/rf_copyback.c
@@ -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 @@ rf_CopybackOne(RF_CopybackDesc_t *desc, int typ, RF_RaidAddr_t addr,
/* 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 --git a/sys/dev/raidframe/rf_dagfuncs.c b/sys/dev/raidframe/rf_dagfuncs.c
index d09fdc1bcb8..ee94a1d31cf 100644
--- a/sys/dev/raidframe/rf_dagfuncs.c
+++ b/sys/dev/raidframe/rf_dagfuncs.c
@@ -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 @@ rf_DiskReadFuncForThreads(RF_DagNode_t *node)
#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 @@ rf_DiskWriteFuncForThreads(RF_DagNode_t *node)
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 @@ rf_DiskUndoFunc(RF_DagNode_t *node)
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 --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c
index d53cf64278d..06230097f55 100644
--- a/sys/dev/raidframe/rf_diskqueue.c
+++ b/sys/dev/raidframe/rf_diskqueue.c
@@ -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_CreateDiskQueueData(RF_IoType_t typ, RF_SectorNum_t ssect,
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 --git a/sys/dev/raidframe/rf_diskqueue.h b/sys/dev/raidframe/rf_diskqueue.h
index aa622118bb3..0ee7de36615 100644
--- a/sys/dev/raidframe/rf_diskqueue.h
+++ b/sys/dev/raidframe/rf_diskqueue.h
@@ -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 @@ RF_DiskQueueData_t *rf_CreateDiskQueueData(RF_IoType_t, RF_SectorNum_t,
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 --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c
index f9f44fbd2ff..e1fbc38f629 100644
--- a/sys/dev/raidframe/rf_reconstruct.c
+++ b/sys/dev/raidframe/rf_reconstruct.c
@@ -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 @@ TryToRead(RF_Raid_t *raidPtr, RF_RowCol_t col)
#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 @@ IssueNextWriteRequest(RF_Raid_t *raidPtr)
#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 @@ rf_ForceOrBlockRecon(RF_Raid_t *raidPtr, RF_AccessStripeMap_t *asmap,
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 */