Lines Matching refs:mddev

24 static inline struct dev_info *which_dev(struct mddev *mddev, sector_t sector)  in which_dev()  argument
30 hi = mddev->raid_disks - 1; in which_dev()
31 conf = mddev->private; in which_dev()
49 static sector_t linear_size(struct mddev *mddev, sector_t sectors, int raid_disks) in linear_size() argument
54 conf = mddev->private; in linear_size()
62 static struct linear_conf *linear_conf(struct mddev *mddev, int raid_disks) in linear_conf() argument
75 rdev_for_each(rdev, mddev) { in linear_conf()
82 mdname(mddev)); in linear_conf()
87 if (mddev->chunk_sectors) { in linear_conf()
89 sector_div(sectors, mddev->chunk_sectors); in linear_conf()
90 rdev->sectors = sectors * mddev->chunk_sectors; in linear_conf()
93 disk_stack_limits(mddev->gendisk, rdev->bdev, in linear_conf()
101 mdname(mddev)); in linear_conf()
135 static int linear_run (struct mddev *mddev) in linear_run() argument
140 if (md_check_no_bitmap(mddev)) in linear_run()
142 conf = linear_conf(mddev, mddev->raid_disks); in linear_run()
146 mddev->private = conf; in linear_run()
147 md_set_array_sectors(mddev, linear_size(mddev, 0, 0)); in linear_run()
149 ret = md_integrity_register(mddev); in linear_run()
152 mddev->private = NULL; in linear_run()
157 static int linear_add(struct mddev *mddev, struct md_rdev *rdev) in linear_add() argument
169 if (rdev->saved_raid_disk != mddev->raid_disks) in linear_add()
175 newconf = linear_conf(mddev,mddev->raid_disks+1); in linear_add()
186 mddev_suspend(mddev); in linear_add()
187 oldconf = rcu_dereference_protected(mddev->private, in linear_add()
188 lockdep_is_held(&mddev->reconfig_mutex)); in linear_add()
189 mddev->raid_disks++; in linear_add()
190 WARN_ONCE(mddev->raid_disks != newconf->raid_disks, in linear_add()
192 rcu_assign_pointer(mddev->private, newconf); in linear_add()
193 md_set_array_sectors(mddev, linear_size(mddev, 0, 0)); in linear_add()
194 set_capacity_and_notify(mddev->gendisk, mddev->array_sectors); in linear_add()
195 mddev_resume(mddev); in linear_add()
200 static void linear_free(struct mddev *mddev, void *priv) in linear_free() argument
207 static bool linear_make_request(struct mddev *mddev, struct bio *bio) in linear_make_request() argument
214 && md_flush_request(mddev, bio)) in linear_make_request()
217 tmp_dev = which_dev(mddev, bio_sector); in linear_make_request()
234 GFP_NOIO, &mddev->bio_set); in linear_make_request()
249 if (mddev->gendisk) in linear_make_request()
250 trace_block_bio_remap(bio, disk_devt(mddev->gendisk), in linear_make_request()
252 mddev_check_write_zeroes(mddev, bio); in linear_make_request()
259 mdname(mddev), in linear_make_request()
268 static void linear_status (struct seq_file *seq, struct mddev *mddev) in linear_status() argument
270 seq_printf(seq, " %dk rounding", mddev->chunk_sectors / 2); in linear_status()
273 static void linear_quiesce(struct mddev *mddev, int state) in linear_quiesce() argument