• Home
  • Raw
  • Download

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
76 rdev_for_each(rdev, mddev) { in linear_conf()
83 mdname(mddev)); in linear_conf()
88 if (mddev->chunk_sectors) { in linear_conf()
90 sector_div(sectors, mddev->chunk_sectors); in linear_conf()
91 rdev->sectors = sectors * mddev->chunk_sectors; in linear_conf()
94 disk_stack_limits(mddev->gendisk, rdev->bdev, in linear_conf()
105 mdname(mddev)); in linear_conf()
110 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, mddev->queue); in linear_conf()
112 blk_queue_flag_set(QUEUE_FLAG_DISCARD, mddev->queue); in linear_conf()
144 static int linear_run (struct mddev *mddev) in linear_run() argument
149 if (md_check_no_bitmap(mddev)) in linear_run()
151 conf = linear_conf(mddev, mddev->raid_disks); in linear_run()
155 mddev->private = conf; in linear_run()
156 md_set_array_sectors(mddev, linear_size(mddev, 0, 0)); in linear_run()
158 ret = md_integrity_register(mddev); in linear_run()
161 mddev->private = NULL; in linear_run()
166 static int linear_add(struct mddev *mddev, struct md_rdev *rdev) in linear_add() argument
178 if (rdev->saved_raid_disk != mddev->raid_disks) in linear_add()
184 newconf = linear_conf(mddev,mddev->raid_disks+1); in linear_add()
195 mddev_suspend(mddev); in linear_add()
196 oldconf = rcu_dereference_protected(mddev->private, in linear_add()
197 lockdep_is_held(&mddev->reconfig_mutex)); in linear_add()
198 mddev->raid_disks++; in linear_add()
199 WARN_ONCE(mddev->raid_disks != newconf->raid_disks, in linear_add()
201 rcu_assign_pointer(mddev->private, newconf); in linear_add()
202 md_set_array_sectors(mddev, linear_size(mddev, 0, 0)); in linear_add()
203 set_capacity(mddev->gendisk, mddev->array_sectors); in linear_add()
204 mddev_resume(mddev); in linear_add()
205 revalidate_disk_size(mddev->gendisk, true); in linear_add()
210 static void linear_free(struct mddev *mddev, void *priv) in linear_free() argument
217 static bool linear_make_request(struct mddev *mddev, struct bio *bio) in linear_make_request() argument
225 && md_flush_request(mddev, bio)) in linear_make_request()
228 tmp_dev = which_dev(mddev, bio_sector); in linear_make_request()
245 GFP_NOIO, &mddev->bio_set); in linear_make_request()
260 if (mddev->gendisk) in linear_make_request()
262 bio, disk_devt(mddev->gendisk), in linear_make_request()
264 mddev_check_writesame(mddev, bio); in linear_make_request()
265 mddev_check_write_zeroes(mddev, bio); in linear_make_request()
272 mdname(mddev), in linear_make_request()
281 static void linear_status (struct seq_file *seq, struct mddev *mddev) in linear_status() argument
283 seq_printf(seq, " %dk rounding", mddev->chunk_sectors / 2); in linear_status()
286 static void linear_quiesce(struct mddev *mddev, int state) in linear_quiesce() argument