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

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

?? msdos.c

?? ARM 嵌入式 系統(tǒng) 設(shè)計與實例開發(fā) 實驗教材 二源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* *  fs/partitions/msdos.c * *  Code extracted from drivers/block/genhd.c *  Copyright (C) 1991-1998  Linus Torvalds * *  Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug *  in the early extended-partition checks and added DM partitions * *  Support for DiskManager v6.0x added by Mark Lord, *  with information provided by OnTrack.  This now works for linux fdisk *  and LILO, as well as loadlin and bootln.  Note that disks other than *  /dev/hda *must* have a "DOS" type 0x51 partition in the first slot (hda1). * *  More flexible handling of extended partitions - aeb, 950831 * *  Check partition table on IDE disks for common CHS translations * *  Re-organised Feb 1998 Russell King */#include <linux/config.h>#include <linux/fs.h>#include <linux/genhd.h>#include <linux/kernel.h>#include <linux/major.h>#include <linux/string.h>#include <linux/blk.h>#ifdef CONFIG_BLK_DEV_IDE#include <linux/ide.h>	/* IDE xlate */#endif /* CONFIG_BLK_DEV_IDE */#include <asm/system.h>#include "check.h"#include "msdos.h"#if CONFIG_BLK_DEV_MDextern void md_autodetect_dev(kdev_t dev);#endif/* * Many architectures don't like unaligned accesses, which is * frequently the case with the nr_sects and start_sect partition * table entries. */#include <asm/unaligned.h>#define SYS_IND(p)	(get_unaligned(&p->sys_ind))#define NR_SECTS(p)	({ __typeof__(p->nr_sects) __a =	\				get_unaligned(&p->nr_sects);	\				le32_to_cpu(__a); \			})#define START_SECT(p)	({ __typeof__(p->start_sect) __a =	\				get_unaligned(&p->start_sect);	\				le32_to_cpu(__a); \			})static inline int is_extended_partition(struct partition *p){	return (SYS_IND(p) == DOS_EXTENDED_PARTITION ||		SYS_IND(p) == WIN98_EXTENDED_PARTITION ||		SYS_IND(p) == LINUX_EXTENDED_PARTITION);}/* * partition_name() formats the short partition name into the supplied * buffer, and returns a pointer to that buffer. * Used by several partition types which makes conditional inclusion messy, * use __attribute__ ((unused)) instead. */static char __attribute__ ((unused))	*partition_name (struct gendisk *hd, int minor, char *buf){#ifdef CONFIG_DEVFS_FS	sprintf(buf, "p%d", (minor & ((1 << hd->minor_shift) - 1)));	return buf;#else	return disk_name(hd, minor, buf);#endif}#define MSDOS_LABEL_MAGIC1	0x55#define MSDOS_LABEL_MAGIC2	0xAAstatic inline intmsdos_magic_present(unsigned char *p){	return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2);}/* * Create devices for each logical partition in an extended partition. * The logical partitions form a linked list, with each entry being * a partition table with two entries.  The first entry * is the real data partition (with a start relative to the partition * table start).  The second is a pointer to the next logical partition * (with a start relative to the entire extended partition). * We do not create a Linux partition for the partition tables, but * only for the actual data partitions. */static void extended_partition(struct gendisk *hd, struct block_device *bdev,			int minor, unsigned long first_size, int *current_minor){	struct partition *p;	Sector sect;	unsigned char *data;	unsigned long first_sector, this_sector, this_size;	int mask = (1 << hd->minor_shift) - 1;	int sector_size = get_hardsect_size(to_kdev_t(bdev->bd_dev)) / 512;	int loopct = 0;		/* number of links followed				   without finding a data partition */	int i;	this_sector = first_sector = hd->part[minor].start_sect;	this_size = first_size;	while (1) {		if (++loopct > 100)			return;		if ((*current_minor & mask) == 0)			return;		data = read_dev_sector(bdev, this_sector, &sect);		if (!data)			return;		if (!msdos_magic_present(data + 510))			goto done; 		p = (struct partition *) (data + 0x1be);		/*		 * Usually, the first entry is the real data partition,		 * the 2nd entry is the next extended partition, or empty,		 * and the 3rd and 4th entries are unused.		 * However, DRDOS sometimes has the extended partition as		 * the first entry (when the data partition is empty),		 * and OS/2 seems to use all four entries.		 */		/* 		 * First process the data partition(s)		 */		for (i=0; i<4; i++, p++) {			unsigned long offs, size, next;			if (!NR_SECTS(p) || is_extended_partition(p))				continue;			/* Check the 3rd and 4th entries -			   these sometimes contain random garbage */			offs = START_SECT(p)*sector_size;			size = NR_SECTS(p)*sector_size;			next = this_sector + offs;			if (i >= 2) {				if (offs + size > this_size)					continue;				if (next < first_sector)					continue;				if (next + size > first_sector + first_size)					continue;			}			add_gd_partition(hd, *current_minor, next, size);#if CONFIG_BLK_DEV_MD			if (SYS_IND(p) == LINUX_RAID_PARTITION) {			    md_autodetect_dev(MKDEV(hd->major,*current_minor));			}#endif			(*current_minor)++;			loopct = 0;			if ((*current_minor & mask) == 0)				goto done;		}		/*		 * Next, process the (first) extended partition, if present.		 * (So far, there seems to be no reason to make		 *  extended_partition()  recursive and allow a tree		 *  of extended partitions.)		 * It should be a link to the next logical partition.		 * Create a minor for this just long enough to get the next		 * partition table.  The minor will be reused for the next		 * data partition.		 */		p -= 4;		for (i=0; i<4; i++, p++)			if (NR_SECTS(p) && is_extended_partition(p))				break;		if (i == 4)			goto done;	 /* nothing left to do */		this_sector = first_sector + START_SECT(p) * sector_size;		this_size = NR_SECTS(p) * sector_size;		minor = *current_minor;		put_dev_sector(sect);	}done:	put_dev_sector(sect);}/* james@bpgc.com: Solaris has a nasty indicator: 0x82 which also   indicates linux swap.  Be careful before believing this is Solaris. */static voidsolaris_x86_partition(struct gendisk *hd, struct block_device *bdev,		int minor, int *current_minor){#ifdef CONFIG_SOLARIS_X86_PARTITION	long offset = hd->part[minor].start_sect;	Sector sect;	struct solaris_x86_vtoc *v;	struct solaris_x86_slice *s;	int mask = (1 << hd->minor_shift) - 1;	int i;	char buf[40];	v = (struct solaris_x86_vtoc *)read_dev_sector(bdev, offset+1, &sect);	if (!v)		return;	if (le32_to_cpu(v->v_sanity) != SOLARIS_X86_VTOC_SANE) {		put_dev_sector(sect);		return;	}	printk(" %s: <solaris:", partition_name(hd, minor, buf));	if (le32_to_cpu(v->v_version) != 1) {		printk("  cannot handle version %d vtoc>\n",			le32_to_cpu(v->v_version));		put_dev_sector(sect);		return;	}	for (i=0; i<SOLARIS_X86_NUMSLICE; i++) {		if ((*current_minor & mask) == 0)			break;		s = &v->v_slice[i];		if (s->s_size == 0)			continue;		printk(" [s%d]", i);		/* solaris partitions are relative to current MS-DOS		 * one but add_gd_partition starts relative to sector		 * zero of the disk.  Therefore, must add the offset		 * of the current partition */		add_gd_partition(hd, *current_minor,				 le32_to_cpu(s->s_start)+offset,				 le32_to_cpu(s->s_size));		(*current_minor)++;	}	put_dev_sector(sect);	printk(" >\n");#endif}#ifdef CONFIG_BSD_DISKLABELstatic voidcheck_and_add_bsd_partition(struct gendisk *hd, struct bsd_partition *bsd_p,	int baseminor, int *current_minor){	int i, bsd_start, bsd_size;	bsd_start = le32_to_cpu(bsd_p->p_offset);	bsd_size = le32_to_cpu(bsd_p->p_size);	/* check relative position of already allocated partitions */	for (i = baseminor+1; i < *current_minor; i++) {		int start = hd->part[i].start_sect;		int size = hd->part[i].nr_sects;		if (start+size <= bsd_start || start >= bsd_start+bsd_size)			continue;	/* no overlap */		if (start == bsd_start && size == bsd_size)			return;		/* equal -> no need to add */		if (start <= bsd_start && start+size >= bsd_start+bsd_size) {			/* bsd living within dos partition */#ifdef DEBUG_BSD_DISKLABEL			printk("w: %d %ld+%ld,%d+%d", 			       i, start, size, bsd_start, bsd_size);#endif			break;		/* ok */		}		/* ouch: bsd and linux overlap */#ifdef DEBUG_BSD_DISKLABEL		printk("???: %d %ld+%ld,%d+%d",		       i, start, size, bsd_start, bsd_size);#endif		printk("???");		return;	}	add_gd_partition(hd, *current_minor, bsd_start, bsd_size);	(*current_minor)++;}/*  * Create devices for BSD partitions listed in a disklabel, under a * dos-like partition. See extended_partition() for more information. */static void do_bsd_partition(struct gendisk *hd, struct block_device *bdev,	int minor, int *current_minor, char *name, int max_partitions){	long offset = hd->part[minor].start_sect;	Sector sect;	struct bsd_disklabel *l;	struct bsd_partition *p;	int mask = (1 << hd->minor_shift) - 1;	int baseminor = (minor & ~mask);	char buf[40];	l = (struct bsd_disklabel *)read_dev_sector(bdev, offset+1, &sect);	if (!l)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩黄色一区二区| 欧美激情综合在线| 丁香网亚洲国际| 九色porny丨国产精品| 午夜久久久影院| 亚洲一级在线观看| 日韩美女精品在线| 亚洲另类色综合网站| 亚洲少妇30p| 一区二区三区在线观看动漫| 亚洲免费三区一区二区| 亚洲欧美国产77777| 亚洲美女少妇撒尿| 亚洲一区二区在线视频| 亚洲va国产va欧美va观看| 亚洲chinese男男1069| 亚洲国产欧美在线| 青青草国产成人av片免费| 麻豆精品久久久| 国产成人精品影视| 99久久精品情趣| 欧美午夜精品一区二区三区 | 日韩一级免费一区| 日韩欧美中文一区二区| 国产午夜精品一区二区三区视频 | 国产精品美女久久久久高潮| 精品国产乱子伦一区| 久久久精品国产99久久精品芒果| 日本一区二区三区四区 | 在线观看视频一区| 欧美日韩精品一区二区天天拍小说| 欧美军同video69gay| 精品国产乱码久久久久久免费| 国产午夜精品一区二区三区四区| √…a在线天堂一区| 亚洲成人动漫在线免费观看| 久久精品免费看| 成人国产在线观看| 欧美区一区二区三区| 精品国产一区二区三区四区四| 中文字幕在线免费不卡| 午夜精品在线视频一区| 国产一区二区三区在线观看免费 | 国产精品视频免费看| 亚洲精品少妇30p| 麻豆精品国产传媒mv男同| 国产91色综合久久免费分享| 欧美性淫爽ww久久久久无| 亚洲精品一线二线三线| 一卡二卡欧美日韩| 国产美女视频一区| 欧美日韩色综合| 国产精品久久久久三级| 久久激五月天综合精品| 97久久久精品综合88久久| 久久亚洲精品国产精品紫薇| 亚洲动漫第一页| 高清av一区二区| 日韩欧美中文一区二区| 欧美高清在线精品一区| 免费成人在线观看| 欧美性大战久久久久久久蜜臀| 久久久久国产精品麻豆| 日本一区中文字幕 | 久久99日本精品| 91传媒视频在线播放| 亚洲视频你懂的| 国产精品1区二区.| 91精品国产免费久久综合| 亚洲激情图片小说视频| 99视频有精品| 国产精品久久久久影院老司| 国产一区啦啦啦在线观看| 欧美一区二区三区视频免费播放| 亚洲综合视频在线观看| 色综合色综合色综合色综合色综合| 国产视频一区二区三区在线观看| 精品一区二区日韩| 精品免费99久久| 国产在线播放一区二区三区| 欧美xxxx老人做受| 国内精品伊人久久久久av一坑| 在线精品亚洲一区二区不卡| 一区二区三区精品视频在线| 91婷婷韩国欧美一区二区| 最新国产の精品合集bt伙计| 91在线视频免费91| 国产精品1024| 精品久久人人做人人爱| 日本成人在线电影网| 欧美一卡在线观看| 国产综合色精品一区二区三区| 亚洲精品在线免费观看视频| 国产福利精品一区| 中文字幕亚洲成人| 欧美影院精品一区| 美女在线视频一区| 国产女主播一区| 欧美又粗又大又爽| 日本一道高清亚洲日美韩| 日韩精品专区在线| 成人午夜私人影院| 一区二区三区 在线观看视频| 欧美精三区欧美精三区| 美女在线视频一区| 欧美极品aⅴ影院| 人人超碰91尤物精品国产| 国产尤物一区二区在线| 久久久久久久电影| jlzzjlzz亚洲日本少妇| 亚洲精品国产品国语在线app| 欧美剧情电影在线观看完整版免费励志电影 | 国产ts人妖一区二区| 亚洲日韩欧美一区二区在线| 欧美日韩不卡一区| 成人精品电影在线观看| 亚洲狠狠爱一区二区三区| 2023国产精品自拍| 欧美天堂一区二区三区| 国产精品影视在线观看| 亚洲色图19p| 亚洲精品一区二区三区四区高清 | 色婷婷久久久久swag精品| 日本美女视频一区二区| 亚洲欧洲三级电影| 日韩欧美你懂的| 欧美亚洲动漫精品| 高清国产一区二区| 青青草国产成人99久久| 亚洲日本一区二区| 国产亚洲人成网站| 欧美日本不卡视频| 色综合天天天天做夜夜夜夜做| 精品一区二区免费在线观看| 亚洲国产欧美在线人成| 国产精品福利电影一区二区三区四区| 91精品国产手机| 欧美日韩一区二区三区在线看| 成人中文字幕合集| 久久机这里只有精品| 亚洲在线视频一区| 国产精品第13页| 国产精品污污网站在线观看| 日韩精品专区在线影院重磅| 欧美日本一区二区三区| 在线观看网站黄不卡| 91视频在线观看免费| 粉嫩嫩av羞羞动漫久久久 | 国产精品乱码一区二区三区软件| 日韩视频免费观看高清完整版在线观看 | 亚洲欧美色图小说| 久久伊人蜜桃av一区二区| 在线播放中文一区| 欧美日韩国产123区| 色视频成人在线观看免| 成人激情视频网站| 成人一区二区视频| 国产精品1024久久| 国产成a人无v码亚洲福利| 国产成人综合在线观看| 国产福利电影一区二区三区| 高清av一区二区| 成人av在线一区二区| 菠萝蜜视频在线观看一区| 成人黄色一级视频| 99久久精品免费看| 色婷婷av一区二区三区软件| 日本久久一区二区三区| 欧美日韩一区二区三区在线| 91精品国产色综合久久久蜜香臀| 日韩欧美成人一区二区| 久久久久久久久免费| 成人欧美一区二区三区白人| 精品一区二区三区香蕉蜜桃 | 国产丝袜欧美中文另类| 国产亲近乱来精品视频| 日本一区二区电影| 中文字幕在线视频一区| 夜夜揉揉日日人人青青一国产精品| 亚洲综合精品自拍| 免费成人结看片| 成人午夜视频在线| 欧美在线三级电影| 欧美一级片免费看| 中文字幕第一区二区| 一区二区三区在线播| 日本va欧美va瓶| 成人avav影音| 欧美精品乱人伦久久久久久| 国产亚洲午夜高清国产拍精品| 综合欧美亚洲日本| 奇米四色…亚洲| 91免费看片在线观看| 欧美一区二区三区免费大片| 亚洲国产精品传媒在线观看| 一区二区三区四区五区视频在线观看 | 一区二区在线免费| 精品午夜一区二区三区在线观看 | 一区二区三区欧美亚洲| 极品少妇xxxx偷拍精品少妇|