• Mikulas Patocka's avatar
    dm: make dm_table_find_target return NULL · 123d87d5
    Mikulas Patocka authored
    Currently, if we pass too high sector number to dm_table_find_target, it
    returns zeroed dm_target structure and callers test if the structure is
    zeroed with the macro dm_target_is_valid.
    
    However, returning NULL is common practice to indicate errors.
    
    This patch refactors the dm code, so that dm_table_find_target returns
    NULL and its callers test the returned value for NULL. The macro
    dm_target_is_valid is deleted. In alloc_targets, we no longer allocate an
    extra zeroed target.
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    123d87d5
dm.h 6.64 KB