Skip to content
  • Eric Blake's avatar
    e3efee82
    nvme: Drop pointless .bdrv_co_get_block_status() · e3efee82
    Eric Blake authored
    
    
    Commit bdd6a90a has a bug: drivers should never directly set
    BDRV_BLOCK_ALLOCATED, but only io.c should do that (as needed).
    Instead, drivers should report BDRV_BLOCK_DATA if it knows that
    data comes from this BDS.
    
    But let's look at the bigger picture: semantically, the nvme
    driver is similar to the nbd, null, and raw drivers (no backing
    file, all data comes from this BDS).  But while two of those
    other drivers have to supply the callback (null because it can
    special-case BDRV_BLOCK_ZERO, raw because it can special-case
    a different offset), in this case the block layer defaults are
    good enough without the callback at all (similar to nbd).
    
    So, fix the bug by deletion ;)
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    e3efee82
    nvme: Drop pointless .bdrv_co_get_block_status()
    Eric Blake authored
    
    
    Commit bdd6a90a has a bug: drivers should never directly set
    BDRV_BLOCK_ALLOCATED, but only io.c should do that (as needed).
    Instead, drivers should report BDRV_BLOCK_DATA if it knows that
    data comes from this BDS.
    
    But let's look at the bigger picture: semantically, the nvme
    driver is similar to the nbd, null, and raw drivers (no backing
    file, all data comes from this BDS).  But while two of those
    other drivers have to supply the callback (null because it can
    special-case BDRV_BLOCK_ZERO, raw because it can special-case
    a different offset), in this case the block layer defaults are
    good enough without the callback at all (similar to nbd).
    
    So, fix the bug by deletion ;)
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading