Lines Matching refs:part

62 	struct hd_struct *part = NULL;  in disk_get_part()  local
72 part = rcu_dereference(ptbl->part[partno]); in disk_get_part()
73 if (part) in disk_get_part()
74 get_device(part_to_dev(part)); in disk_get_part()
79 return part; in disk_get_part()
103 piter->part = NULL; in disk_part_iter_init()
133 disk_put_part(piter->part); in disk_part_iter_next()
134 piter->part = NULL; in disk_part_iter_next()
155 struct hd_struct *part; in disk_part_iter_next() local
157 part = rcu_dereference(ptbl->part[piter->idx]); in disk_part_iter_next()
158 if (!part) in disk_part_iter_next()
160 if (!part_nr_sects_read(part) && in disk_part_iter_next()
166 get_device(part_to_dev(part)); in disk_part_iter_next()
167 piter->part = part; in disk_part_iter_next()
174 return piter->part; in disk_part_iter_next()
189 disk_put_part(piter->part); in disk_part_iter_exit()
190 piter->part = NULL; in disk_part_iter_exit()
194 static inline int sector_in_part(struct hd_struct *part, sector_t sector) in sector_in_part() argument
196 return part->start_sect <= sector && in sector_in_part()
197 sector < part->start_sect + part_nr_sects_read(part); in sector_in_part()
218 struct hd_struct *part; in disk_map_sector_rcu() local
223 part = rcu_dereference(ptbl->last_lookup); in disk_map_sector_rcu()
224 if (part && sector_in_part(part, sector)) in disk_map_sector_rcu()
225 return part; in disk_map_sector_rcu()
228 part = rcu_dereference(ptbl->part[i]); in disk_map_sector_rcu()
230 if (part && sector_in_part(part, sector)) { in disk_map_sector_rcu()
231 rcu_assign_pointer(ptbl->last_lookup, part); in disk_map_sector_rcu()
232 return part; in disk_map_sector_rcu()
411 int blk_alloc_devt(struct hd_struct *part, dev_t *devt) in blk_alloc_devt() argument
413 struct gendisk *disk = part_to_disk(part); in blk_alloc_devt()
417 if (part->partno < disk->minors) { in blk_alloc_devt()
418 *devt = MKDEV(disk->major, disk->first_minor + part->partno); in blk_alloc_devt()
426 idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT); in blk_alloc_devt()
512 struct hd_struct *part; in register_disk() local
568 while ((part = disk_part_iter_next(&piter))) in register_disk()
569 kobject_uevent(&part_to_dev(part)->kobj, KOBJ_ADD); in register_disk()
638 struct hd_struct *part; in del_gendisk() local
645 while ((part = disk_part_iter_next(&piter))) { in del_gendisk()
646 invalidate_partition(disk, part->partno); in del_gendisk()
647 delete_partition(disk, part->partno); in del_gendisk()
691 struct hd_struct *part; in get_gendisk() local
694 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt))); in get_gendisk()
695 if (part && get_disk(part_to_disk(part))) { in get_gendisk()
696 *partno = part->partno; in get_gendisk()
697 disk = part_to_disk(part); in get_gendisk()
721 struct hd_struct *part; in bdget_disk() local
724 part = disk_get_part(disk, partno); in bdget_disk()
725 if (part) in bdget_disk()
726 bdev = bdget(part_devt(part)); in bdget_disk()
727 disk_put_part(part); in bdget_disk()
747 struct hd_struct *part; in printk_all_partitions() local
765 while ((part = disk_part_iter_next(&piter))) { in printk_all_partitions()
766 bool is_part0 = part == &disk->part0; in printk_all_partitions()
769 bdevt_str(part_devt(part), devt_buf), in printk_all_partitions()
770 (unsigned long long)part_nr_sects_read(part) >> 1 in printk_all_partitions()
771 , disk_name(disk, part->partno, name_buf), in printk_all_partitions()
772 part->info ? part->info->uuid : ""); in printk_all_partitions()
848 struct hd_struct *part; in show_partition() local
860 while ((part = disk_part_iter_next(&piter))) in show_partition()
862 MAJOR(part_devt(part)), MINOR(part_devt(part)), in show_partition()
863 (unsigned long long)part_nr_sects_read(part) >> 1, in show_partition()
864 disk_name(sgp, part->partno, buf)); in show_partition()
1090 size = sizeof(*new_ptbl) + target * sizeof(new_ptbl->part[0]); in disk_expand_part_tbl()
1098 rcu_assign_pointer(new_ptbl->part[i], old_ptbl->part[i]); in disk_expand_part_tbl()
1227 struct hd_struct *part; in blk_lookup_devt() local
1240 part = disk_get_part(disk, partno); in blk_lookup_devt()
1241 if (part) { in blk_lookup_devt()
1242 devt = part_devt(part); in blk_lookup_devt()
1243 disk_put_part(part); in blk_lookup_devt()
1246 disk_put_part(part); in blk_lookup_devt()
1275 disk->part_tbl->part[0] = &disk->part0; in alloc_disk_node()
1348 struct hd_struct *part; in set_disk_ro() local
1356 while ((part = disk_part_iter_next(&piter))) in set_disk_ro()
1357 part->policy = flag; in set_disk_ro()