Lines Matching refs:raid
155 static struct medley_array raid[MAX_MEDLEY_ARRAYS]; variable
238 return put_user(raid[minor - medley_devid_offset].sectors, in medley_ioctl()
246 (raid[minor].sectors / 255 / 63); /* truncate */ in medley_ioctl()
278 (raid[minor - medley_devid_offset].sectors / in medley_ioctl()
300 if (atomic_read(&(raid[device].valid)) == 0) in medley_ioctl()
303 atomic_set(&(raid[device].valid), 0); in medley_ioctl()
304 if (raid[device].access != 1) { in medley_ioctl()
305 atomic_set(&(raid[device].valid), 1); in medley_ioctl()
317 ataraid_register_disk(device, raid[device].sectors); in medley_ioctl()
318 atomic_set(&(raid[device].valid), 1); in medley_ioctl()
341 struct medley_array *r = raid + device; in medley_make_request()
404 if ((raid[c].timestamp[0] == md->creation_timestamp[0]) && in medley_add_raiddrive()
405 (raid[c].timestamp[1] == md->creation_timestamp[1]) && in medley_add_raiddrive()
406 (raid[c].timestamp[2] == md->creation_timestamp[2]) && in medley_add_raiddrive()
407 (raid[c].drives == md->drives_per_striped_set) && in medley_add_raiddrive()
408 (raid[c].chunk_size == md->chunk_size) && in medley_add_raiddrive()
409 ((raid[c].present & (1 << md->drive_number)) == 0)) { in medley_add_raiddrive()
411 raid[c].present |= (1 << md->drive_number); in medley_add_raiddrive()
412 raid[c].members[md->drive_number] = dev; in medley_add_raiddrive()
423 raid[c].timestamp[0] = md->creation_timestamp[0]; in medley_add_raiddrive()
424 raid[c].timestamp[1] = md->creation_timestamp[1]; in medley_add_raiddrive()
425 raid[c].timestamp[2] = md->creation_timestamp[2]; in medley_add_raiddrive()
426 raid[c].drives = md->drives_per_striped_set; in medley_add_raiddrive()
427 raid[c].chunk_size = md->chunk_size; in medley_add_raiddrive()
428 raid[c].sectors_per_row = md->chunk_size * in medley_add_raiddrive()
432 if (((raid[c].chunk_size - 1) & in medley_add_raiddrive()
433 (raid[c].chunk_size)) == 0) { in medley_add_raiddrive()
434 raid[c].chunk_size_log = in medley_add_raiddrive()
435 ffs(raid[c].chunk_size) - 1; in medley_add_raiddrive()
437 raid[c].chunk_size_log = 0; in medley_add_raiddrive()
439 raid[c].present = (1 << md->drive_number); in medley_add_raiddrive()
440 raid[c].members[md->drive_number] = dev; in medley_add_raiddrive()
442 raid[c].sectors = ((u32 *) (md))[27]; in medley_add_raiddrive()
444 raid[c].sectors = md->total_sectors_low; in medley_add_raiddrive()
621 memset(raid, 0, MAX_MEDLEY_ARRAYS * sizeof(struct medley_array)); in medley_init()
631 if (raid[c].present != (1 << raid[c].drives) - 1) { in medley_init()
634 for (d = 0; c < raid[c].drives; c++) { in medley_init()
635 if (raid[c].present & (1 << d)) { in medley_init()
637 MAJOR(raid[c].members[d]), in medley_init()
638 MINOR(raid[c].members[d])); in medley_init()
643 memmove(raid + c + 1, raid + c, in medley_init()
674 c, raid[c].drives, in medley_init()
675 raid[c].sectors / 1024 / 1024 / 2); in medley_init()
676 for (d = 0; d < raid[c].drives; d++) { in medley_init()
677 printk(" %02x:%02x", MAJOR(raid[c].members[d]), in medley_init()
678 MINOR(raid[c].members[d])); in medley_init()
679 raid[c].bdev[d] = get_device_lock(raid[c].members[d]); in medley_init()
682 raid[c].registered = 1; in medley_init()
683 atomic_set(&(raid[c].valid), 1); in medley_init()
684 ataraid_register_disk(c, raid[c].sectors); in medley_init()
704 for (d = 0; d < raid[device].drives; d++) { in medley_exit()
705 if (raid[device].bdev[d]) { in medley_exit()
706 blkdev_put(raid[device].bdev[d], BDEV_RAW); in medley_exit()
707 raid[device].bdev[d] = NULL; in medley_exit()
710 if (raid[device].registered) { in medley_exit()
713 raid[device].registered = 0; in medley_exit()
728 while (!atomic_read(&(raid[device].valid))) in medley_open()
730 raid[device].access++; in medley_open()
745 raid[device].access--; in medley_release()