From: Alex Elder Date: Tue, 30 Apr 2013 05:44:33 +0000 (-0500) Subject: rbd: use snap_id not index to look up snap info X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~26^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54cac61fb6b3bacecf5367d3838307b1dd69ace2;p=pandora-kernel.git rbd: use snap_id not index to look up snap info In order to align with what was needed for format 1 rbd images, rbd_dev_v2_snap_info() was set up to take as argument an index into the array of snapshot ids in a rbd device's snapshot context. This switches that around, so we pass the snapshot id instead. In doing this, rbd_snap_name() now returns a dynamically-allocated string rather than a fixed one, so there's no need to make a duplicate in its caller, rbd_dev_spec_update(). This means the following functions take a snapshot id where they previously used an index value: rbd_dev_snap_info() rbd_dev_v1_snap_info() rbd_dev_v2_snap_info() A new function, rbd_dev_snap_index(), determines the snap index for format 1 images and uses it to look up the name. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- Reading git-diff-tree failed