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

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

?? hptraid.c

?? ep9315平臺(tái)下硬盤(pán)驅(qū)動(dòng)的源碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*   hptraid.c  Copyright (C) 2001 Red Hat, Inc. All rights reserved.   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2, or (at your option)   any later version.      You should have received a copy of the GNU General Public License   (for example /usr/src/linux/COPYING); if not, write to the Free   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        Authors: 	Arjan van de Ven <arjanv@redhat.com>   Based on work   	Copyleft  (C) 2001 by Wilfried Weissmann <wweissmann@gmx.at>	Copyright (C) 1994-96 Marc ZYNGIER <zyngier@ufr-info-p7.ibp.fr>   Based on work done by S鴕en Schmidt for FreeBSD   */#include <linux/module.h>#include <linux/init.h>#include <linux/sched.h>#include <linux/smp_lock.h>#include <linux/kernel.h>#include <linux/blkdev.h>#include <linux/blkpg.h>#include <linux/genhd.h>#include <linux/ioctl.h>#include <linux/ide.h>#include <asm/uaccess.h>#include "ataraid.h"static int hptraid_open(struct inode * inode, struct file * filp);static int hptraid_release(struct inode * inode, struct file * filp);static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);static int hptraidspan_make_request (request_queue_t *q, int rw, struct buffer_head * bh);static int hptraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh);static int hptraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh);struct hptdisk {	kdev_t	device;	unsigned long sectors;	struct block_device *bdev;	unsigned long last_pos;};struct hptraid {	unsigned int stride;	unsigned int disks;	unsigned long sectors;        u_int32_t magic_0;	struct geom geom;		struct hptdisk disk[8];	unsigned long cutoff[8];	unsigned int cutoff_disks[8];	};struct hptraid_dev {	int major;	int minor;	int device;};static struct hptraid_dev devlist[]={	{IDE0_MAJOR,  0, -1},	{IDE0_MAJOR, 64, -1},	{IDE1_MAJOR,  0, -1},	{IDE1_MAJOR, 64, -1},	{IDE2_MAJOR,  0, -1},	{IDE2_MAJOR, 64, -1},	{IDE3_MAJOR,  0, -1},	{IDE3_MAJOR, 64, -1},	{IDE4_MAJOR,  0, -1},	{IDE4_MAJOR, 64, -1},	{IDE5_MAJOR,  0, -1},	{IDE5_MAJOR, 64, -1},	{IDE6_MAJOR,  0, -1},	{IDE6_MAJOR, 64, -1}};static struct raid_device_operations hptraidspan_ops = {	open:                   hptraid_open,	release:                hptraid_release,	ioctl:			hptraid_ioctl,	make_request:		hptraidspan_make_request};static struct raid_device_operations hptraid0_ops = {	open:                   hptraid_open,	release:                hptraid_release,	ioctl:			hptraid_ioctl,	make_request:		hptraid0_make_request};static struct raid_device_operations hptraid1_ops = {	open:                   hptraid_open,	release:                hptraid_release,	ioctl:			hptraid_ioctl,	make_request:		hptraid1_make_request};static struct hptraid raid[14];static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg){	unsigned int minor;	unsigned char val;	unsigned long sectors;		if (!inode || !inode->i_rdev) 			return -EINVAL;	minor = MINOR(inode->i_rdev)>>SHIFT;		switch (cmd) {         	case BLKGETSIZE:   /* Return device size */			if (!arg)  return -EINVAL;			sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects;			if (MINOR(inode->i_rdev)&15)				return put_user(sectors, (unsigned long *) arg);			return put_user(raid[minor].sectors , (unsigned long *) arg);			break;					case HDIO_GETGEO:		{			struct hd_geometry *loc = (struct hd_geometry *) arg;			unsigned short bios_cyl;						if (!loc) return -EINVAL;			val = 255;			if (put_user(val, (byte *) &loc->heads)) return -EFAULT;			val=63;			if (put_user(val, (byte *) &loc->sectors)) return -EFAULT;			bios_cyl = raid[minor].sectors/63/255;			if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT;			if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect,				(unsigned long *) &loc->start)) return -EFAULT;			return 0;		}		case HDIO_GETGEO_BIG:		{			struct hd_big_geometry *loc = (struct hd_big_geometry *) arg;			unsigned int bios_cyl;			if (!loc) return -EINVAL;			val = 255;			if (put_user(val, (byte *) &loc->heads)) return -EFAULT;			val = 63;			if (put_user(val, (byte *) &loc->sectors)) return -EFAULT;			bios_cyl = raid[minor].sectors/63/255;			if (put_user(bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT;			if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect,				(unsigned long *) &loc->start)) return -EFAULT;			return 0;		}					default:			return blk_ioctl(inode->i_rdev, cmd, arg);	};	return 0;}static int hptraidspan_make_request (request_queue_t *q, int rw, struct buffer_head * bh){	unsigned long rsect;	unsigned int disk;	int device;	struct hptraid *thisraid;	rsect = bh->b_rsector;	device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;	thisraid = &raid[device];	/* Partitions need adding of the start sector of the partition to the requested sector */		rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;	for (disk=0;disk<thisraid->disks;disk++) {		if (disk==1)			rsect+=10;			// the "on next disk" contition check is a bit odd		if (thisraid->disk[disk].sectors > rsect+1)			break;		rsect-=thisraid->disk[disk].sectors-(disk?11:1);	}		// request spans over 2 disks => request must be split	if(rsect+bh->b_size/512 >= thisraid->disk[disk].sectors)		return -1;		/*	 * The new BH_Lock semantics in ll_rw_blk.c guarantee that this	 * is the only IO operation happening on this bh.	 */	 	bh->b_rdev = thisraid->disk[disk].device;	bh->b_rsector = rsect;	/*	 * Let the main block layer submit the IO and resolve recursion:	 */	return 1;}static int hptraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh){	unsigned long rsect;	unsigned long rsect_left,rsect_accum = 0;	unsigned long block;	unsigned int disk=0,real_disk=0;	int i;	int device;	struct hptraid *thisraid;	rsect = bh->b_rsector;	/* Ok. We need to modify this sector number to a new disk + new sector number. 	 * If there are disks of different sizes, this gets tricky. 	 * Example with 3 disks (1Gb, 4Gb and 5 GB):	 * The first 3 Gb of the "RAID" are evenly spread over the 3 disks.	 * Then things get interesting. The next 2Gb (RAID view) are spread across disk 2 and 3	 * and the last 1Gb is disk 3 only.	 *	 * the way this is solved is like this: We have a list of "cutoff" points where everytime	 * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff	 * point, we have to divide by one less.	 */		device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;	thisraid = &raid[device];	if (thisraid->stride==0)		thisraid->stride=1;	/* Partitions need adding of the start sector of the partition to the requested sector */		rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;	/* Woops we need to split the request to avoid crossing a stride barrier */	if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) {		return -1;	}				rsect_left = rsect;		for (i=0;i<8;i++) {		if (thisraid->cutoff_disks[i]==0)			break;		if (rsect > thisraid->cutoff[i]) {			/* we're in the wrong area so far */			rsect_left -= thisraid->cutoff[i];			rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i];		} else {			block = rsect_left / thisraid->stride;			disk = block % thisraid->cutoff_disks[i];			block = (block / thisraid->cutoff_disks[i]) * thisraid->stride;			rsect = rsect_accum + (rsect_left % thisraid->stride) + block;			break;		}	}		for (i=0;i<8;i++) {		if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) {			real_disk = i;			break;		}		if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) {			disk--;		}			}	disk = real_disk;		/* All but the first disk have a 10 sector offset */	if (i>0)		rsect+=10;				/*	 * The new BH_Lock semantics in ll_rw_blk.c guarantee that this	 * is the only IO operation happening on this bh.	 */	 	bh->b_rdev = thisraid->disk[disk].device;	bh->b_rsector = rsect;	/*	 * Let the main block layer submit the IO and resolve recursion:	 */	return 1;}static int hptraid1_read_request (request_queue_t *q, int rw, struct buffer_head * bh){	int device;	int dist;	int bestsofar,bestdist,i;	static int previous;	/* Reads are simple in principle. Pick a disk and go. 	   Initially I cheat by just picking the one which the last known	   head position is closest by.	   Later on, online/offline checking and performance needs adding */		device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;	bh->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;	bestsofar = 0; 	bestdist = raid[device].disk[0].last_pos - bh->b_rsector;	if (bestdist<0) 		bestdist=-bestdist;	if (bestdist>4095)		bestdist=4095;	for (i=1 ; i<raid[device].disks; i++) {		dist = raid[device].disk[i].last_pos - bh->b_rsector;		if (dist<0) 			dist = -dist;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品在线免费观看| 午夜国产精品影院在线观看| 欧美成人猛片aaaaaaa| 4438x亚洲最大成人网| 欧美日韩在线电影| 欧美美女激情18p| 欧美日韩国产大片| 欧美二区乱c少妇| 欧美一区二区在线播放| 欧美一区二区三区色| 日韩欧美你懂的| 26uuu国产日韩综合| 2024国产精品| 亚洲国产岛国毛片在线| 国产精品福利在线播放| 亚洲精品免费在线| 亚洲6080在线| 精久久久久久久久久久| 国产老女人精品毛片久久| 国产成人精品一区二区三区四区| 国产精品中文字幕日韩精品 | 国产在线视频一区二区三区| 国内精品国产三级国产a久久| 国产精品夜夜嗨| 精品蜜桃在线看| 国产欧美一区二区精品秋霞影院| 中文字幕不卡在线| 一区二区日韩av| 日本va欧美va精品发布| 国产一区二区女| 一本大道综合伊人精品热热 | 精品国产第一区二区三区观看体验| 精品国产麻豆免费人成网站| 国产欧美日韩在线视频| 亚洲欧美另类久久久精品| 亚洲第一电影网| 国产福利精品一区| 日本精品一区二区三区四区的功能| 欧美精品粉嫩高潮一区二区| 精品久久久久久久久久久久包黑料 | 欧美日韩国产综合视频在线观看| 日韩你懂的在线观看| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲精品高清在线| 久久丁香综合五月国产三级网站| 久久久久久**毛片大全| 国产精品久久久久久久第一福利 | 中文字幕高清不卡| 亚洲观看高清完整版在线观看| 久热成人在线视频| 99视频超级精品| 日韩一级二级三级精品视频| 国产精品欧美经典| 蜜臀av性久久久久蜜臀aⅴ| fc2成人免费人成在线观看播放 | 日韩欧美亚洲一区二区| ㊣最新国产の精品bt伙计久久| 日韩av一级片| 色综合久久久久久久| 欧美精品一区二区三区蜜臀| 一区二区三区成人在线视频| 精品影视av免费| 欧美日韩一区中文字幕| 欧美国产日本视频| 精品在线免费视频| 欧美日韩一区视频| 中文字幕人成不卡一区| 麻豆91在线播放| 在线观看亚洲一区| 国产欧美一区视频| 美女国产一区二区三区| 欧美在线一二三| 中文字幕一区不卡| 国产激情一区二区三区四区 | 国产女人aaa级久久久级| 视频在线观看91| 日本韩国欧美在线| 中文字幕av一区 二区| 黄网站免费久久| 欧美一级高清大全免费观看| 一区二区三区日韩精品| 国产91精品久久久久久久网曝门 | 亚洲精品va在线观看| 国产 日韩 欧美大片| 欧美成人a视频| 日韩电影在线一区| 欧美老肥妇做.爰bbww视频| 亚洲激情欧美激情| 99re亚洲国产精品| 国产精品色噜噜| 丰满亚洲少妇av| 国产欧美综合在线观看第十页| 久久99精品久久久| 日韩欧美中文字幕一区| 日韩高清一区在线| 欧美人xxxx| 视频一区二区三区中文字幕| 精品视频在线免费观看| 亚洲福利一区二区三区| 欧美视频一区二区三区在线观看| 亚洲日本在线看| 色婷婷av一区二区| 亚洲综合色成人| 精品视频免费在线| 亚洲成人高清在线| 欧美精品在线视频| 日本中文字幕一区| 日韩精品一区二区三区视频在线观看| 日韩中文欧美在线| 欧美一区二区播放| 久久www免费人成看片高清| 日韩一区二区精品在线观看| 秋霞国产午夜精品免费视频| 91精品国产福利| 国产一区美女在线| 国产精品入口麻豆原神| 97成人超碰视| 亚洲国产日韩一级| 欧美一区日本一区韩国一区| 久久草av在线| 中文字幕 久热精品 视频在线| www.日韩大片| 亚洲综合久久av| 欧美一区中文字幕| 国产精品一区二区三区四区| 国产精品久久久久久久久免费桃花| 成人av资源网站| 亚洲成人av在线电影| 日韩欧美国产午夜精品| 国产成人免费视频网站| 亚洲欧美一区二区在线观看| 欧美日韩一级黄| 国内成人免费视频| 综合久久国产九一剧情麻豆| 欧美视频自拍偷拍| 国产呦精品一区二区三区网站 | 国产精品538一区二区在线| 国产精品久久久久久一区二区三区 | 国产精品国产精品国产专区不片 | 久久久亚洲国产美女国产盗摄| 成人av网址在线观看| 亚洲小说欧美激情另类| 日韩精品中文字幕在线不卡尤物| 国产毛片精品一区| 一区二区三区在线观看网站| 日韩欧美色综合| 色综合天天综合给合国产| 青娱乐精品在线视频| 中文字幕乱码日本亚洲一区二区| 欧美日韩一区精品| 国产成人av电影在线| 亚洲一级在线观看| 久久人人爽人人爽| 欧美日韩国产美| 成人激情综合网站| 美女视频第一区二区三区免费观看网站 | 国产亚洲一区二区在线观看| 91国内精品野花午夜精品| 韩国女主播一区二区三区| 亚洲综合偷拍欧美一区色| 久久久综合视频| 欧美日本乱大交xxxxx| 成人黄色小视频在线观看| 日本中文在线一区| 一区二区三区在线视频免费| 久久精品亚洲麻豆av一区二区| 欧美视频日韩视频在线观看| 国产91精品欧美| 免费观看在线综合色| 亚洲激情图片小说视频| 国产欧美日韩麻豆91| 日韩欧美三级在线| 精品视频一区 二区 三区| av在线不卡免费看| 极品少妇xxxx精品少妇| 午夜久久久久久久久| 亚洲精选在线视频| 国产精品剧情在线亚洲| 久久久综合视频| 欧美r级电影在线观看| 欧美人动与zoxxxx乱| 日本高清成人免费播放| a4yy欧美一区二区三区| 国产精品18久久久| 国产一区二区看久久| 久久国产成人午夜av影院| 五月天精品一区二区三区| 亚洲乱码国产乱码精品精的特点| 国产清纯在线一区二区www| 精品日韩一区二区三区免费视频| 欧美最新大片在线看| 91香蕉视频黄| 不卡视频免费播放| 不卡欧美aaaaa| 成人精品视频一区二区三区尤物| 卡一卡二国产精品| 久久成人免费电影| 精品一区二区三区香蕉蜜桃| 日本aⅴ亚洲精品中文乱码| 天天综合网天天综合色|