extern int sysfs_devno_to_wholedisk(dev_t dev, char *diskname,
size_t len, dev_t *diskdevno);
-extern int sysfs_devno_is_lvm_private(dev_t devno, char **uuid);
+extern int sysfs_devno_is_dm_private(dev_t devno, char **uuid);
extern int sysfs_devno_is_wholedisk(dev_t devno);
extern int sysfs_scsi_get_hctl(struct sysfs_cxt *cxt, int *h,
}
/*
- * Returns 1 if the device is private LVM device. The @uuid (if not NULL)
- * returns DM device UUID, use free() to deallocate.
+ * Returns 1 if the device is private device mapper device. The @uuid
+ * (if not NULL) returns DM device UUID, use free() to deallocate.
*/
-int sysfs_devno_is_lvm_private(dev_t devno, char **uuid)
+int sysfs_devno_is_dm_private(dev_t devno, char **uuid)
{
struct sysfs_cxt cxt = UL_SYSFSCXT_EMPTY;
char *id = NULL;
return 0;
id = sysfs_strdup(&cxt, "dm/uuid");
+ if (id) {
+ /* Private LVM devices use "LVM-<uuid>-<name>" uuid format (important
+ * is the "LVM" prefix and "-<name>" postfix).
+ */
+ if (strncmp(id, "LVM-", 4) == 0) {
+ char *p = strrchr(id + 4, '-');
- /* Private LVM devices use "LVM-<uuid>-<name>" uuid format (important
- * is the "LVM" prefix and "-<name>" postfix).
- */
- if (id && strncmp(id, "LVM-", 4) == 0) {
- char *p = strrchr(id + 4, '-');
+ if (p && *(p + 1))
+ rc = 1;
- if (p && *(p + 1))
+ /* Private Stratis devices prefix the UUID with "stratis-1-private"
+ */
+ } else if (strncmp(id, "stratis-1-private", 17) == 0) {
rc = 1;
+ }
}
sysfs_deinit(&cxt);
pr->flags |= BLKID_FL_TINY_DEV;
if (S_ISBLK(sb.st_mode) &&
- sysfs_devno_is_lvm_private(sb.st_rdev, &dm_uuid)) {
- DBG(LOWPROBE, ul_debug("ignore private LVM device"));
+ sysfs_devno_is_dm_private(sb.st_rdev, &dm_uuid)) {
+ DBG(LOWPROBE, ul_debug("ignore private device mapper device"));
pr->flags |= BLKID_FL_NOSCAN_DEV;
}