Lines Matching refs:conf
34 static int multipath_map (struct mpconf *conf) in multipath_map() argument
36 int i, disks = conf->raid_disks; in multipath_map()
45 struct md_rdev *rdev = rcu_dereference(conf->multipaths[i].rdev); in multipath_map()
63 struct mpconf *conf = mddev->private; in multipath_reschedule_retry() local
65 spin_lock_irqsave(&conf->device_lock, flags); in multipath_reschedule_retry()
66 list_add(&mp_bh->retry_list, &conf->retry_list); in multipath_reschedule_retry()
67 spin_unlock_irqrestore(&conf->device_lock, flags); in multipath_reschedule_retry()
79 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_bh_io() local
83 mempool_free(mp_bh, &conf->pool); in multipath_end_bh_io()
89 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_request() local
90 struct md_rdev *rdev = conf->multipaths[mp_bh->path].rdev; in multipath_end_request()
106 rdev_dec_pending(rdev, conf->mddev); in multipath_end_request()
111 struct mpconf *conf = mddev->private; in multipath_make_request() local
120 mp_bh = mempool_alloc(&conf->pool, GFP_NOIO); in multipath_make_request()
125 mp_bh->path = multipath_map(conf); in multipath_make_request()
128 mempool_free(mp_bh, &conf->pool); in multipath_make_request()
131 multipath = conf->multipaths + mp_bh->path; in multipath_make_request()
149 struct mpconf *conf = mddev->private; in multipath_status() local
152 seq_printf (seq, " [%d/%d] [", conf->raid_disks, in multipath_status()
153 conf->raid_disks - mddev->degraded); in multipath_status()
155 for (i = 0; i < conf->raid_disks; i++) { in multipath_status()
156 struct md_rdev *rdev = rcu_dereference(conf->multipaths[i].rdev); in multipath_status()
165 struct mpconf *conf = mddev->private; in multipath_congested() local
170 struct md_rdev *rdev = rcu_dereference(conf->multipaths[i].rdev); in multipath_congested()
190 struct mpconf *conf = mddev->private; in multipath_error() local
193 if (conf->raid_disks - mddev->degraded <= 1) { in multipath_error()
208 spin_lock_irqsave(&conf->device_lock, flags); in multipath_error()
210 spin_unlock_irqrestore(&conf->device_lock, flags); in multipath_error()
217 conf->raid_disks - mddev->degraded); in multipath_error()
220 static void print_multipath_conf (struct mpconf *conf) in print_multipath_conf() argument
226 if (!conf) { in print_multipath_conf()
230 pr_debug(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, in print_multipath_conf()
231 conf->raid_disks); in print_multipath_conf()
233 for (i = 0; i < conf->raid_disks; i++) { in print_multipath_conf()
235 tmp = conf->multipaths + i; in print_multipath_conf()
245 struct mpconf *conf = mddev->private; in multipath_add_disk() local
255 print_multipath_conf(conf); in multipath_add_disk()
258 if ((p=conf->multipaths+path)->rdev == NULL) { in multipath_add_disk()
265 spin_lock_irq(&conf->device_lock); in multipath_add_disk()
269 spin_unlock_irq(&conf->device_lock); in multipath_add_disk()
275 print_multipath_conf(conf); in multipath_add_disk()
282 struct mpconf *conf = mddev->private; in multipath_remove_disk() local
285 struct multipath_info *p = conf->multipaths + number; in multipath_remove_disk()
287 print_multipath_conf(conf); in multipath_remove_disk()
310 print_multipath_conf(conf); in multipath_remove_disk()
328 struct mpconf *conf = mddev->private; in multipathd() local
329 struct list_head *head = &conf->retry_list; in multipathd()
334 spin_lock_irqsave(&conf->device_lock, flags); in multipathd()
339 spin_unlock_irqrestore(&conf->device_lock, flags); in multipathd()
344 if ((mp_bh->path = multipath_map (conf))<0) { in multipathd()
355 conf->multipaths[mp_bh->path].rdev->data_offset; in multipathd()
356 bio_set_dev(bio, conf->multipaths[mp_bh->path].rdev->bdev); in multipathd()
363 spin_unlock_irqrestore(&conf->device_lock, flags); in multipathd()
376 struct mpconf *conf; in multipath_run() local
397 conf = kzalloc(sizeof(struct mpconf), GFP_KERNEL); in multipath_run()
398 mddev->private = conf; in multipath_run()
399 if (!conf) in multipath_run()
402 conf->multipaths = kcalloc(mddev->raid_disks, in multipath_run()
405 if (!conf->multipaths) in multipath_run()
415 disk = conf->multipaths + disk_idx; in multipath_run()
424 conf->raid_disks = mddev->raid_disks; in multipath_run()
425 conf->mddev = mddev; in multipath_run()
426 spin_lock_init(&conf->device_lock); in multipath_run()
427 INIT_LIST_HEAD(&conf->retry_list); in multipath_run()
434 mddev->degraded = conf->raid_disks - working_disks; in multipath_run()
436 ret = mempool_init_kmalloc_pool(&conf->pool, NR_RESERVED_BUFS, in multipath_run()
447 mdname(mddev), conf->raid_disks - mddev->degraded, in multipath_run()
460 mempool_exit(&conf->pool); in multipath_run()
461 kfree(conf->multipaths); in multipath_run()
462 kfree(conf); in multipath_run()
470 struct mpconf *conf = priv; in multipath_free() local
472 mempool_exit(&conf->pool); in multipath_free()
473 kfree(conf->multipaths); in multipath_free()
474 kfree(conf); in multipath_free()