• Home
  • Raw
  • Download

Lines Matching refs:part

268 	struct hd_struct *part = dev_to_part(dev);  in part_uevent()  local
270 add_uevent_var(env, "PARTN=%u", part->partno); in part_uevent()
271 if (part->info && part->info->volname[0]) in part_uevent()
272 add_uevent_var(env, "PARTNAME=%s", part->info->volname); in part_uevent()
285 struct hd_struct *part = in hd_struct_free_work() local
287 struct gendisk *disk = part_to_disk(part); in hd_struct_free_work()
297 part->start_sect = 0; in hd_struct_free_work()
298 part->nr_sects = 0; in hd_struct_free_work()
299 part_stat_set_all(part, 0); in hd_struct_free_work()
300 put_device(part_to_dev(part)); in hd_struct_free_work()
305 struct hd_struct *part = container_of(ref, struct hd_struct, ref); in hd_struct_free() local
306 struct gendisk *disk = part_to_disk(part); in hd_struct_free()
312 INIT_RCU_WORK(&part->rcu_work, hd_struct_free_work); in hd_struct_free()
313 queue_rcu_work(system_wq, &part->rcu_work); in hd_struct_free()
316 int hd_ref_init(struct hd_struct *part) in hd_ref_init() argument
318 if (percpu_ref_init(&part->ref, hd_struct_free, 0, GFP_KERNEL)) in hd_ref_init()
327 void delete_partition(struct hd_struct *part) in delete_partition() argument
329 struct gendisk *disk = part_to_disk(part); in delete_partition()
338 rcu_assign_pointer(ptbl->part[part->partno], NULL); in delete_partition()
339 kobject_put(part->holder_dir); in delete_partition()
340 device_del(part_to_dev(part)); in delete_partition()
348 blk_invalidate_devt(part_devt(part)); in delete_partition()
349 percpu_ref_kill(&part->ref); in delete_partition()
398 if (ptbl->part[partno]) in add_partition()
473 rcu_assign_pointer(ptbl->part[partno], p); in add_partition()
501 struct hd_struct *part; in partition_overlaps() local
505 while ((part = disk_part_iter_next(&piter))) { in partition_overlaps()
506 if (part->partno == skip_partno || in partition_overlaps()
507 start >= part->start_sect + part->nr_sects || in partition_overlaps()
508 start + length <= part->start_sect) in partition_overlaps()
521 struct hd_struct *part; in bdev_add_partition() local
536 part = add_partition(disk, partno, start, length, in bdev_add_partition()
538 ret = PTR_ERR_OR_ZERO(part); in bdev_add_partition()
547 struct hd_struct *part = NULL; in bdev_del_partition() local
558 part = disk_get_part(bdev->bd_disk, partno); in bdev_del_partition()
559 if (!part) in bdev_del_partition()
569 delete_partition(part); in bdev_del_partition()
575 if (part) in bdev_del_partition()
576 disk_put_part(part); in bdev_del_partition()
584 struct hd_struct *part; in bdev_resize_partition() local
587 part = disk_get_part(bdev->bd_disk, partno); in bdev_resize_partition()
588 if (!part) in bdev_resize_partition()
592 bdevp = bdget_part(part); in bdev_resize_partition()
600 if (start != part->start_sect) in bdev_resize_partition()
607 part_nr_sects_write(part, length); in bdev_resize_partition()
616 disk_put_part(part); in bdev_resize_partition()
639 struct hd_struct *part; in blk_drop_partitions() local
648 while ((part = disk_part_iter_next(&piter))) in blk_drop_partitions()
649 delete_partition(part); in blk_drop_partitions()
664 struct hd_struct *part; in blk_add_partition() local
694 part = add_partition(disk, p, from, size, state->parts[p].flags, in blk_add_partition()
696 if (IS_ERR(part) && PTR_ERR(part) != -ENXIO) { in blk_add_partition()
698 disk->disk_name, p, -PTR_ERR(part)); in blk_add_partition()
704 md_autodetect_dev(part_to_dev(part)->devt); in blk_add_partition()