Lines Matching refs:part
95 static void part_stat_read_all(struct hd_struct *part, struct disk_stats *stat)
101 struct disk_stats *ptr = per_cpu_ptr(part->dkstats, cpu);
115 static unsigned int part_in_flight(struct hd_struct *part)
121 inflight += part_stat_local_read_cpu(part, in_flight[0], cpu) +
122 part_stat_local_read_cpu(part, in_flight[1], cpu);
130 static void part_in_flight_rw(struct hd_struct *part, unsigned int inflight[2])
137 inflight[0] += part_stat_local_read_cpu(part, in_flight[0], cpu);
138 inflight[1] += part_stat_local_read_cpu(part, in_flight[1], cpu);
152 return rcu_dereference(ptbl->part[partno]);
171 struct hd_struct *part;
174 part = __disk_get_part(disk, partno);
175 if (part)
176 get_device(part_to_dev(part));
179 return part;
202 piter->part = NULL;
232 disk_put_part(piter->part);
233 piter->part = NULL;
254 struct hd_struct *part;
256 part = rcu_dereference(ptbl->part[piter->idx]);
257 if (!part)
259 get_device(part_to_dev(part));
260 piter->part = part;
261 if (!part_nr_sects_read(part) &&
265 put_device(part_to_dev(part));
266 piter->part = NULL;
276 return piter->part;
291 disk_put_part(piter->part);
292 piter->part = NULL;
296 static inline int sector_in_part(struct hd_struct *part, sector_t sector)
298 return part->start_sect <= sector &&
299 sector < part->start_sect + part_nr_sects_read(part);
322 struct hd_struct *part;
328 part = rcu_dereference(ptbl->last_lookup);
329 if (part && sector_in_part(part, sector) && hd_struct_try_get(part))
333 part = rcu_dereference(ptbl->part[i]);
335 if (part && sector_in_part(part, sector)) {
341 if (!hd_struct_try_get(part))
343 rcu_assign_pointer(ptbl->last_lookup, part);
348 part = &disk->part0;
351 return part;
378 if (rcu_dereference(ptbl->part[i])) {
562 * @part: partition to allocate dev_t for
574 int blk_alloc_devt(struct hd_struct *part, dev_t *devt)
576 struct gendisk *disk = part_to_disk(part);
580 if (part->partno < disk->minors) {
581 *devt = MKDEV(disk->major, disk->first_minor + part->partno);
589 idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT);
708 struct hd_struct *part;
754 while ((part = disk_part_iter_next(&piter)))
755 kobject_uevent(&part_to_dev(part)->kobj, KOBJ_ADD);
903 struct hd_struct *part;
918 while ((part = disk_part_iter_next(&piter))) {
919 invalidate_partition(disk, part->partno);
920 delete_partition(part);
1013 struct hd_struct *part;
1016 part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
1017 if (part && get_disk_and_module(part_to_disk(part))) {
1018 *partno = part->partno;
1019 disk = part_to_disk(part);
1058 struct hd_struct *part;
1061 part = disk_get_part(disk, partno);
1062 if (part)
1063 bdev = bdget_part(part);
1064 disk_put_part(part);
1084 struct hd_struct *part;
1102 while ((part = disk_part_iter_next(&piter))) {
1103 bool is_part0 = part == &disk->part0;
1106 bdevt_str(part_devt(part), devt_buf),
1107 (unsigned long long)part_nr_sects_read(part) >> 1
1108 , disk_name(disk, part->partno, name_buf),
1109 part->info ? part->info->uuid : "");
1185 struct hd_struct *part;
1197 while ((part = disk_part_iter_next(&piter)))
1199 MAJOR(part_devt(part)), MINOR(part_devt(part)),
1200 (unsigned long long)part_nr_sects_read(part) >> 1,
1201 disk_name(sgp, part->partno, buf));
1530 new_ptbl = kzalloc_node(struct_size(new_ptbl, part, target), GFP_KERNEL,
1538 rcu_assign_pointer(new_ptbl->part[i], old_ptbl->part[i]);
1699 struct hd_struct *part;
1712 part = disk_get_part(disk, partno);
1713 if (part) {
1714 devt = part_devt(part);
1715 disk_put_part(part);
1718 disk_put_part(part);
1752 rcu_assign_pointer(ptbl->part[0], &disk->part0);
1869 struct hd_struct *part;
1877 while ((part = disk_part_iter_next(&piter)))
1878 part->policy = flag;
2129 * Separate this part out so that a different pointer for clearing_ptr can be