Lines Matching refs:part
63 struct hd_struct *part = NULL; in disk_get_part() local
73 part = rcu_dereference(ptbl->part[partno]); in disk_get_part()
74 if (part) in disk_get_part()
75 get_device(part_to_dev(part)); in disk_get_part()
80 return part; in disk_get_part()
104 piter->part = NULL; in disk_part_iter_init()
134 disk_put_part(piter->part); in disk_part_iter_next()
135 piter->part = NULL; in disk_part_iter_next()
156 struct hd_struct *part; in disk_part_iter_next() local
158 part = rcu_dereference(ptbl->part[piter->idx]); in disk_part_iter_next()
159 if (!part) in disk_part_iter_next()
161 if (!part_nr_sects_read(part) && in disk_part_iter_next()
167 get_device(part_to_dev(part)); in disk_part_iter_next()
168 piter->part = part; in disk_part_iter_next()
175 return piter->part; in disk_part_iter_next()
190 disk_put_part(piter->part); in disk_part_iter_exit()
191 piter->part = NULL; in disk_part_iter_exit()
195 static inline int sector_in_part(struct hd_struct *part, sector_t sector) in sector_in_part() argument
197 return part->start_sect <= sector && in sector_in_part()
198 sector < part->start_sect + part_nr_sects_read(part); in sector_in_part()
219 struct hd_struct *part; in disk_map_sector_rcu() local
224 part = rcu_dereference(ptbl->last_lookup); in disk_map_sector_rcu()
225 if (part && sector_in_part(part, sector)) in disk_map_sector_rcu()
226 return part; in disk_map_sector_rcu()
229 part = rcu_dereference(ptbl->part[i]); in disk_map_sector_rcu()
231 if (part && sector_in_part(part, sector)) { in disk_map_sector_rcu()
232 rcu_assign_pointer(ptbl->last_lookup, part); in disk_map_sector_rcu()
233 return part; in disk_map_sector_rcu()
412 int blk_alloc_devt(struct hd_struct *part, dev_t *devt) in blk_alloc_devt() argument
414 struct gendisk *disk = part_to_disk(part); in blk_alloc_devt()
418 if (part->partno < disk->minors) { in blk_alloc_devt()
419 *devt = MKDEV(disk->major, disk->first_minor + part->partno); in blk_alloc_devt()
427 idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT); in blk_alloc_devt()
513 struct hd_struct *part; in register_disk() local
569 while ((part = disk_part_iter_next(&piter))) in register_disk()
570 kobject_uevent(&part_to_dev(part)->kobj, KOBJ_ADD); in register_disk()
640 struct hd_struct *part; in del_gendisk() local
648 while ((part = disk_part_iter_next(&piter))) { in del_gendisk()
649 invalidate_partition(disk, part->partno); in del_gendisk()
650 delete_partition(disk, part->partno); in del_gendisk()
694 struct hd_struct *part; in get_gendisk() local
697 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt))); in get_gendisk()
698 if (part && get_disk(part_to_disk(part))) { in get_gendisk()
699 *partno = part->partno; in get_gendisk()
700 disk = part_to_disk(part); in get_gendisk()
724 struct hd_struct *part; in bdget_disk() local
727 part = disk_get_part(disk, partno); in bdget_disk()
728 if (part) in bdget_disk()
729 bdev = bdget(part_devt(part)); in bdget_disk()
730 disk_put_part(part); in bdget_disk()
750 struct hd_struct *part; in printk_all_partitions() local
768 while ((part = disk_part_iter_next(&piter))) { in printk_all_partitions()
769 bool is_part0 = part == &disk->part0; in printk_all_partitions()
772 bdevt_str(part_devt(part), devt_buf), in printk_all_partitions()
773 (unsigned long long)part_nr_sects_read(part) >> 1 in printk_all_partitions()
774 , disk_name(disk, part->partno, name_buf), in printk_all_partitions()
775 part->info ? part->info->uuid : ""); in printk_all_partitions()
851 struct hd_struct *part; in show_partition() local
863 while ((part = disk_part_iter_next(&piter))) in show_partition()
865 MAJOR(part_devt(part)), MINOR(part_devt(part)), in show_partition()
866 (unsigned long long)part_nr_sects_read(part) >> 1, in show_partition()
867 disk_name(sgp, part->partno, buf)); in show_partition()
1093 size = sizeof(*new_ptbl) + target * sizeof(new_ptbl->part[0]); in disk_expand_part_tbl()
1101 rcu_assign_pointer(new_ptbl->part[i], old_ptbl->part[i]); in disk_expand_part_tbl()
1229 struct hd_struct *part; in blk_lookup_devt() local
1242 part = disk_get_part(disk, partno); in blk_lookup_devt()
1243 if (part) { in blk_lookup_devt()
1244 devt = part_devt(part); in blk_lookup_devt()
1245 disk_put_part(part); in blk_lookup_devt()
1248 disk_put_part(part); in blk_lookup_devt()
1277 disk->part_tbl->part[0] = &disk->part0; in alloc_disk_node()
1354 struct hd_struct *part; in set_disk_ro() local
1362 while ((part = disk_part_iter_next(&piter))) in set_disk_ro()
1363 part->policy = flag; in set_disk_ro()