• Alex Elder's avatar
    rbd: define rbd_snap_size() and rbd_snap_features() · 2ad3d716
    Alex Elder authored
    This patch defines a handful of new functions that will allow
    us to get rid of the rbd device structure's list of snapshots.
    
    Define rbd_snap_id_by_name() to look up a snapshot id given its
    name.  This is efficient for format 1 images but not for format 2.
    Fortunately it only gets called at mapping time so it's not that
    critical.
    
    Use rbd_snap_id_by_name() to find out the id for a snapshot getting
    mapped, and pass that id to new functions rbd_snap_size() and
    rbd_snap_features() to look up information about a given snapshot's
    size and feature mask given its snapshot id.  All this gets done
    in rbd_dev_mapping_set().
    
    As a result, snap_by_name() is no longer needed, so get rid of it.
    Signed-off-by: default avatarAlex Elder <elder@inktank.com>
    Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
    2ad3d716
rbd.c 133 KB