• Mike Snitzer's avatar
    dm table: fix discard support · 936688d7
    Mike Snitzer authored
    Remove 'discards_supported' from the dm_table structure.  The same
    information can be easily discovered from the table's target(s) in
    dm_table_supports_discards().
    
    Before this fix dm_table_supports_discards() would skip checking the
    individual targets' 'discards_supported' flag if any one target in the
    table didn't set num_discard_requests > 0.  Now the per-target
    'discards_supported' flag is effective at insuring the final DM device
    advertises discard support.  But, to be clear, targets that don't
    support discards (!num_discard_requests) will not receive discard
    requests.
    
    Also DMWARN if a target sets 'discards_supported' override but forgets
    to set 'num_discard_requests'.
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    936688d7
dm.c 58.6 KB