• Home
  • Raw
  • Download

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()
368 static void free_conf(struct mddev *mddev, struct r0conf *conf) in free_conf() argument
370 kfree(conf->strip_zone); in free_conf()
371 kfree(conf->devlist); in free_conf()
372 kfree(conf); in free_conf()
377 struct r0conf *conf = priv; in raid0_free() local
379 free_conf(mddev, conf); in raid0_free()
384 struct r0conf *conf; in raid0_run() local
396 ret = create_strip_zones(mddev, &conf); in raid0_run()
399 mddev->private = conf; in raid0_run()
401 conf = mddev->private; in raid0_run()
429 free_conf(mddev, conf); in raid0_run()
450 struct r0conf *conf = mddev->private; in raid0_handle_discard() local
464 zone = find_zone(conf, &start); in raid0_handle_discard()
478 if (zone != conf->strip_zone) in raid0_handle_discard()
490 if ((conf->layout == RAID0_ORIG_LAYOUT) && (zone != conf->strip_zone)) { in raid0_handle_discard()
539 rdev = conf->devlist[(zone - conf->strip_zone) * in raid0_handle_discard()
540 conf->strip_zone[0].nb_dev + disk]; in raid0_handle_discard()
550 struct r0conf *conf = mddev->private; in raid0_map_submit_bio() local
559 switch (conf->layout) { in raid0_map_submit_bio()