• Mikulas Patocka's avatar
    dm ioctl: return UUID in DM_LIST_DEVICES_CMD result · 8b638081
    Mikulas Patocka authored
    When LVM needs to find a device with a particular UUID it needs to ask for
    UUID for each device. This patch returns UUID directly in the list of
    devices, so that LVM doesn't have to query all the devices with an ioctl.
    The UUID is returned if the flag DM_UUID_FLAG is set in the parameters.
    
    Returning UUID is done in backward-compatible way. There's one unused
    32-bit word value after the event number. This patch sets the bit
    DM_NAME_LIST_FLAG_HAS_UUID if UUID is present and
    DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID if it isn't (if none of these bits is
    set, then we have an old kernel that doesn't support returning UUIDs). The
    UUID is stored after this word. The 'next' value is updated to point after
    the UUID, so that old version of libdevmapper will skip the UUID without
    attempting to interpret it.
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    8b638081
dm-ioctl.c 48.5 KB