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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ldm.c

?? linux和2410結(jié)合開發(fā) 用他可以生成2410所需的zImage文件
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
	if (err != 1)		printk(LDM_CRIT "First and third TOCBLOCKs don't match.\n");	else		ldm_debug("Validated TOCBLOCKs successfully.\n");out:	kfree(toc2);	kfree(toc3);	kfree(toc4);	return err;no_mem:	printk(LDM_CRIT "Not enough memory to allocate required buffers.\n");err_out:	err = -1;	goto out;}/** * compare_privheads - compare two privheads * @ph1:	first privhead * @ph2:	second privhead * * This compares the two privheads @ph1 and @ph2. * * Return 1 if @ph1 and @ph2 are equal and -1 otherwise. */static int compare_privheads(const struct privhead *ph1,		const struct privhead *ph2){	if ((ph1->ver_major == ph2->ver_major)			 &&	    (ph1->ver_minor == ph2->ver_minor)			 &&	    (ph1->logical_disk_start == ph2->logical_disk_start) &&	    (ph1->logical_disk_size  == ph2->logical_disk_size)	 &&	    (ph1->config_start == ph2->config_start)		 &&	    (ph1->config_size  == ph2->config_size)		 &&	    !strncmp(ph1->disk_id, ph2->disk_id, sizeof(ph1->disk_id)))		return 1;	return -1;}/** * validate_privheads - compare the privhead backups to the first one * @dev:	partition device holding the LDM database * @ph1:	first privhead which we have already validated before * * We already have one privhead from the beginning of the disk. * Now we compare the two other copies for safety. * * Return 1 on succes and -1 on error. */static int validate_privheads(struct block_device *bdev,			      const struct privhead *ph1,			      unsigned long base){	Sector sect;	unsigned char *data;	struct privhead *ph2 = NULL, *ph3 = NULL;	int err;	ph2 = (struct privhead*)kmalloc(sizeof(*ph2), GFP_KERNEL);	if (!ph2)		goto no_mem;	ph3 = (struct privhead*)kmalloc(sizeof(*ph3), GFP_KERNEL);	if (!ph3)		goto no_mem;	data = read_dev_sector(bdev, base + OFF_PRIVHEAD2 * 2, &sect);	if (!data) {		printk(LDM_CRIT "Disk read 1 failed in validate_privheads.\n");		goto err_out;	}	err = parse_privhead(data, ph2);	put_dev_sector(sect);	if (err != 1)		goto out;	data = read_dev_sector(bdev, base + OFF_PRIVHEAD3 * 2 + 1, &sect);	if (!data) {		printk(LDM_CRIT "Disk read 2 failed in validate_privheads.\n");		goto err_out;	}	err = parse_privhead(data, ph3);	put_dev_sector(sect);	if (err != 1)		goto out;	err = compare_privheads(ph1, ph2);	if (err != 1) {		printk(LDM_CRIT "First and second PRIVHEADs don't match.\n");		goto out;	}	err = compare_privheads(ph1, ph3);	if (err != 1)		printk(LDM_CRIT "First and third PRIVHEADs don't match.\n");	else		/* We _could_ have checked more. */		ldm_debug("Validated PRIVHEADs successfully.\n");out:	kfree(ph2);	kfree(ph3);	return err;no_mem:	printk(LDM_CRIT "Not enough memory to allocate required buffers.\n");err_out:	err = -1;	goto out;}/** * create_partition - validate input and create a kernel partition device * @hd:		gendisk structure in which to create partition * @minor:	minor number for device to create * @start:	starting offset of the partition into the parent device * @size:	size of the partition * * This validates the range, then puts an entry into the kernel's partition * table. * * @start and @size are numbers of sectors. * * Return 1 on succes and -1 on error. */static int create_partition(struct gendisk *hd, const int minor,		const int start, const int size){	int disk_minor;	if (!hd->part)		return -1;	/*	 * Get the minor number of the parent device so we can check we don't	 * go beyond the end of the device.	 */	disk_minor = (minor >> hd->minor_shift) << hd->minor_shift;	if ((start < 1) || ((start + size) > hd->part[disk_minor].nr_sects)) {		printk(LDM_CRIT "LDM Partition exceeds physical disk. "				"Aborting.\n");		return -1;	}	add_gd_partition(hd, minor, start, size);	ldm_debug("Created partition successfully.\n");	return 1;}/** * parse_privhead - parse the LDM database PRIVHEAD structure * @buffer:	LDM database privhead structure loaded from the device * @ph:		in memory privhead structure to return parsed information in * * This parses the LDM database PRIVHEAD structure supplied in @buffer and * sets up the in memory privhead structure @ph with the obtained information. * * Return 1 on succes and -1 on error, in which case @ph is undefined. */static int parse_privhead(const u8 *buffer, struct privhead *ph){	if (MAGIC_PRIVHEAD != BE64(buffer)) {		printk(LDM_ERR "Cannot find PRIVHEAD structure. LDM database "				"is corrupt. Aborting.\n");		return -1;	}	ph->ver_major = BE16(buffer + 0x000C);	ph->ver_minor = BE16(buffer + 0x000E);	if ((ph->ver_major != 2) || (ph->ver_minor != 11)) {		printk(LDM_ERR "Expected PRIVHEAD version %d.%d, got %d.%d. "				"Aborting.\n", 2, 11, ph->ver_major,				ph->ver_minor);		return -1;	}	ph->config_start = BE64(buffer + 0x012B);	ph->config_size  = BE64(buffer + 0x0133);	if (ph->config_size != LDM_DB_SIZE) {	/* 1 MiB in sectors. */		printk(LDM_ERR "Database should be %u bytes, claims to be %Lu "				"bytes. Aborting.\n", LDM_DB_SIZE,				ph->config_size);		return -1;	}	ph->logical_disk_start = BE64(buffer + 0x011B);	ph->logical_disk_size  = BE64(buffer + 0x0123);	if (!ph->logical_disk_size ||	    ph->logical_disk_start + ph->logical_disk_size > ph->config_start)		return -1;	memcpy(ph->disk_id, buffer + 0x0030, sizeof(ph->disk_id));	ldm_debug("Parsed PRIVHEAD successfully.\n");	return 1;}/** * create_db_partition - create a dedicated partition for our database * @hd:		gendisk structure in which to create partition * @dev:	device of which to create partition * @ph:		@dev's LDM database private header * * Find the primary private header, locate the LDM database, then create a * partition to wrap it. * * Return 1 on succes, 0 if device is not a dynamic disk and -1 on error. */static int create_db_partition(struct gendisk *hd, struct block_device *bdev,		const unsigned long first_sector, const int first_part_minor,		struct privhead *ph){	Sector sect;	unsigned char *data;	int err;	data = read_dev_sector(bdev, OFF_PRIVHEAD1*2, &sect);	if (!data) {		printk(LDM_CRIT __FUNCTION__ "(): Device read failed.\n");		return -1;	}	if (BE64(data) != MAGIC_PRIVHEAD) {		ldm_debug("Cannot find PRIVHEAD structure. Not a dynamic disk "				"or corrupt LDM database.\n");		return 0;	}	err = parse_privhead(data, ph);	if (err == 1)		err = create_partition(hd, first_part_minor, first_sector +				ph->config_start, ph->config_size);	put_dev_sector(sect);	return err;}/** * validate_patition_table - check whether @dev is a dynamic disk * @dev:	device to test * * Check whether @dev is a dynamic disk by looking for an MS-DOS-style partition * table with one or more entries of type 0x42 (the former Secure File System * (Landis) partition type, now recycled by Microsoft for dynamic disks) in it. * If this succeeds we assume we have a dynamic disk, and not otherwise. * * Return 1 if @dev is a dynamic disk, 0 if not and -1 on error. */static int validate_partition_table(struct block_device *bdev){	Sector sect;	unsigned char *data;	struct partition *p;	int i, nr_sfs;	data = read_dev_sector(bdev, 0, &sect);	if (!data)		return -1;	if (*(u16*)(data + 0x01FE) != cpu_to_le16(MSDOS_LABEL_MAGIC)) {		ldm_debug("No MS-DOS partition found.\n");		goto no_msdos_partition;	}	nr_sfs = 0;	p = (struct partition*)(data + 0x01BE);	for (i = 0; i < 4; i++) {		if (!SYS_IND(p+i) || SYS_IND(p+i) == WIN2K_EXTENDED_PARTITION)			continue;		if (SYS_IND(p+i) == WIN2K_DYNAMIC_PARTITION) {			nr_sfs++;			continue;		}		goto not_dynamic_disk;	}	if (!nr_sfs)		goto not_dynamic_disk;	ldm_debug("Parsed partition table successfully.\n");	put_dev_sector(sect);	return 1;not_dynamic_disk://	ldm_debug("Found basic MS-DOS partition, not a dynamic disk.\n");no_msdos_partition:	put_dev_sector(sect);	return 0;}/** * ldm_partition - find out whether a device is a dynamic disk and handle it * @hd:			gendisk structure in which to return the handled disk * @dev:		device we need to look at * @first_sector:	first sector within the device * @first_part_minor:	first minor number of partitions for the device * * Description: * * This determines whether the device @dev is a dynamic disk and if so creates * the partitions necessary in the gendisk structure pointed to by @hd. * * We create a dummy device 1, which contains the LDM database, we skip * devices 2-4 and then create each partition described by the LDM database * in sequence as devices 5 and following. For example, if the device is hda, * we would have: hda1: LDM database, hda2-4: nothing, hda5-following: the * actual data containing partitions. * * Return values: * *	 1 if @dev is a dynamic disk and we handled it, *	 0 if @dev is not a dynamic disk, *	-1 if an error occured. */int ldm_partition(struct gendisk *hd, struct block_device *bdev,		unsigned long first_sector, int first_part_minor){	struct privhead *ph  = NULL;	struct tocblock *toc = NULL;	struct vmdb     *vm  = NULL;	struct ldmdisk  *dk  = NULL;	unsigned long db_first;	int err;	if (!hd)		return 0;	/* Check the partition table. */	err = validate_partition_table(bdev);	if (err != 1)		return err;	if (!(ph = (struct privhead*)kmalloc(sizeof(*ph), GFP_KERNEL)))		goto no_mem;	/* Create the LDM database device. */	err = create_db_partition(hd, bdev, first_sector, first_part_minor, ph);	if (err != 1)		goto out;	db_first = hd->part[first_part_minor].start_sect;	/* Check the backup privheads. */	err = validate_privheads(bdev, ph, db_first);	if (err != 1)		goto out;	/* Check the table of contents and its backups. */	if (!(toc = (struct tocblock*)kmalloc(sizeof(*toc), GFP_KERNEL)))		goto no_mem;	err = validate_tocblocks(bdev, toc, db_first);	if (err != 1)		goto out;	/* Check the vmdb. */	if (!(vm = (struct vmdb*)kmalloc(sizeof(*vm), GFP_KERNEL)))		goto no_mem;	err = validate_vmdb(bdev, vm, db_first);	if (err != 1)		goto out;	/* Find the object id for @dev in the LDM database. */	if (!(dk = (struct ldmdisk*)kmalloc(sizeof(*dk), GFP_KERNEL)))		goto no_mem;	err = get_disk_objid(bdev, vm, ph, dk, db_first);	if (err != 1)		goto out;	/* Finally, create the data partition devices. */	err = create_data_partitions(hd, first_sector, first_part_minor +			LDM_FIRST_PART_OFFSET, bdev, vm, ph, dk, db_first);	if (err == 1)		ldm_debug("Parsed LDM database successfully.\n");out:	kfree(ph);	kfree(toc);	kfree(vm);	kfree(dk);	return err;no_mem:	printk(LDM_CRIT "Not enough memory to allocate required buffers.\n");	err = -1;	goto out;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品理论电影在线| 日本最新不卡在线| 国产精品美女久久久久久久| 精品免费国产一区二区三区四区| 日韩欧美成人午夜| 日韩精品一区二区三区swag| 欧美岛国在线观看| 久久综合色婷婷| 久久久精品国产99久久精品芒果| 精品国产网站在线观看| 久久综合色鬼综合色| 国产亚洲欧美日韩俺去了| 久久综合九色综合97婷婷 | 久久精品人人做人人爽人人| 久久亚洲春色中文字幕久久久| 日韩精品一区二区三区视频在线观看| 欧美mv日韩mv亚洲| 国产亚洲一区字幕| 中文欧美字幕免费| 一区二区在线观看免费视频播放| 亚洲电影第三页| 免费在线观看精品| 国产99久久久国产精品潘金| av男人天堂一区| 欧美人体做爰大胆视频| 精品少妇一区二区三区在线播放 | 欧美电视剧在线看免费| 久久久精品免费网站| 亚洲三级小视频| 亚洲r级在线视频| 韩国三级在线一区| 成人avav在线| 3d成人h动漫网站入口| 精品国产成人系列| 亚洲视频一区二区免费在线观看| 亚洲一区二区不卡免费| 另类小说欧美激情| 99国产精品99久久久久久| 欧美最猛性xxxxx直播| 欧美一级二级三级蜜桃| 国产精品免费久久| 一级女性全黄久久生活片免费| 蜜臀av国产精品久久久久| 国产999精品久久久久久| 欧美视频在线一区二区三区 | 91精品福利在线一区二区三区| 久久综合色一综合色88| 亚洲欧美色图小说| 久久精品国产99久久6| 不卡一区二区三区四区| 欧美美女视频在线观看| 久久久亚洲精华液精华液精华液| 亚洲乱码中文字幕| 精品一二三四区| 欧美天堂一区二区三区| 国产欧美一区二区精品忘忧草| 亚洲一区中文日韩| 国产成人免费在线| 8x8x8国产精品| 综合av第一页| 国产一区二区女| 欧美欧美欧美欧美首页| 中文字幕不卡在线| 精品制服美女久久| 欧美性极品少妇| 国产精品久久久久久福利一牛影视| 午夜电影一区二区三区| 色综合久久综合中文综合网| 久久这里只精品最新地址| 天天综合天天综合色| 91视频观看免费| 国产人妖乱国产精品人妖| 天天综合日日夜夜精品| 一本色道久久综合亚洲aⅴ蜜桃 | 亚洲自拍偷拍麻豆| 成人18视频在线播放| 久久久久久麻豆| 蜜桃一区二区三区四区| 欧美无乱码久久久免费午夜一区| 国产精品第四页| 国产一区二区三区视频在线播放| 欧美另类videos死尸| 亚洲男人的天堂一区二区 | 欧美精品一区二区三区蜜臀| 日韩影院精彩在线| 91最新地址在线播放| 国产喂奶挤奶一区二区三区| 久久精品国产**网站演员| 91极品视觉盛宴| 亚洲精品成人少妇| 99久久99久久免费精品蜜臀| 国产精品你懂的在线| 国产在线精品国自产拍免费| 日韩美一区二区三区| 日日夜夜精品视频天天综合网| 在线观看国产日韩| 亚洲免费av观看| 一本大道综合伊人精品热热| 亚洲免费观看高清完整版在线| av中文字幕亚洲| 日韩毛片一二三区| 99久久精品国产毛片| 亚洲日本在线a| 91麻豆文化传媒在线观看| 日韩理论在线观看| 一本大道av伊人久久综合| 亚洲男人的天堂av| 欧美午夜视频网站| 日韩精品色哟哟| 日韩精品一区二区三区老鸭窝| 久久电影网站中文字幕| 精品国产sm最大网站免费看| 国产综合成人久久大片91| 久久久国产精品午夜一区ai换脸| 国产一区福利在线| 欧美极品美女视频| 99精品黄色片免费大全| 亚洲美女免费视频| 欧美性生活影院| 日本不卡一二三区黄网| 欧美精品一区二区三区一线天视频| 国产一区二区三区免费| 国产精品理伦片| 91成人免费在线视频| 日韩主播视频在线| 精品久久久久一区二区国产| 国产黄色成人av| 亚洲丝袜制服诱惑| 欧美精品第1页| 国产一区二区三区香蕉| 亚洲天堂a在线| 7777精品伊人久久久大香线蕉最新版 | 久久精品欧美一区二区三区麻豆| eeuss鲁片一区二区三区在线看| 亚洲精品美腿丝袜| 在线播放日韩导航| 国产精品一二三四| 亚洲人妖av一区二区| 欧美高清视频一二三区 | 91麻豆精品国产91久久久| 国产一区二区三区在线观看精品 | 中文字幕不卡的av| 欧美日韩国产123区| 狠狠色丁香婷综合久久| 中文字幕一区二区三区不卡在线 | 中文字幕中文字幕一区| 欧美性色欧美a在线播放| 精品一区二区三区的国产在线播放| 国产日韩欧美不卡| 欧美日韩一区中文字幕| 国产99久久久国产精品潘金| 亚洲成av人片| 国产日产欧产精品推荐色| 欧美人妇做爰xxxⅹ性高电影| 国产麻豆精品久久一二三| 亚洲国产裸拍裸体视频在线观看乱了 | 成人在线视频一区二区| 丝袜诱惑亚洲看片| 国产精品国产三级国产有无不卡 | 久久久国产精品午夜一区ai换脸| 91久久免费观看| 国产成人亚洲精品狼色在线| 亚洲高清免费在线| 中文字幕 久热精品 视频在线| 欧美日韩国产高清一区二区三区| 成人伦理片在线| 久久国产剧场电影| 亚洲成人777| 国产精品国产三级国产| 日韩美女视频一区二区在线观看| 一本在线高清不卡dvd| 激情综合一区二区三区| 日韩影院在线观看| 一区二区三区在线不卡| 日本一区二区三区dvd视频在线| 91精品国产综合久久精品麻豆| 91在线视频在线| 成人性视频免费网站| 久久国产精品色| 亚洲超碰精品一区二区| 一级女性全黄久久生活片免费| 国产精品亲子伦对白| 26uuu久久综合| 日韩欧美亚洲一区二区| 欧美日韩国产综合一区二区三区| 91一区二区在线观看| 成人一区在线观看| 国产精一区二区三区| 美女诱惑一区二区| 午夜精品久久久久久久久| 一区二区在线观看视频| 亚洲欧美乱综合| 亚洲男人天堂av网| 亚洲人成在线观看一区二区| 中文字幕欧美一区| 国产精品久99| 成人免费在线观看入口| 中文字幕日韩av资源站| 中文字幕亚洲区| 亚洲啪啪综合av一区二区三区|