Lines Matching refs:raid
165 static struct hptraid raid[14]; variable
185 return put_user(raid[minor].sectors , (unsigned long *) arg); in hptraid_ioctl()
199 bios_cyl = raid[minor].sectors/63/255; in hptraid_ioctl()
215 bios_cyl = raid[minor].sectors/63/255; in hptraid_ioctl()
240 thisraid = &raid[device]; in hptraidspan_make_request()
381 if( hptraid0_compute_request(raid+device, q, rw, bh) != 1 ) { in hptraid0_make_request()
405 bestdist = raid[device].disk[0].last_pos - bh->b_rsector; in hptraid1_read_request()
411 for (i=1 ; i<raid[device].disks; i++) { in hptraid1_read_request()
412 dist = raid[device].disk[i].last_pos - bh->b_rsector; in hptraid1_read_request()
420 if ( (raid[device].previous>bestsofar) && in hptraid1_read_request()
421 (raid[device].previous<=i) ) in hptraid1_read_request()
423 raid[device].previous = in hptraid1_read_request()
424 (raid[device].previous + 1) % in hptraid1_read_request()
425 raid[device].disks; in hptraid1_read_request()
433 bh->b_rdev = raid[device].disk[bestsofar].device; in hptraid1_read_request()
434 raid[device].disk[bestsofar].last_pos = bh->b_rsector+(bh->b_size>>9); in hptraid1_read_request()
457 atomic_set(&private->count,raid[device].disks); in hptraid1_write_request()
460 for (i = 0; i< raid[device].disks; i++) { in hptraid1_write_request()
475 bh1->b_rdev = raid[device].disk[i].device; in hptraid1_write_request()
478 raid[device].disk[i].last_pos = bh1->b_rsector+(bh1->b_size>>9); in hptraid1_write_request()
480 if( raid[device].raid01 ) { in hptraid1_write_request()
482 raid[device].raid01 + in hptraid1_write_request()
528 raid[(bh->b_rdev >> SHIFT)&MAJOR_MASK]. in hptraid01_read_request()
606 static void writeentry(struct hptraid * raid, struct hptraid_dev * disk, in writeentry() argument
615 raid->disk[index].bdev = bdev; in writeentry()
631 raid->disk[index].device = MKDEV(disk->major,disk->minor); in writeentry()
632 raid->disk[index].sectors = maxsectors(disk->major,disk->minor); in writeentry()
633 raid->stride = (1<<prom->raid0_shift); in writeentry()
634 raid->disks = prom->raid_disks; in writeentry()
635 raid->sectors = prom->total_secs; in writeentry()
636 raid->sectors += raid->sectors&1?1:0; in writeentry()
637 raid->magic_0=prom->magic_0; in writeentry()
638 raid->magic_1=prom->magic_1; in writeentry()
676 if (raid[device].disks) { /* only check if raid is not empty */ in probedisk()
678 if( prom->magic_1 != raid[device].magic_1) { in probedisk()
682 else if (prom->magic_0 != raid[device].magic_0) { in probedisk()
696 if (raid[device].raid01 == NULL ) { in probedisk()
698 raid[device].raid01= in probedisk()
700 if ( raid[device].raid01 == NULL ) { in probedisk()
702 raid[device].disks=-1; in probedisk()
705 memset(raid[device].raid01, 0, in probedisk()
711 if ( raid[device].raid01[j].disks == 0 || in probedisk()
712 raid[device].raid01[j].magic_0 == prom->magic_0 ) in probedisk()
714 writeentry(raid[device].raid01+j, disk, in probedisk()
724 raid[device].stride=raid[device].raid01[j].stride; in probedisk()
725 raid[device].disks=j+1; in probedisk()
726 raid[device].sectors=raid[device].raid01[j].sectors; in probedisk()
727 raid[device].disk[j].sectors=raid[device].raid01[j].sectors; in probedisk()
728 raid[device].magic_1=prom->magic_1; in probedisk()
731 writeentry(raid+device, disk, i, prom); in probedisk()
765 static int count_disks(struct hptraid * raid) { in count_disks() argument
768 if (raid->disk[i].device!=0) { in count_disks()
770 i,raid->disk[i].sectors/2048); in count_disks()
777 static void raid1_fixup(struct hptraid * raid) { in raid1_fixup() argument
781 if (raid->disk[i].device!=0) { in raid1_fixup()
782 raid->disk[count]=raid->disk[i]; in raid1_fixup()
784 memset(raid->disk+i, 0, sizeof(struct hptdisk)); in raid1_fixup()
789 raid->disks=count; in raid1_fixup()
795 memset(raid+device, 0, sizeof(struct hptraid)); in hptraid_init_one()
804 fill_cutoff(raid+device); in hptraid_init_one()
808 raid1_fixup(raid+device); in hptraid_init_one()
812 for(i=0; i < 2 && raid[device].raid01 && in hptraid_init_one()
813 raid[device].raid01[i].disks; i++) { in hptraid_init_one()
814 fill_cutoff(raid[device].raid01+i); in hptraid_init_one()
816 raid[device].disk[i].device=i+1; in hptraid_init_one()
823 count=count_disks(raid+device); in hptraid_init_one()
825 if (count != raid[device].disks) { in hptraid_init_one()
827 label, raid[device].disks, count); in hptraid_init_one()
834 for(i=0;i<raid[device].disks;i++) { in hptraid_init_one()
835 count=count_disks(raid[device].raid01+i); in hptraid_init_one()
836 if(count == raid[device].raid01[i].disks) { in hptraid_init_one()
842 i, raid[device].raid01[i].disks, in hptraid_init_one()
856 ataraid_register_disk(device,raid[device].sectors); in hptraid_init_one()
893 struct block_device *bdev = raid[device].disk[i].bdev; in hptraid_exit()
894 raid[device].disk[i].bdev = NULL; in hptraid_exit()
898 if (raid[device].sectors) { in hptraid_exit()
900 if( raid[device].raid01 ) { in hptraid_exit()
901 kfree(raid[device].raid01); in hptraid_exit()