⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rf_driver.c

📁 RAIDFrame是个非常好的磁盘阵列RAID仿真工具
💻 C
📖 第 1 页 / 共 4 页
字号:
/* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. * * Author: Mark Holland, Khalil Amiri, Claudson Bornstein, William V. Courtright II, *         Robby Findler, Daniel Stodolsky, Rachad Youssef, Jim Zelenka * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU *  School of Computer Science *  Carnegie Mellon University *  Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. *//****************************************************************************** * * rf_driver.c -- main setup, teardown, and access routines for the RAID driver * * all routines are prefixed with rf_ (raidframe), to avoid conficts. * ******************************************************************************//* * $Locker:  $ * $Log: rf_driver.c,v $ * Revision 1.147  1996/08/21  04:12:46  jimz * added hook for starting out req_hist w/ more distributed values * (currently not done) * * Revision 1.146  1996/07/29  14:05:12  jimz * fix numPUs/numRUs confusion (everything is now numRUs) * clean up some commenting, return values * * Revision 1.145  1996/07/28  20:31:39  jimz * i386netbsd port * true/false fixup * * Revision 1.144  1996/07/27  18:40:24  jimz * cleanup sweep * * Revision 1.143  1996/07/22  21:11:53  jimz * fix formatting on DoAccess error msg * * Revision 1.142  1996/07/19  16:10:06  jimz * added call to rf_ResetDebugOptions() in rf_ConfigureDebug() * * Revision 1.141  1996/07/18  22:57:14  jimz * port simulator to AIX * * Revision 1.140  1996/07/17  21:00:58  jimz * clean up timer interface, tracing * * Revision 1.139  1996/07/15  05:40:41  jimz * some recon datastructure cleanup * better handling of multiple failures * added undocumented double-recon test * * Revision 1.138  1996/07/11  19:08:00  jimz * generalize reconstruction mechanism * allow raid1 reconstructs via copyback (done with array * quiesced, not online, therefore not disk-directed) * * Revision 1.137  1996/07/10  22:28:00  jimz * get rid of obsolete row statuses (dead,degraded2) * * Revision 1.136  1996/06/17  14:38:33  jimz * properly #if out RF_DEMO code * fix bug in MakeConfig that was causing weird behavior * in configuration routines (config was not zeroed at start) * clean up genplot handling of stacks * * Revision 1.135  1996/06/17  03:20:32  jimz * move out raidframe_attr_default * don't monkey with stack sizes * * Revision 1.134  1996/06/14  23:15:38  jimz * attempt to deal with thread GC problem * * Revision 1.133  1996/06/14  21:24:08  jimz * new ConfigureEtimer init * moved out timer vars * * Revision 1.132  1996/06/14  16:19:03  jimz * remove include of pdllib.h (beginning of PDL cleanup) * * Revision 1.131  1996/06/14  14:35:24  jimz * clean up dfstrace protection * * Revision 1.130  1996/06/14  14:16:09  jimz * engine config is now array-specific * * Revision 1.129  1996/06/13  19:08:10  jimz * add debug var to force keep_acc_totals on * * Revision 1.128  1996/06/11  10:57:08  jimz * init recon_done_proc_mutex * * Revision 1.127  1996/06/10  14:18:58  jimz * move user, throughput stats into per-array structure * * Revision 1.126  1996/06/10  11:55:47  jimz * Straightened out some per-array/not-per-array distinctions, fixed * a couple bugs related to confusion. Added shutdown lists. Removed * layout shutdown function (now subsumed by shutdown lists). * * Revision 1.125  1996/06/09  02:36:46  jimz * lots of little crufty cleanup- fixup whitespace * issues, comment #ifdefs, improve typing in some * places (esp size-related) * * Revision 1.124  1996/06/07  21:33:04  jimz * begin using consistent types for sector numbers, * stripe numbers, row+col numbers, recon unit numbers * * Revision 1.123  1996/06/05  19:38:32  jimz * fixed up disk queueing types config * added sstf disk queueing * fixed exit bug on diskthreads (ref-ing bad mem) * * Revision 1.122  1996/06/05  18:06:02  jimz * Major code cleanup. The Great Renaming is now done. * Better modularity. Better typing. Fixed a bunch of * synchronization bugs. Made a lot of global stuff * per-desc or per-array. Removed dead code. * * Revision 1.121  1996/06/03  23:28:26  jimz * more bugfixes * check in tree to sync for IPDS runs with current bugfixes * there still may be a problem with threads in the script test * getting I/Os stuck- not trivially reproducible (runs ~50 times * in a row without getting stuck) * * Revision 1.120  1996/06/02  17:31:48  jimz * Moved a lot of global stuff into array structure, where it belongs. * Fixed up paritylogging, pss modules in this manner. Some general * code cleanup. Removed lots of dead code, some dead files. * * Revision 1.119  1996/05/31  22:26:54  jimz * fix a lot of mapping problems, memory allocation problems * found some weird lock issues, fixed 'em * more code cleanup * * Revision 1.118  1996/05/30  23:22:16  jimz * bugfixes of serialization, timing problems * more cleanup * * Revision 1.117  1996/05/30  16:28:33  jimz * typo in rf_SignalQuiescenceLock() fixed * * Revision 1.116  1996/05/30  12:59:18  jimz * make etimer happier, more portable * * Revision 1.115  1996/05/30  11:29:41  jimz * Numerous bug fixes. Stripe lock release code disagreed with the taking code * about when stripes should be locked (I made it consistent: no parity, no lock) * There was a lot of extra serialization of I/Os which I've removed- a lot of * it was to calculate values for the cache code, which is no longer with us. * More types, function, macro cleanup. Added code to properly quiesce the array * on shutdown. Made a lot of stuff array-specific which was (bogusly) general * before. Fixed memory allocation, freeing bugs. * * Revision 1.114  1996/05/27  18:56:37  jimz * more code cleanup * better typing * compiles in all 3 environments * * Revision 1.113  1996/05/24  22:17:04  jimz * continue code + namespace cleanup * typed a bunch of flags * * Revision 1.112  1996/05/24  04:28:55  jimz * release cleanup ckpt * * Revision 1.111  1996/05/24  01:59:45  jimz * another checkpoint in code cleanup for release * time to sync kernel tree * * Revision 1.110  1996/05/23  21:46:35  jimz * checkpoint in code cleanup (release prep) * lots of types, function names have been fixed * * Revision 1.109  1996/05/23  00:39:56  jimz * demoMode -> rf_demoMode * * Revision 1.108  1996/05/23  00:33:23  jimz * code cleanup: move all debug decls to rf_options.c, all extern * debug decls to rf_options.h, all debug vars preceded by rf_ * * Revision 1.107  1996/05/21  14:30:04  jimz * idler_desc_mutex should be ifndef SIMULATE * * Revision 1.106  1996/05/20  19:31:12  jimz * add atomic debug (mutex and cond leak finder) stuff * * Revision 1.105  1996/05/20  16:12:45  jimz * switch to rf_{mutex,cond}_{init,destroy} * * Revision 1.104  1996/05/18  20:09:41  jimz * bit of cleanup to compile cleanly in kernel, once again * * Revision 1.103  1996/05/18  19:51:34  jimz * major code cleanup- fix syntax, make some types consistent, * add prototypes, clean out dead code, et cetera * * Revision 1.102  1996/05/16  21:20:51  jimz * use FREELIST stuff to manage access descriptors * * Revision 1.101  1996/05/16  14:21:10  jimz * remove bogus copies from write path on user * * Revision 1.100  1996/05/15  22:33:54  jimz * appropriately #ifdef cache stuff * * Revision 1.99  1996/05/08  21:34:41  jimz * #if 0 ShutdownCache() and ConfigureCache() * * Revision 1.98  1996/05/08  21:01:24  jimz * fixed up enum type names that were conflicting with other * enums and function names (ie, "panic") * future naming trends will be towards RF_ and rf_ for * everything raidframe-related * * Revision 1.97  1996/05/07  19:02:58  wvcii * corrected header comment of rf_DoAccess() * reordered free of desc in FreeRaidAccDesc()  The desc is now * freed last. * * Revision 1.96  1996/05/07  17:40:50  jimz * add doDebug * * Revision 1.95  1996/05/06  21:35:23  jimz * fixed ordering of cleanup and removed extra decrement of configureCount * * Revision 1.94  1996/05/06  18:44:14  jimz * reorder cleanup to not blow alloclist out from under various modules * zero raidPtr contents on config * * Revision 1.93  1996/05/04  17:06:53  jimz * Fail the I/O with ENOSPC if reading past end of the array in the kernel. * * Revision 1.92  1996/05/03  19:44:22  wvcii * debug vars degDagDebug and enableAtomicRMW now defined * in this file. * * Revision 1.91  1995/12/12  18:10:06  jimz * MIN -> RF_MIN, MAX -> RF_MAX, ASSERT -> RF_ASSERT * fix 80-column brain damage in comments * * Revision 1.90  1995/12/08  15:07:03  arw * cache code cleanup * * Revision 1.89  1995/12/06  20:53:58  wvcii * created debug var forceParityLogReint * this variable forces reintegration of all parity logs at shutdown * * Revision 1.88  1995/12/01  15:59:10  root * added copyright info * * Revision 1.87  1995/11/28  21:34:02  amiri * modified SetReconfiguredMode so that it installs the * spare table only if arch is declustered based on block designs * * Revision 1.86  1995/11/21  23:06:11  amiri * added division by zero check in printing * throughput stats. * * Revision 1.85  1995/11/19  16:27:25  wvcii * disableParityVerify now defined locally, only read from config * file for !KERNEL compiles * * Revision 1.84  1995/11/17  15:08:31  wvcii * added debug var disableParityVerify * used in RealLoopTest to disable parity verification * * Revision 1.83  1995/11/07  15:48:43  wvcii * deleted debug vars: suppressAtomicRMW, enableRollAway, concatDagDebug * deleted debug vars: debugSelectUnit, debugSelectBlock * added debug var: enableAtomicRMW * * Revision 1.82  1995/10/18  19:28:45  amiri * added support for reconstruction demos in the * simulator, by updating some simulator * variables in Faildisk. * * Revision 1.81  1995/10/09  18:36:33  jimz * move rf_StopThroughputStats() into FreeAccDesc() * changed throughput output print format * added user-level copy to write path to emulate kernel hack * * Revision 1.80  1995/10/09  18:07:47  wvcii * moved call to rf_StopThroughputStats to rf_states.c * * Revision 1.79  1995/10/09  17:38:53  jimz * quiesce an array for user-level testing before shutting it down * (should this also be done in the kernel?) * * Revision 1.78  1995/10/09  15:35:43  wvcii * added code to measure throughput in user mode * * Revision 1.77  1995/10/05  06:18:59  jimz * Changed DDEventRequest() to take additional arg, used by simulator * to cache diskid so queue length can be decremented on io complete * (this is a hack to get around the fact that the event mechanism * assumes it can dereference arbitrary handles on enqueued events) * * Revision 1.76  1995/10/04  07:25:10  jimz * turn off bigstacks by default * * Revision 1.75  1995/10/04  07:24:34  jimz * code for bigstacks in user process * * Revision 1.74  1995/09/26  21:42:51  wvcii * removed calls to ConfigureCache, ShutdownCache when building kernel * kernel currently does not support any cached architectures * * Revision 1.73  1995/09/20  21:05:35  jimz * add missing unit arg to IO_BUF_ERR() in non-kernel case * * Revision 1.72  1995/09/19  23:02:44  jimz * call RF_DKU_END_IO in the appropriate places * * Revision 1.71  1995/09/07  19:02:31  jimz * mods to get raidframe to compile and link * in kernel environment * * Revision 1.70  1995/09/06  19:24:01  wvcii * added debug vars enableRollAway and debugRecovery * * Revision 1.69  1995/08/24  19:25:36  rachad * Fixes to LSS GC in the simulater * * Revision 1.68  1995/07/28  21:43:42  robby * checkin after leaving for Rice. Bye * * Revision 1.67  1995/07/26  18:06:52  cfb * *** empty log message *** * * Revision 1.66  1995/07/26  03:25:24  robby * fixed accesses mutex and updated call to ConfigureCache * * Revision 1.65  1995/07/25  14:36:52  rachad * *** empty log message *** * * Revision 1.64  1995/07/21  19:29:05  robby * added total_accesses * * Revision 1.63  1995/07/20  19:43:35  cfb * *** empty log message *** * * Revision 1.62  1995/07/20  16:10:24  rachad * *** empty log message *** * * Revision 1.61  1995/07/20  03:36:53  rachad * Added suport for cache warming * * Revision 1.60  1995/07/17  22:31:31  cfb * *** empty log message *** * * Revision 1.59  1995/07/16  17:02:23  cfb * *** empty log message *** * * Revision 1.58  1995/07/16  15:19:27  cfb * *** empty log message *** * * Revision 1.57  1995/07/16  03:17:01  cfb * *** empty log message *** * * Revision 1.56  1995/07/13  16:11:59  cfb * *** empty log message *** * * Revision 1.55  1995/07/13  15:42:40  cfb * added cacheDebug variable ... * * Revision 1.54  1995/07/13  14:28:27  rachad * *** empty log message *** * * Revision 1.53  1995/07/10  21:48:52  robby * added virtualStripingWarnings * * Revision 1.52  1995/07/10  20:41:13  rachad * *** empty log message *** * * Revision 1.51  1995/07/09  19:46:49  cfb * Added cache Shutdown * * Revision 1.50  1995/07/08  21:38:53  rachad * Added support for interactive traces * in the simulator * * Revision 1.49  1995/07/08  18:05:39  rachad * Linked up Claudsons code with the real cache * * Revision 1.48  1995/07/07  16:00:22  cfb * Added initialization of cacheDesc to AllocRaidAccDesc * * Revision 1.47  1995/07/06  14:22:37  rachad * Merge complete *

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -