亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rrc_raid0.c

?? create raid tool at linux
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * RAID-0 driver code for the raidreconf utility * (C) 1999,2000 by Jakob Oestergaard * * This source is covered by the GNU GPL, the same as all Linux kernel * sources. */#include "raidreconf.h"#include "rrc_common.h"typedef struct rrc_zone_t {	unsigned long tchunks;	/* total size of zone */	unsigned long ndisks;	rrc_disk_t **disks;	unsigned long *disk_nrs;	/* mapping of zone disk # into real (zone[0]) disk # */} rrc_zone_t;typedef struct raid0_driver_priv {	rrc_zone_t *zones;	rrc_disk_t *disks;	int n_zones;	unsigned long tot_chunks;	unsigned long blocks_per_chunk;	/* state for the current non-source sink-disk we're wishing for blocks to (pass 1) */	int cur_disk;		/* initialized to -1,  if it's equal to zones[0].ndisks then we're in pass 2 */	unsigned long *dsk_total_blocks;	unsigned long *dsk_blocks_done;} raid0_driver_priv;static const char *raid0_initialize (void *, md_cfg_entry_t *,				     rrc_disk_t *, unsigned long *);static driver_status_t raid0_request_blocks (void *);static const char *raid0_update_super (void *);static const char *raid0_map_global_to_local (void *, unsigned long, int *,					      unsigned long *);static unsigned long raid0_map_local_to_global (void *, int,						unsigned long);static void raid0_free_blocks_above_gblock (void *, unsigned long);static void raid0_unfree_all_blocks (void *);static intcalc_raid_zones (rrc_disk_t * disks, int ndisks, rrc_zone_t ** zones,		 int *nzones){	int i;	int current_zone_disk_size = 0;	unsigned long passed_dchunks = 0;	assert (ndisks);	*nzones = 0;	*zones = (rrc_zone_t *) malloc (sizeof (rrc_zone_t) * ndisks);	if (!*zones) {		fprintf (stderr, "Cannot alloc. zone table\n");		return 1;	}	/* Step thru disks */	for (i = 0; i != ndisks; i++) {		int d;		rrc_disk_t *smallest = 0;		for (d = 0; d != ndisks; d++) {			if (!smallest			    || ((disks[d].chunks < smallest->chunks)))				    if (disks[d].chunks >					current_zone_disk_size) smallest =					    &disks[d];		}		/* Smallest i null, or it holds the smallest disk which		 * can go into the new zone (eg. is larger than previous zone) */		if (smallest)			fprintf (stderr, "Smallest is: %lu chunks\n",				 smallest->chunks);		else			fprintf (stderr, "No smallest\n");		if (!smallest)			break;		current_zone_disk_size = smallest->chunks;		/* Now find all disks of this size or above */		(*zones)[*nzones].ndisks = 0;		(*zones)[*nzones].tchunks = 0;				    (*zones)[*nzones].disks =		    (rrc_disk_t **) malloc (sizeof (rrc_disk_t *) *					    ndisks);		(*zones)[*nzones].disk_nrs =		    (unsigned long *) malloc (sizeof (unsigned long) *					      ndisks);		if (!(*zones)[*nzones].disks		    && !(*zones)[*nzones].disk_nrs) {			fprintf (stderr,				 "zone->disk or zone->disk_nr array allocation failure\n");			return 1;		}		for (d = 0; d != ndisks; d++) {			if (disks[d].chunks >= smallest->chunks) {				fprintf (stderr,					 "Adding disk %i to zone %i as disk # %lu\n",					 d, *nzones,					 (*zones)[*nzones].ndisks);				(*zones)[*nzones].disks[(*zones)[*nzones].							ndisks] =				    &disks[d];				(*zones)[*nzones].				    disk_nrs[(*zones)[*nzones].ndisks] = d;				(*zones)[*nzones].ndisks++;								    (*zones)[*nzones].tchunks +=				    smallest->chunks - passed_dchunks;			}		}		fprintf (stderr, "Size of zone %i is %lu chunks.\n",			 *nzones, (*zones)[*nzones].tchunks);		(*nzones)++;		current_zone_disk_size++;		passed_dchunks = smallest->chunks;	}	return 0;}/* returns the global block number from a sink disk id and disk-block */static unsigned longraid0_map_local_to_global (void *thisp, int diskid, unsigned long dblock){	raid0_driver_priv *this = (raid0_driver_priv *) thisp;	unsigned long passed_gblocks = 0;	unsigned long passed_dblocks = 0;	unsigned long czone = 0;	while (czone < this->n_zones) {		/* Is dchunk in this zone ? */		if (this->zones[czone].tchunks * this->blocks_per_chunk /		    this->zones[czone].ndisks > dblock - passed_dblocks) {			unsigned long stripe_index;			/* Find the stripe index that yield disk as the disk number */			for (stripe_index = 0;			     stripe_index != this->zones[czone].ndisks;			     stripe_index++) {				if (this->				    disks[this->zones[czone].					  disk_nrs[						   (passed_gblocks /						    this->						    blocks_per_chunk +						    stripe_index) %						   this->zones[czone].						   ndisks]].disk_id ==				    diskid) break;			}			if (stripe_index == this->zones[czone].ndisks) {				fprintf (stderr,					 "Bummer! No stripe index yields disk id %i as destination\nWill dump core.\n",					 diskid);				abort ();			}			/* global block = passed gblocks blocks			 *  + zone disks * ((disk block - passed disk blocks) / blocks per chunk * blocks per chunk)			 *  + disk index * blocks per chunk 			 *  + (disk block - passed disk blocks) % blocks per chunk			 */			assert (dblock / this->blocks_per_chunk -				passed_dblocks / this->blocks_per_chunk ==				(dblock -				 passed_dblocks) / this->blocks_per_chunk);			return passed_gblocks + (dblock -						 passed_dblocks) /			    this->blocks_per_chunk *			    this->blocks_per_chunk *			    this->zones[czone].ndisks +			    stripe_index * this->blocks_per_chunk +			    (dblock -			     passed_dblocks) % this->blocks_per_chunk;		}		else {			/* Nope */			/*      fprintf(stderr, "Chunk %lu is not in zone %lu\n", dchunk, czone); */			passed_dblocks +=			    this->zones[czone].tchunks /			    this->zones[czone].ndisks *			    this->blocks_per_chunk;			passed_gblocks +=			    this->zones[czone].tchunks *			    this->blocks_per_chunk;			czone++;		}	}	/* BUG! */	fprintf (stderr,		 "Ouch ! block %lu on disk id %i is not in array!\nWill dump core.\n",		 dblock, diskid);	abort ();}level_driver_t *new_raid0_driver (void){	level_driver_t *drv =	    (level_driver_t *) malloc (sizeof (level_driver_t));	raid0_driver_priv *priv =	    (raid0_driver_priv *) malloc (sizeof (raid0_driver_priv));	if (!drv || !priv)		return 0;	drv->initialize = raid0_initialize;	drv->request_blocks = raid0_request_blocks;	drv->update_super = raid0_update_super;	drv->map_global_to_local = raid0_map_global_to_local;	drv->map_local_to_global = raid0_map_local_to_global;	drv->free_blocks_above_gblock = raid0_free_blocks_above_gblock;	drv->unfree_all_blocks = raid0_unfree_all_blocks;	drv->priv = priv;	priv->zones = 0;	priv->disks = 0;	priv->n_zones = 0;	priv->tot_chunks = 0;	priv->blocks_per_chunk = 0;	priv->cur_disk = -1;	priv->dsk_total_blocks = 0;	priv->dsk_blocks_done = 0;	return drv;}static const char *raid0_initialize (void *thisp, md_cfg_entry_t * cfg, rrc_disk_t * cfgdisks,		  unsigned long *blocks){	raid0_driver_priv *this = (raid0_driver_priv *) thisp;	unsigned long d;	/* Calculate zones */	if (calc_raid_zones	    (cfgdisks, cfg->array.param.nr_disks, &this->zones,	     &this->n_zones)) {		return "Zone calculation failed!";	}	this->disks = cfgdisks;	this->tot_chunks = 0;	for (d = 0; d != this->n_zones; d++)		this->tot_chunks += this->zones[d].tchunks;	this->blocks_per_chunk =	    (cfg->array.param.chunk_size / MD_BLK_SIZ) / reconf_block_size;	*blocks = this->blocks_per_chunk * this->tot_chunks;	this->dsk_total_blocks =	    (unsigned long *) malloc (sizeof (unsigned long) *				      cfg->array.param.nr_disks);	if (!this->dsk_total_blocks)		return "Cannot allocate disk blocks array";	for (d = 0; d != cfg->array.param.nr_disks; d++)		this->dsk_total_blocks[d] =		    cfgdisks[d].chunks * this->blocks_per_chunk;	this->dsk_blocks_done =	    (unsigned long *) malloc (sizeof (unsigned long) *				      cfg->array.param.nr_disks);	if (!this->dsk_blocks_done)		return "Cannot allocate disk blocks done array";	for (d = 0; d != cfg->array.param.nr_disks; d++)		this->dsk_blocks_done[d] = 0;	fprintf (stderr,		 "RAID0 Array size: %lu blocks (%lu Chunks) on %i disks\n",		 this->blocks_per_chunk * this->tot_chunks,		 this->tot_chunks, cfg->array.param.nr_disks);	return 0;}/* * This routine will fill in the wish_list with wishes for blocks it would * like to write. */static driver_status_traid0_request_blocks (void *thisp){	raid0_driver_priv *this = (raid0_driver_priv *) thisp;	/* Pass 1:	 *  Find disk not in {source}	 *    Request blocks from disk until no more wishes or disk is full	 *	 *  If no more wishes, return LDR_INCOMPLETE	 *	 * Pass 2:	 *  While more wishes && still blocks left to write	 *     For each disk in {sink}	 *        Find max. number of contigous blocks, and wish for them (until sequence done or no more wishes)	 *	 *  If no more wishes, return LDR_INCOMPLETE	 *  If there are still blocks that aren't marked free, return LDR_INCOMPLETE	 *  Otherwise return LDR_DONE	 */	/* Pass 1: */	assert (this->zones);	while (can_wish_again ()	       && this->cur_disk != this->zones[0].ndisks) {		int dsk = this->cur_disk;		/* if we have no disk, or if we just finished the one we had... */		if (this->cur_disk == -1		    || this->dsk_total_blocks[dsk] ==		    this->dsk_blocks_done[dsk]) {			/* pick next disk, don't exceed number of disks, keep picking next until we fail or reach a good one */			for (dsk++; dsk != this->zones[0].ndisks; dsk++) {				if (!is_diskid_in_source				    (this->disks[dsk].disk_id)) break;			}		}		/* if there are no more non-source disks to read from, skip to pass two */		if (dsk == this->zones[0].ndisks)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品996| 日韩国产一二三区| www.日韩在线| 国产精品福利一区| 色综合久久88色综合天天免费| 国产精品久久久久桃色tv| 91一区在线观看| 亚洲综合清纯丝袜自拍| 欧美日韩国产小视频在线观看| 日韩精品亚洲专区| 久久综合999| 91丨porny丨国产| 亚洲国产va精品久久久不卡综合| 欧美高清性hdvideosex| 精品中文av资源站在线观看| 国产日产欧美一区二区视频| 色呦呦日韩精品| 麻豆中文一区二区| 欧美国产综合色视频| 91麻豆精品秘密| 婷婷综合另类小说色区| 久久久久久久久久久久久夜| 成人av电影在线观看| 舔着乳尖日韩一区| 国产亚洲欧美一级| 欧美日韩综合色| 久久99国产精品久久99果冻传媒| 中文字幕亚洲区| 久久人人97超碰com| 成人激情免费电影网址| 丝袜美腿一区二区三区| 亚洲国产成人午夜在线一区| 欧美日韩国产一二三| 国产aⅴ综合色| 香港成人在线视频| 国产精品免费视频网站| 欧美剧情片在线观看| 国产69精品久久777的优势| 视频一区在线视频| 亚洲人精品一区| 久久久久国产免费免费| 欧美日韩国产一级二级| av不卡在线观看| 国产美女视频91| 秋霞电影一区二区| 亚洲午夜久久久久久久久久久| 国产欧美日韩在线看| 欧美一区二区三区思思人| 91亚洲国产成人精品一区二区三| 久久se这里有精品| 亚洲mv在线观看| 自拍偷拍亚洲激情| 国产午夜亚洲精品不卡| 制服.丝袜.亚洲.中文.综合| 91社区在线播放| 国产成人av在线影院| 麻豆精品新av中文字幕| 偷拍一区二区三区| 亚洲最新在线观看| 亚洲精品国产视频| 自拍偷拍亚洲激情| 日韩一区在线免费观看| 欧美国产欧美综合| 久久午夜色播影院免费高清| 日韩一区二区三区高清免费看看| 欧美日韩免费高清一区色橹橹 | av在线不卡免费看| 国产精品一级二级三级| 婷婷开心激情综合| 天天综合网 天天综合色| 亚洲综合在线电影| 亚洲精品菠萝久久久久久久| 亚洲品质自拍视频网站| 亚洲人成网站在线| 亚洲精选一二三| 夜夜操天天操亚洲| 亚洲最新视频在线观看| 亚洲国产精品久久不卡毛片 | 亚洲图片欧美激情| 国产精品福利av| 亚洲精品久久久蜜桃| 亚洲三级在线看| 亚洲激情自拍偷拍| 午夜视黄欧洲亚洲| 免费成人结看片| 国产精品一区免费在线观看| 国产一区二区91| 99久久久久久99| 欧美性色综合网| 欧美一区二区三区免费在线看| 精品国产伦一区二区三区免费| 精品福利视频一区二区三区| 国产日韩欧美一区二区三区乱码 | 色婷婷一区二区| 欧美日韩国产123区| 91精品国产91综合久久蜜臀| 精品成人佐山爱一区二区| 精品成人在线观看| 国产精品白丝在线| 天堂精品中文字幕在线| 国内一区二区视频| www.亚洲激情.com| 欧美裸体一区二区三区| 精品成人a区在线观看| 国产精品麻豆一区二区| 亚洲成人在线网站| 国模套图日韩精品一区二区| 成人av在线看| 91精品国产综合久久久蜜臀粉嫩| 2017欧美狠狠色| 一片黄亚洲嫩模| 久久精品理论片| 一本久久综合亚洲鲁鲁五月天| 欧美一卡二卡三卡| 中文字幕在线观看一区二区| 香蕉加勒比综合久久| 国产成人h网站| 欧美日韩高清不卡| 欧美激情在线一区二区| 日日欢夜夜爽一区| 成人av午夜电影| 欧美一区二区三区喷汁尤物| 成人免费在线视频观看| 免费观看日韩电影| 91高清视频免费看| 久久久久亚洲蜜桃| 日韩高清不卡在线| 色综合天天性综合| 久久一留热品黄| 日韩中文字幕一区二区三区| 97久久精品人人爽人人爽蜜臀| 日韩欧美一区二区免费| 亚洲男人的天堂在线观看| 国产主播一区二区| 欧美精品在欧美一区二区少妇| 亚洲精品美腿丝袜| 国产·精品毛片| 亚洲精品在线观| 日韩精品国产欧美| 91国偷自产一区二区三区成为亚洲经典 | 久久精品国产99久久6| 91黄色小视频| 国产精品久久久久久久久免费丝袜 | 中文字幕一区二区不卡| 精彩视频一区二区三区| 6080yy午夜一二三区久久| 亚洲欧美另类图片小说| 成人中文字幕电影| 日韩色视频在线观看| 日韩国产欧美三级| 在线观看www91| 亚洲六月丁香色婷婷综合久久| 国产很黄免费观看久久| 26uuu色噜噜精品一区二区| 日本色综合中文字幕| 欧美人xxxx| 一区二区三区国产精华| 色妹子一区二区| 亚洲男同1069视频| 91色|porny| 亚洲精品中文字幕在线观看| 99视频超级精品| 亚洲女与黑人做爰| 色综合久久天天综合网| 亚洲欧美日韩一区二区三区在线观看| 成人午夜电影小说| 一区在线观看视频| aaa国产一区| 亚洲男同性恋视频| 在线看国产一区二区| 亚洲精品高清在线观看| 在线免费观看日本欧美| 亚洲一二三区不卡| 欧美三级在线看| 日韩国产欧美三级| 日韩精品中文字幕在线一区| 美女脱光内衣内裤视频久久影院| 日韩三级视频在线看| 国产在线麻豆精品观看| 国产色91在线| 99综合电影在线视频| 亚洲欧美区自拍先锋| 欧美亚洲高清一区| 日本不卡不码高清免费观看| 日韩精品一区二区三区老鸭窝 | 在线观看亚洲a| 三级一区在线视频先锋| 欧美成人乱码一区二区三区| 激情图片小说一区| 国产精品天干天干在线综合| 91女厕偷拍女厕偷拍高清| 亚洲国产一区二区视频| 欧美一卡二卡在线观看| 国产乱理伦片在线观看夜一区| 国产精品久久久久久久岛一牛影视 | 欧美蜜桃一区二区三区| 精品制服美女久久| 日韩伦理免费电影| 3d动漫精品啪啪一区二区竹菊| 国产激情视频一区二区在线观看|