Lines Matching +full:partitions +full:- +full:table +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0-only
15 * match_dev_by_uuid - callback for finding a partition using its uuid
26 if (!bdev->bd_meta_info || in match_dev_by_uuid()
27 strncasecmp(cmp->uuid, bdev->bd_meta_info->uuid, cmp->len)) in match_dev_by_uuid()
33 * devt_from_partuuid - looks up the dev_t of a partition by its UUID
42 * extracted and used as an offset from the partition identified by the UUID.
50 int offset = 0; in devt_from_partuuid() local
56 /* Check for optional partition number offset attributes. */ in devt_from_partuuid()
61 if (sscanf(slash + 1, "PARTNROFF=%d%c", &offset, &c) != 1) in devt_from_partuuid()
63 cmp.len = slash - uuid_str; in devt_from_partuuid()
73 return -ENODEV; in devt_from_partuuid()
75 if (offset) { in devt_from_partuuid()
77 * Attempt to find the requested partition by adding an offset in devt_from_partuuid()
81 bdev_partno(dev_to_bdev(dev)) + offset); in devt_from_partuuid()
83 *devt = dev->devt; in devt_from_partuuid()
91 "Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n"); in devt_from_partuuid()
92 return -EINVAL; in devt_from_partuuid()
96 * match_dev_by_label - callback for finding a partition using its label
107 if (!bdev->bd_meta_info || strcmp(label, bdev->bd_meta_info->volname)) in match_dev_by_label()
118 return -ENODEV; in devt_from_partlabel()
119 *devt = dev->devt; in devt_from_partlabel()
137 if (partno < disk->minors) { in blk_lookup_devt()
141 devt = MKDEV(MAJOR(dev->devt), in blk_lookup_devt()
142 MINOR(dev->devt) + partno); in blk_lookup_devt()
160 return -EINVAL; in devt_from_devname()
172 * Try non-existent, but valid partition, which may only exist after in devt_from_devname()
175 while (p > s && isdigit(p[-1])) in devt_from_devname()
176 p--; in devt_from_devname()
178 return -ENODEV; in devt_from_devname()
188 if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p') in devt_from_devname()
189 return -ENODEV; in devt_from_devname()
190 p[-1] = '\0'; in devt_from_devname()
194 return -ENODEV; in devt_from_devname()
199 unsigned maj, min, offset; in devt_from_devnum() local
203 sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset, &dummy) == 3) { in devt_from_devnum()
206 return -EINVAL; in devt_from_devnum()
210 return -EINVAL; in devt_from_devnum()
223 * of partition - device number of disk plus the partition number
224 * 5) /dev/<disk_name>p<decimal> - same as the above, that form is
226 * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
227 * unique id of a partition if the partition table provides it.
229 * partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
230 * filled hex representation of the 32-bit "NT disk signature", and PP
231 * is a zero-filled hex representation of the 1-based partition number.
237 * MSDOS partitions do not support labels!
260 snprintf(buf, BDEVT_SIZE, "%-9s", tbuf); in bdevt_str()
268 * print a full list of all partitions - intended for places where the root
288 if (get_capacity(disk) == 0 || (disk->flags & GENHD_FL_HIDDEN)) in printk_all_partitions()
292 * Note, unlike /proc/partitions, I am showing the numbers in in printk_all_partitions()
293 * hex - the same format as the root= option takes. in printk_all_partitions()
296 xa_for_each(&disk->part_tbl, idx, part) { in printk_all_partitions()
301 bdevt_str(part->bd_dev, devt_buf), in printk_all_partitions()
303 part->bd_meta_info ? in printk_all_partitions()
304 part->bd_meta_info->uuid : ""); in printk_all_partitions()
307 else if (dev->parent && dev->parent->driver) in printk_all_partitions()
309 dev->parent->driver->name); in printk_all_partitions()