diff options
author | Karel Zak | 2014-06-17 11:20:32 +0200 |
---|---|---|
committer | Karel Zak | 2014-06-17 11:20:32 +0200 |
commit | 39866431eef1329660a30567c6a8de0b60330115 (patch) | |
tree | 466c68fef21e11708218d2d15765b52410e06387 /libblkid/src/devno.c | |
parent | findmnt: add --nocanonicalize to avoid realpath() (diff) | |
download | kernel-qcow2-util-linux-39866431eef1329660a30567c6a8de0b60330115.tar.gz kernel-qcow2-util-linux-39866431eef1329660a30567c6a8de0b60330115.tar.xz kernel-qcow2-util-linux-39866431eef1329660a30567c6a8de0b60330115.zip |
lib/sysfs: add sysfs_devno_is_lvm_private() from libblkid
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/devno.c')
-rw-r--r-- | libblkid/src/devno.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/libblkid/src/devno.c b/libblkid/src/devno.c index de65dd4b4..f4a36e4f5 100644 --- a/libblkid/src/devno.c +++ b/libblkid/src/devno.c @@ -326,35 +326,6 @@ int blkid_driver_has_major(const char *drvname, int major) return match; } -/* - * Returns 1 if the device is private LVM device. - */ -int blkid_lvm_private(dev_t devno) -{ - struct sysfs_cxt cxt = UL_SYSFSCXT_EMPTY; - char *uuid = NULL; - int rc = 0; - - if (sysfs_init(&cxt, devno, NULL) != 0) - return 0; - - uuid = sysfs_strdup(&cxt, "dm/uuid"); - - /* Private LVM devices use "LVM-<uuid>-<name>" uuid format (important - * is the "LVM" prefix and "-<name>" postfix). - */ - if (uuid && strncmp(uuid, "LVM-", 4) == 0) { - char *p = strrchr(uuid + 4, '-'); - - if (p && *(p + 1)) - rc = 1; - } - - sysfs_deinit(&cxt); - free(uuid); - return rc; -} - #ifdef TEST_PROGRAM int main(int argc, char** argv) { |