]> Pileus Git - ~andy/linux/commit
rbd: define rbd_snap_size() and rbd_snap_features()
authorAlex Elder <elder@inktank.com>
Tue, 30 Apr 2013 05:44:33 +0000 (00:44 -0500)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:20:20 +0000 (21:20 -0700)
commit2ad3d7167e599fb149ed370a3128140b9deabd5a
tree56648210aec482269e5da1986cf1738a71bab164
parent54cac61fb6b3bacecf5367d3838307b1dd69ace2
rbd: define rbd_snap_size() and rbd_snap_features()

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: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c