summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/abx500-core.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-08-02 11:29:46 -0500
committerAlex Elder <elder@inktank.com>2012-10-01 14:30:48 -0500
commit3593815022998ab75379f64735ff67b3ea388cbe (patch)
tree12d4d1f392e5e45494e8ccb8162f4004d484b405 /drivers/mfd/abx500-core.c
parenta0d271cbfed1dd50278c6b06bead3d00ba0a88f9 (diff)
downloadblackbird-op-linux-3593815022998ab75379f64735ff67b3ea388cbe.tar.gz
blackbird-op-linux-3593815022998ab75379f64735ff67b3ea388cbe.zip
rbd: simplify __rbd_init_snaps_header()
The purpose of __rbd_init_snaps_header() is to compare a new snapshot context with an rbd device's list of existing snapshots. It updates the list by adding any new snapshots or removing any that are not present in the new snapshot context. The code as written is a little confusing, because it traverses both the existing snapshot list and the set of snapshots in the snapshot context in reverse. This was done based on an assumption about snapshots that is not true--namely that a duplicate snapshot name could cause an error in intepreting things if they were not processed in ascending order. These precautions are not necessary, because: - all snapshots are uniquely identified by their snapshot id - a new snapshot cannot be created if the rbd device has another snapshot with the same name (It is furthermore not currently possible to rename a snapshot.) This patch re-implements __rbd_init_snaps_header() so it passes through both the existing snapshot list and the entries in the snapshot context in forward order. It still does the same thing as before, but I find the logic considerably easier to understand. By going forward through the names in the snapshot context, there is no longer a need for the rbd_prev_snap_name() helper function. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/mfd/abx500-core.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud