• Alex Elder's avatar
    rbd: don't register snapshots in bus_add_dev() · cd789ab9
    Alex Elder authored
    When rbd_bus_add_dev() is called (one spot--in rbd_add()), the rbd
    image header has not even been read yet.  This means that the list
    of snapshots will be empty at the time of the call.  As a result,
    there is no need for the code that calls rbd_register_snap_dev()
    for each entry in that list--so get rid of it.
    
    Once the header has been read (just after returning), a call will
    be made to rbd_dev_snap_devs_update(), which will then find every
    snapshot in the context to be new and will therefore call
    rbd_register_snap_dev() via __rbd_add_snap_dev() accomplishing
    the same thing.
    Signed-off-by: default avatarAlex Elder <elder@inktank.com>
    Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
    cd789ab9
rbd.c 64.8 KB