Lines Matching full: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()
335 * ->part_tbl is referenced in this part's release handler, so in delete_partition()
339 rcu_assign_pointer(ptbl->part[part->partno], NULL); in delete_partition()
340 kobject_put(part->holder_dir); in delete_partition()
341 device_del(part_to_dev(part)); in delete_partition()
349 blk_invalidate_devt(part_devt(part)); in delete_partition()
351 bdev = bdget_part(part); in delete_partition()
356 percpu_ref_kill(&part->ref); in delete_partition()
405 if (ptbl->part[partno]) in add_partition()
480 rcu_assign_pointer(ptbl->part[partno], p); in add_partition()
508 struct hd_struct *part; in partition_overlaps() local
512 while ((part = disk_part_iter_next(&piter))) { in partition_overlaps()
513 if (part->partno == skip_partno || in partition_overlaps()
514 start >= part->start_sect + part->nr_sects || in partition_overlaps()
515 start + length <= part->start_sect) in partition_overlaps()
528 struct hd_struct *part; in bdev_add_partition() local
536 part = add_partition(bdev->bd_disk, partno, start, length, in bdev_add_partition()
539 return PTR_ERR_OR_ZERO(part); in bdev_add_partition()
545 struct hd_struct *part = NULL; in bdev_del_partition() local
556 part = disk_get_part(bdev->bd_disk, partno); in bdev_del_partition()
557 if (!part) in bdev_del_partition()
567 delete_partition(part); in bdev_del_partition()
573 if (part) in bdev_del_partition()
574 disk_put_part(part); in bdev_del_partition()
582 struct hd_struct *part; in bdev_resize_partition() local
585 part = disk_get_part(bdev->bd_disk, partno); in bdev_resize_partition()
586 if (!part) in bdev_resize_partition()
590 bdevp = bdget_part(part); in bdev_resize_partition()
598 if (start != part->start_sect) in bdev_resize_partition()
605 part_nr_sects_write(part, length); in bdev_resize_partition()
614 disk_put_part(part); in bdev_resize_partition()
637 struct hd_struct *part; in blk_drop_partitions() local
646 while ((part = disk_part_iter_next(&piter))) in blk_drop_partitions()
647 delete_partition(part); in blk_drop_partitions()
662 struct hd_struct *part; in blk_add_partition() local
692 part = add_partition(disk, p, from, size, state->parts[p].flags, in blk_add_partition()
694 if (IS_ERR(part) && PTR_ERR(part) != -ENXIO) { in blk_add_partition()
696 disk->disk_name, p, -PTR_ERR(part)); in blk_add_partition()
702 md_autodetect_dev(part_to_dev(part)->devt); in blk_add_partition()