summaryrefslogtreecommitdiff
path: root/net/batman-adv
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-07-11 01:30:11 (GMT)
committerAlex Elder <elder@inktank.com>2012-10-01 19:30:52 (GMT)
commite86924a8092fda66b859f12a4d7d37a4a458d74a (patch)
treef6b012ea7de1127798d08969e4f9b09cf9989175 /net/batman-adv
parentcd789ab9cacbda1aad43304b89cff29004b793ea (diff)
downloadlinux-e86924a8092fda66b859f12a4d7d37a4a458d74a.tar.xz
rbd: use snaps list in rbd_snap_by_name()
An rbd_dev structure maintains a list of current snapshots that have already been fully initialized. The entries on the list have type struct rbd_snap, and each entry contains a copy of information that's found in the rbd_dev's snapshot context and header. The only caller of snap_by_name() is rbd_header_set_snap(). In that call site any positive return value (the index in the snapshot array) is ignored, so there's no need to return the index in the snapshot context's id array when it's found. rbd_header_set_snap() also has only one caller--rbd_add()--and that call is made after a call to rbd_dev_snap_devs_update(). Because the rbd_snap structures are initialized in that function, the current snapshot list can be used instead of the snapshot context to look up a snapshot's information by name. Change snap_by_name() so it uses the snapshot list rather than the rbd_dev's snapshot context in looking up snapshot information. Return 0 if it's found rather than the snapshot id. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/batman-adv')
0 files changed, 0 insertions, 0 deletions