Lines Matching refs:conf

40 	struct r0conf *conf = mddev->private;  in dump_zones()  local
41 int raid_disks = conf->strip_zone[0].nb_dev; in dump_zones()
44 conf->nr_strip_zones, conf->nr_strip_zones==1?"":"s"); in dump_zones()
45 for (j = 0; j < conf->nr_strip_zones; j++) { in dump_zones()
49 for (k = 0; k < conf->strip_zone[j].nb_dev; k++) in dump_zones()
51 conf->devlist[j * raid_disks + k]->bdev); in dump_zones()
54 zone_size = conf->strip_zone[j].zone_end - zone_start; in dump_zones()
57 (unsigned long long)conf->strip_zone[j].dev_start>>1, in dump_zones()
59 zone_start = conf->strip_zone[j].zone_end; in dump_zones()
70 struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL); in create_strip_zones() local
74 if (!conf) in create_strip_zones()
119 conf->nr_strip_zones++; in create_strip_zones()
121 mdname(mddev), conf->nr_strip_zones); in create_strip_zones()
125 mdname(mddev), conf->nr_strip_zones); in create_strip_zones()
140 conf->strip_zone = kcalloc(conf->nr_strip_zones, in create_strip_zones()
143 if (!conf->strip_zone) in create_strip_zones()
145 conf->devlist = kzalloc(array3_size(sizeof(struct md_rdev *), in create_strip_zones()
146 conf->nr_strip_zones, in create_strip_zones()
149 if (!conf->devlist) in create_strip_zones()
155 zone = &conf->strip_zone[0]; in create_strip_zones()
158 dev = conf->devlist; in create_strip_zones()
209 for (i = 1; i < conf->nr_strip_zones; i++) in create_strip_zones()
213 zone = conf->strip_zone + i; in create_strip_zones()
214 dev = conf->devlist + i * mddev->raid_disks; in create_strip_zones()
222 rdev = conf->devlist[j]; in create_strip_zones()
257 if (conf->nr_strip_zones == 1 || conf->strip_zone[1].nb_dev == 1) { in create_strip_zones()
258 conf->layout = RAID0_ORIG_LAYOUT; in create_strip_zones()
261 conf->layout = mddev->layout; in create_strip_zones()
264 conf->layout = default_layout; in create_strip_zones()
273 if (conf->layout == RAID0_ORIG_LAYOUT) { in create_strip_zones()
274 for (i = 1; i < conf->nr_strip_zones; i++) { in create_strip_zones()
275 sector_t first_sector = conf->strip_zone[i-1].zone_end; in create_strip_zones()
278 zone = conf->strip_zone + i; in create_strip_zones()
286 *private_conf = conf; in create_strip_zones()
290 kfree(conf->strip_zone); in create_strip_zones()
291 kfree(conf->devlist); in create_strip_zones()
292 kfree(conf); in create_strip_zones()
300 static struct strip_zone *find_zone(struct r0conf *conf, in find_zone() argument
304 struct strip_zone *z = conf->strip_zone; in find_zone()
307 for (i = 0; i < conf->nr_strip_zones; i++) in find_zone()
325 struct r0conf *conf = mddev->private; in map_sector() local
326 int raid_disks = conf->strip_zone[0].nb_dev; in map_sector()
349 return conf->devlist[(zone - conf->strip_zone)*raid_disks in map_sector()
370 struct r0conf *conf = priv; in raid0_free() local
372 kfree(conf->strip_zone); in raid0_free()
373 kfree(conf->devlist); in raid0_free()
374 kfree(conf); in raid0_free()
398 struct r0conf *conf; in raid0_run() local
410 ret = create_strip_zones(mddev, &conf); in raid0_run()
413 mddev->private = conf; in raid0_run()
415 conf = mddev->private; in raid0_run()
450 struct r0conf *conf = mddev->private; in raid0_handle_discard() local
464 zone = find_zone(conf, &start); in raid0_handle_discard()
484 if (zone != conf->strip_zone) in raid0_handle_discard()
496 if ((conf->layout == RAID0_ORIG_LAYOUT) && (zone != conf->strip_zone)) { in raid0_handle_discard()
545 rdev = conf->devlist[(zone - conf->strip_zone) * in raid0_handle_discard()
546 conf->strip_zone[0].nb_dev + disk]; in raid0_handle_discard()
556 struct r0conf *conf = mddev->private; in raid0_map_submit_bio() local
565 switch (conf->layout) { in raid0_map_submit_bio()