def METHOD_NAME(part: Object) -> bytes:
    """
    Get the name of a partition (e.g., ``sda1``).
    :param part: ``struct block_device *`` or ``struct hd_struct *`` depending
        on the kernel version.
    """
    try:
        bd_device = part.bd_device
    except AttributeError:
        return part.__dev.kobj.name.string_()
    return bd_device.kobj.name.string_()