Loading drivers/md/md-faulty.c +1 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,7 @@ static bool faulty_make_request(struct mddev *mddev, struct bio *bio) } } if (failit) { struct bio *b = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set); struct bio *b = bio_clone_fast(bio, GFP_NOIO, &mddev->bio_set); bio_set_dev(b, conf->rdev->bdev); b->bi_private = bio; Loading drivers/md/md-linear.c +1 −1 Original line number Diff line number Diff line Loading @@ -269,7 +269,7 @@ static bool linear_make_request(struct mddev *mddev, struct bio *bio) if (unlikely(bio_end_sector(bio) > end_sector)) { /* This bio crosses a device boundary, so we have to split it */ struct bio *split = bio_split(bio, end_sector - bio_sector, GFP_NOIO, mddev->bio_set); GFP_NOIO, &mddev->bio_set); bio_chain(split, bio); generic_make_request(bio); bio = split; Loading drivers/md/md-multipath.c +9 −8 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ static void multipath_end_bh_io(struct multipath_bh *mp_bh, blk_status_t status) bio->bi_status = status; bio_endio(bio); mempool_free(mp_bh, conf->pool); mempool_free(mp_bh, &conf->pool); } static void multipath_end_request(struct bio *bio) Loading Loading @@ -117,7 +117,7 @@ static bool multipath_make_request(struct mddev *mddev, struct bio * bio) return true; } mp_bh = mempool_alloc(conf->pool, GFP_NOIO); mp_bh = mempool_alloc(&conf->pool, GFP_NOIO); mp_bh->master_bio = bio; mp_bh->mddev = mddev; Loading @@ -125,7 +125,7 @@ static bool multipath_make_request(struct mddev *mddev, struct bio * bio) mp_bh->path = multipath_map(conf); if (mp_bh->path < 0) { bio_io_error(bio); mempool_free(mp_bh, conf->pool); mempool_free(mp_bh, &conf->pool); return true; } multipath = conf->multipaths + mp_bh->path; Loading Loading @@ -378,6 +378,7 @@ static int multipath_run (struct mddev *mddev) struct multipath_info *disk; struct md_rdev *rdev; int working_disks; int ret; if (md_check_no_bitmap(mddev)) return -EINVAL; Loading Loading @@ -431,9 +432,9 @@ static int multipath_run (struct mddev *mddev) } mddev->degraded = conf->raid_disks - working_disks; conf->pool = mempool_create_kmalloc_pool(NR_RESERVED_BUFS, ret = mempool_init_kmalloc_pool(&conf->pool, NR_RESERVED_BUFS, sizeof(struct multipath_bh)); if (conf->pool == NULL) if (ret) goto out_free_conf; mddev->thread = md_register_thread(multipathd, mddev, Loading @@ -455,7 +456,7 @@ static int multipath_run (struct mddev *mddev) return 0; out_free_conf: mempool_destroy(conf->pool); mempool_exit(&conf->pool); kfree(conf->multipaths); kfree(conf); mddev->private = NULL; Loading @@ -467,7 +468,7 @@ static void multipath_free(struct mddev *mddev, void *priv) { struct mpconf *conf = priv; mempool_destroy(conf->pool); mempool_exit(&conf->pool); kfree(conf->multipaths); kfree(conf); } Loading drivers/md/md-multipath.h +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ struct mpconf { spinlock_t device_lock; struct list_head retry_list; mempool_t *pool; mempool_t pool; }; /* Loading drivers/md/md.c +24 −37 Original line number Diff line number Diff line Loading @@ -193,10 +193,10 @@ struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, { struct bio *b; if (!mddev || !mddev->bio_set) if (!mddev || !bioset_initialized(&mddev->bio_set)) return bio_alloc(gfp_mask, nr_iovecs); b = bio_alloc_bioset(gfp_mask, nr_iovecs, mddev->bio_set); b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set); if (!b) return NULL; return b; Loading @@ -205,10 +205,10 @@ EXPORT_SYMBOL_GPL(bio_alloc_mddev); static struct bio *md_bio_alloc_sync(struct mddev *mddev) { if (!mddev || !mddev->sync_set) if (!mddev || !bioset_initialized(&mddev->sync_set)) return bio_alloc(GFP_NOIO, 1); return bio_alloc_bioset(GFP_NOIO, 1, mddev->sync_set); return bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set); } /* Loading Loading @@ -510,7 +510,10 @@ static void mddev_delayed_delete(struct work_struct *ws); static void mddev_put(struct mddev *mddev) { struct bio_set *bs = NULL, *sync_bs = NULL; struct bio_set bs, sync_bs; memset(&bs, 0, sizeof(bs)); memset(&sync_bs, 0, sizeof(sync_bs)); if (!atomic_dec_and_lock(&mddev->active, &all_mddevs_lock)) return; Loading @@ -521,8 +524,8 @@ static void mddev_put(struct mddev *mddev) list_del_init(&mddev->all_mddevs); bs = mddev->bio_set; sync_bs = mddev->sync_set; mddev->bio_set = NULL; mddev->sync_set = NULL; memset(&mddev->bio_set, 0, sizeof(mddev->bio_set)); memset(&mddev->sync_set, 0, sizeof(mddev->sync_set)); if (mddev->gendisk) { /* We did a probe so need to clean up. Call * queue_work inside the spinlock so that Loading @@ -535,10 +538,8 @@ static void mddev_put(struct mddev *mddev) kfree(mddev); } spin_unlock(&all_mddevs_lock); if (bs) bioset_free(bs); if (sync_bs) bioset_free(sync_bs); bioset_exit(&bs); bioset_exit(&sync_bs); } static void md_safemode_timeout(struct timer_list *t); Loading Loading @@ -2123,7 +2124,7 @@ int md_integrity_register(struct mddev *mddev) bdev_get_integrity(reference->bdev)); pr_debug("md: data integrity enabled on %s\n", mdname(mddev)); if (bioset_integrity_create(mddev->bio_set, BIO_POOL_SIZE)) { if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE)) { pr_err("md: failed to create integrity pool for %s\n", mdname(mddev)); return -EINVAL; Loading Loading @@ -5497,18 +5498,16 @@ int md_run(struct mddev *mddev) sysfs_notify_dirent_safe(rdev->sysfs_state); } if (mddev->bio_set == NULL) { mddev->bio_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (!mddev->bio_set) return -ENOMEM; if (!bioset_initialized(&mddev->bio_set)) { err = bioset_init(&mddev->bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (err) return err; } if (mddev->sync_set == NULL) { mddev->sync_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (!mddev->sync_set) { err = -ENOMEM; if (!bioset_initialized(&mddev->sync_set)) { err = bioset_init(&mddev->sync_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (err) goto abort; } } spin_lock(&pers_lock); pers = find_pers(mddev->level, mddev->clevel); Loading Loading @@ -5668,14 +5667,8 @@ int md_run(struct mddev *mddev) return 0; abort: if (mddev->bio_set) { bioset_free(mddev->bio_set); mddev->bio_set = NULL; } if (mddev->sync_set) { bioset_free(mddev->sync_set); mddev->sync_set = NULL; } bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); return err; } Loading Loading @@ -5888,14 +5881,8 @@ void md_stop(struct mddev *mddev) * This is called from dm-raid */ __md_stop(mddev); if (mddev->bio_set) { bioset_free(mddev->bio_set); mddev->bio_set = NULL; } if (mddev->sync_set) { bioset_free(mddev->sync_set); mddev->sync_set = NULL; } bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); } EXPORT_SYMBOL_GPL(md_stop); Loading Loading
drivers/md/md-faulty.c +1 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,7 @@ static bool faulty_make_request(struct mddev *mddev, struct bio *bio) } } if (failit) { struct bio *b = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set); struct bio *b = bio_clone_fast(bio, GFP_NOIO, &mddev->bio_set); bio_set_dev(b, conf->rdev->bdev); b->bi_private = bio; Loading
drivers/md/md-linear.c +1 −1 Original line number Diff line number Diff line Loading @@ -269,7 +269,7 @@ static bool linear_make_request(struct mddev *mddev, struct bio *bio) if (unlikely(bio_end_sector(bio) > end_sector)) { /* This bio crosses a device boundary, so we have to split it */ struct bio *split = bio_split(bio, end_sector - bio_sector, GFP_NOIO, mddev->bio_set); GFP_NOIO, &mddev->bio_set); bio_chain(split, bio); generic_make_request(bio); bio = split; Loading
drivers/md/md-multipath.c +9 −8 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ static void multipath_end_bh_io(struct multipath_bh *mp_bh, blk_status_t status) bio->bi_status = status; bio_endio(bio); mempool_free(mp_bh, conf->pool); mempool_free(mp_bh, &conf->pool); } static void multipath_end_request(struct bio *bio) Loading Loading @@ -117,7 +117,7 @@ static bool multipath_make_request(struct mddev *mddev, struct bio * bio) return true; } mp_bh = mempool_alloc(conf->pool, GFP_NOIO); mp_bh = mempool_alloc(&conf->pool, GFP_NOIO); mp_bh->master_bio = bio; mp_bh->mddev = mddev; Loading @@ -125,7 +125,7 @@ static bool multipath_make_request(struct mddev *mddev, struct bio * bio) mp_bh->path = multipath_map(conf); if (mp_bh->path < 0) { bio_io_error(bio); mempool_free(mp_bh, conf->pool); mempool_free(mp_bh, &conf->pool); return true; } multipath = conf->multipaths + mp_bh->path; Loading Loading @@ -378,6 +378,7 @@ static int multipath_run (struct mddev *mddev) struct multipath_info *disk; struct md_rdev *rdev; int working_disks; int ret; if (md_check_no_bitmap(mddev)) return -EINVAL; Loading Loading @@ -431,9 +432,9 @@ static int multipath_run (struct mddev *mddev) } mddev->degraded = conf->raid_disks - working_disks; conf->pool = mempool_create_kmalloc_pool(NR_RESERVED_BUFS, ret = mempool_init_kmalloc_pool(&conf->pool, NR_RESERVED_BUFS, sizeof(struct multipath_bh)); if (conf->pool == NULL) if (ret) goto out_free_conf; mddev->thread = md_register_thread(multipathd, mddev, Loading @@ -455,7 +456,7 @@ static int multipath_run (struct mddev *mddev) return 0; out_free_conf: mempool_destroy(conf->pool); mempool_exit(&conf->pool); kfree(conf->multipaths); kfree(conf); mddev->private = NULL; Loading @@ -467,7 +468,7 @@ static void multipath_free(struct mddev *mddev, void *priv) { struct mpconf *conf = priv; mempool_destroy(conf->pool); mempool_exit(&conf->pool); kfree(conf->multipaths); kfree(conf); } Loading
drivers/md/md-multipath.h +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ struct mpconf { spinlock_t device_lock; struct list_head retry_list; mempool_t *pool; mempool_t pool; }; /* Loading
drivers/md/md.c +24 −37 Original line number Diff line number Diff line Loading @@ -193,10 +193,10 @@ struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, { struct bio *b; if (!mddev || !mddev->bio_set) if (!mddev || !bioset_initialized(&mddev->bio_set)) return bio_alloc(gfp_mask, nr_iovecs); b = bio_alloc_bioset(gfp_mask, nr_iovecs, mddev->bio_set); b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set); if (!b) return NULL; return b; Loading @@ -205,10 +205,10 @@ EXPORT_SYMBOL_GPL(bio_alloc_mddev); static struct bio *md_bio_alloc_sync(struct mddev *mddev) { if (!mddev || !mddev->sync_set) if (!mddev || !bioset_initialized(&mddev->sync_set)) return bio_alloc(GFP_NOIO, 1); return bio_alloc_bioset(GFP_NOIO, 1, mddev->sync_set); return bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set); } /* Loading Loading @@ -510,7 +510,10 @@ static void mddev_delayed_delete(struct work_struct *ws); static void mddev_put(struct mddev *mddev) { struct bio_set *bs = NULL, *sync_bs = NULL; struct bio_set bs, sync_bs; memset(&bs, 0, sizeof(bs)); memset(&sync_bs, 0, sizeof(sync_bs)); if (!atomic_dec_and_lock(&mddev->active, &all_mddevs_lock)) return; Loading @@ -521,8 +524,8 @@ static void mddev_put(struct mddev *mddev) list_del_init(&mddev->all_mddevs); bs = mddev->bio_set; sync_bs = mddev->sync_set; mddev->bio_set = NULL; mddev->sync_set = NULL; memset(&mddev->bio_set, 0, sizeof(mddev->bio_set)); memset(&mddev->sync_set, 0, sizeof(mddev->sync_set)); if (mddev->gendisk) { /* We did a probe so need to clean up. Call * queue_work inside the spinlock so that Loading @@ -535,10 +538,8 @@ static void mddev_put(struct mddev *mddev) kfree(mddev); } spin_unlock(&all_mddevs_lock); if (bs) bioset_free(bs); if (sync_bs) bioset_free(sync_bs); bioset_exit(&bs); bioset_exit(&sync_bs); } static void md_safemode_timeout(struct timer_list *t); Loading Loading @@ -2123,7 +2124,7 @@ int md_integrity_register(struct mddev *mddev) bdev_get_integrity(reference->bdev)); pr_debug("md: data integrity enabled on %s\n", mdname(mddev)); if (bioset_integrity_create(mddev->bio_set, BIO_POOL_SIZE)) { if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE)) { pr_err("md: failed to create integrity pool for %s\n", mdname(mddev)); return -EINVAL; Loading Loading @@ -5497,18 +5498,16 @@ int md_run(struct mddev *mddev) sysfs_notify_dirent_safe(rdev->sysfs_state); } if (mddev->bio_set == NULL) { mddev->bio_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (!mddev->bio_set) return -ENOMEM; if (!bioset_initialized(&mddev->bio_set)) { err = bioset_init(&mddev->bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (err) return err; } if (mddev->sync_set == NULL) { mddev->sync_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (!mddev->sync_set) { err = -ENOMEM; if (!bioset_initialized(&mddev->sync_set)) { err = bioset_init(&mddev->sync_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); if (err) goto abort; } } spin_lock(&pers_lock); pers = find_pers(mddev->level, mddev->clevel); Loading Loading @@ -5668,14 +5667,8 @@ int md_run(struct mddev *mddev) return 0; abort: if (mddev->bio_set) { bioset_free(mddev->bio_set); mddev->bio_set = NULL; } if (mddev->sync_set) { bioset_free(mddev->sync_set); mddev->sync_set = NULL; } bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); return err; } Loading Loading @@ -5888,14 +5881,8 @@ void md_stop(struct mddev *mddev) * This is called from dm-raid */ __md_stop(mddev); if (mddev->bio_set) { bioset_free(mddev->bio_set); mddev->bio_set = NULL; } if (mddev->sync_set) { bioset_free(mddev->sync_set); mddev->sync_set = NULL; } bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); } EXPORT_SYMBOL_GPL(md_stop); Loading