| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: rf_disks.c,v 1.93.4.1 2024/04/28 12:09:08 martin Exp $ */ | | 1 | /* $NetBSD: rf_disks.c,v 1.93.4.2 2024/05/04 12:04:56 martin 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 |
| @@ -50,27 +50,27 @@ | | | @@ -50,27 +50,27 @@ |
50 | * School of Computer Science | | 50 | * School of Computer Science |
51 | * Carnegie Mellon University | | 51 | * Carnegie Mellon University |
52 | * Pittsburgh PA 15213-3890 | | 52 | * Pittsburgh PA 15213-3890 |
53 | * | | 53 | * |
54 | * any improvements or extensions that they make and grant Carnegie the | | 54 | * any improvements or extensions that they make and grant Carnegie the |
55 | * rights to redistribute these changes. | | 55 | * rights to redistribute these changes. |
56 | */ | | 56 | */ |
57 | | | 57 | |
58 | /*************************************************************** | | 58 | /*************************************************************** |
59 | * rf_disks.c -- code to perform operations on the actual disks | | 59 | * rf_disks.c -- code to perform operations on the actual disks |
60 | ***************************************************************/ | | 60 | ***************************************************************/ |
61 | | | 61 | |
62 | #include <sys/cdefs.h> | | 62 | #include <sys/cdefs.h> |
63 | __KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.93.4.1 2024/04/28 12:09:08 martin Exp $"); | | 63 | __KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.93.4.2 2024/05/04 12:04:56 martin Exp $"); |
64 | | | 64 | |
65 | #include <dev/raidframe/raidframevar.h> | | 65 | #include <dev/raidframe/raidframevar.h> |
66 | | | 66 | |
67 | #include "rf_raid.h" | | 67 | #include "rf_raid.h" |
68 | #include "rf_alloclist.h" | | 68 | #include "rf_alloclist.h" |
69 | #include "rf_driver.h" | | 69 | #include "rf_driver.h" |
70 | #include "rf_utils.h" | | 70 | #include "rf_utils.h" |
71 | #include "rf_general.h" | | 71 | #include "rf_general.h" |
72 | #include "rf_options.h" | | 72 | #include "rf_options.h" |
73 | #include "rf_kintf.h" | | 73 | #include "rf_kintf.h" |
74 | #include "rf_netbsd.h" | | 74 | #include "rf_netbsd.h" |
75 | | | 75 | |
76 | #include <sys/param.h> | | 76 | #include <sys/param.h> |
| @@ -1259,29 +1259,29 @@ void | | | @@ -1259,29 +1259,29 @@ void |
1259 | rf_swap_components(RF_Raid_t *raidPtr, int a, int b) | | 1259 | rf_swap_components(RF_Raid_t *raidPtr, int a, int b) |
1260 | { | | 1260 | { |
1261 | char tmpdevname[56]; /* 56 is from raidframevar.h */ | | 1261 | char tmpdevname[56]; /* 56 is from raidframevar.h */ |
1262 | RF_ComponentLabel_t tmp_ci_label; | | 1262 | RF_ComponentLabel_t tmp_ci_label; |
1263 | dev_t tmp_ci_dev, tmp_dev; | | 1263 | dev_t tmp_ci_dev, tmp_dev; |
1264 | int tmp_status; | | 1264 | int tmp_status; |
1265 | struct vnode *tmp_ci_vp; | | 1265 | struct vnode *tmp_ci_vp; |
1266 | | | 1266 | |
1267 | | | 1267 | |
1268 | /* This function *MUST* be called with all IO suspended. */ | | 1268 | /* This function *MUST* be called with all IO suspended. */ |
1269 | RF_ASSERT(raidPtr->accesses_suspended == 0); | | 1269 | RF_ASSERT(raidPtr->accesses_suspended == 0); |
1270 | | | 1270 | |
1271 | /* Swap the component names... */ | | 1271 | /* Swap the component names... */ |
1272 | snprintf(tmpdevname, sizeof(tmpdevname),raidPtr->Disks[a].devname); | | 1272 | snprintf(tmpdevname, sizeof(tmpdevname), "%s", raidPtr->Disks[a].devname); |
1273 | snprintf(raidPtr->Disks[a].devname, sizeof(raidPtr->Disks[a].devname), raidPtr->Disks[b].devname); | | 1273 | snprintf(raidPtr->Disks[a].devname, sizeof(raidPtr->Disks[a].devname), "%s", raidPtr->Disks[b].devname); |
1274 | snprintf(raidPtr->Disks[b].devname, sizeof(raidPtr->Disks[b].devname), tmpdevname); | | 1274 | snprintf(raidPtr->Disks[b].devname, sizeof(raidPtr->Disks[b].devname), "%s", tmpdevname); |
1275 | | | 1275 | |
1276 | /* and the vp */ | | 1276 | /* and the vp */ |
1277 | tmp_ci_vp = raidPtr->raid_cinfo[a].ci_vp; | | 1277 | tmp_ci_vp = raidPtr->raid_cinfo[a].ci_vp; |
1278 | raidPtr->raid_cinfo[a].ci_vp = raidPtr->raid_cinfo[b].ci_vp; | | 1278 | raidPtr->raid_cinfo[a].ci_vp = raidPtr->raid_cinfo[b].ci_vp; |
1279 | raidPtr->raid_cinfo[b].ci_vp = tmp_ci_vp; | | 1279 | raidPtr->raid_cinfo[b].ci_vp = tmp_ci_vp; |
1280 | | | 1280 | |
1281 | /* and the ci dev */ | | 1281 | /* and the ci dev */ |
1282 | tmp_ci_dev = raidPtr->raid_cinfo[a].ci_dev; | | 1282 | tmp_ci_dev = raidPtr->raid_cinfo[a].ci_dev; |
1283 | raidPtr->raid_cinfo[a].ci_dev = raidPtr->raid_cinfo[b].ci_dev; | | 1283 | raidPtr->raid_cinfo[a].ci_dev = raidPtr->raid_cinfo[b].ci_dev; |
1284 | raidPtr->raid_cinfo[b].ci_dev = tmp_ci_dev; | | 1284 | raidPtr->raid_cinfo[b].ci_dev = tmp_ci_dev; |
1285 | | | 1285 | |
1286 | /* the dev itself */ | | 1286 | /* the dev itself */ |
1287 | tmp_dev = raidPtr->Disks[a].dev; | | 1287 | tmp_dev = raidPtr->Disks[a].dev; |