Lines Matching refs:conf
26 static int multipath_map (struct mpconf *conf) in multipath_map() argument
28 int i, disks = conf->raid_disks; in multipath_map()
37 struct md_rdev *rdev = rcu_dereference(conf->multipaths[i].rdev); in multipath_map()
55 struct mpconf *conf = mddev->private; in multipath_reschedule_retry() local
57 spin_lock_irqsave(&conf->device_lock, flags); in multipath_reschedule_retry()
58 list_add(&mp_bh->retry_list, &conf->retry_list); in multipath_reschedule_retry()
59 spin_unlock_irqrestore(&conf->device_lock, flags); in multipath_reschedule_retry()
71 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_bh_io() local
75 mempool_free(mp_bh, &conf->pool); in multipath_end_bh_io()
81 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_request() local
82 struct md_rdev *rdev = conf->multipaths[mp_bh->path].rdev; in multipath_end_request()
97 rdev_dec_pending(rdev, conf->mddev); in multipath_end_request()
102 struct mpconf *conf = mddev->private; in multipath_make_request() local
111 mp_bh = mempool_alloc(&conf->pool, GFP_NOIO); in multipath_make_request()
116 mp_bh->path = multipath_map(conf); in multipath_make_request()
119 mempool_free(mp_bh, &conf->pool); in multipath_make_request()
122 multipath = conf->multipaths + mp_bh->path; in multipath_make_request()
137 struct mpconf *conf = mddev->private; in multipath_status() local
140 seq_printf (seq, " [%d/%d] [", conf->raid_disks, in multipath_status()
141 conf->raid_disks - mddev->degraded); in multipath_status()
143 for (i = 0; i < conf->raid_disks; i++) { in multipath_status()
144 struct md_rdev *rdev = rcu_dereference(conf->multipaths[i].rdev); in multipath_status()
156 struct mpconf *conf = mddev->private; in multipath_error() local
158 if (conf->raid_disks - mddev->degraded <= 1) { in multipath_error()
173 spin_lock_irqsave(&conf->device_lock, flags); in multipath_error()
175 spin_unlock_irqrestore(&conf->device_lock, flags); in multipath_error()
182 conf->raid_disks - mddev->degraded); in multipath_error()
185 static void print_multipath_conf (struct mpconf *conf) in print_multipath_conf() argument
191 if (!conf) { in print_multipath_conf()
195 pr_debug(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, in print_multipath_conf()
196 conf->raid_disks); in print_multipath_conf()
198 for (i = 0; i < conf->raid_disks; i++) { in print_multipath_conf()
199 tmp = conf->multipaths + i; in print_multipath_conf()
209 struct mpconf *conf = mddev->private; in multipath_add_disk() local
219 print_multipath_conf(conf); in multipath_add_disk()
222 if ((p=conf->multipaths+path)->rdev == NULL) { in multipath_add_disk()
229 spin_lock_irq(&conf->device_lock); in multipath_add_disk()
233 spin_unlock_irq(&conf->device_lock); in multipath_add_disk()
239 print_multipath_conf(conf); in multipath_add_disk()
246 struct mpconf *conf = mddev->private; in multipath_remove_disk() local
249 struct multipath_info *p = conf->multipaths + number; in multipath_remove_disk()
251 print_multipath_conf(conf); in multipath_remove_disk()
274 print_multipath_conf(conf); in multipath_remove_disk()
292 struct mpconf *conf = mddev->private; in multipathd() local
293 struct list_head *head = &conf->retry_list; in multipathd()
297 spin_lock_irqsave(&conf->device_lock, flags); in multipathd()
302 spin_unlock_irqrestore(&conf->device_lock, flags); in multipathd()
307 if ((mp_bh->path = multipath_map (conf))<0) { in multipathd()
318 conf->multipaths[mp_bh->path].rdev->data_offset; in multipathd()
319 bio_set_dev(bio, conf->multipaths[mp_bh->path].rdev->bdev); in multipathd()
326 spin_unlock_irqrestore(&conf->device_lock, flags); in multipathd()
339 struct mpconf *conf; in multipath_run() local
360 conf = kzalloc(sizeof(struct mpconf), GFP_KERNEL); in multipath_run()
361 mddev->private = conf; in multipath_run()
362 if (!conf) in multipath_run()
365 conf->multipaths = kcalloc(mddev->raid_disks, in multipath_run()
368 if (!conf->multipaths) in multipath_run()
378 disk = conf->multipaths + disk_idx; in multipath_run()
387 conf->raid_disks = mddev->raid_disks; in multipath_run()
388 conf->mddev = mddev; in multipath_run()
389 spin_lock_init(&conf->device_lock); in multipath_run()
390 INIT_LIST_HEAD(&conf->retry_list); in multipath_run()
397 mddev->degraded = conf->raid_disks - working_disks; in multipath_run()
399 ret = mempool_init_kmalloc_pool(&conf->pool, NR_RESERVED_BUFS, in multipath_run()
410 mdname(mddev), conf->raid_disks - mddev->degraded, in multipath_run()
423 mempool_exit(&conf->pool); in multipath_run()
424 kfree(conf->multipaths); in multipath_run()
425 kfree(conf); in multipath_run()
433 struct mpconf *conf = priv; in multipath_free() local
435 mempool_exit(&conf->pool); in multipath_free()
436 kfree(conf->multipaths); in multipath_free()
437 kfree(conf); in multipath_free()