OSDN Git Service

rbd: encapsulate code that gets snapshot info
authorAlex Elder <elder@inktank.com>
Tue, 3 Jul 2012 21:01:19 +0000 (16:01 -0500)
committerAlex Elder <elder@inktank.com>
Mon, 1 Oct 2012 19:30:53 +0000 (14:30 -0500)
commitcd892126c617b3837b6088bf6c097ad2def4de83
tree769239813e121ed6191ca8d3db3dd8d23ec76f4d
parent34b131849feb359f183907b467e9aa4d652b1baa
rbd: encapsulate code that gets snapshot info

Create a function that encapsulates looking up the name, size and
features related to a given snapshot, which is indicated by its
index in an rbd device's snapshot context array of snapshot ids.

This interface will be used to hide differences between the format 1
and format 2 images.

At the moment this (looking up the name anyway) is slightly less
efficient than what's done currently, but we may be able to optimize
this a bit later on by cacheing the last lookup if it proves to be a
problem.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c