]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rbd: don't register snapshots in bus_add_dev()
authorAlex Elder <elder@inktank.com>
Thu, 30 Aug 2012 05:16:38 +0000 (00:16 -0500)
committerAlex Elder <elder@inktank.com>
Mon, 1 Oct 2012 19:30:52 +0000 (14:30 -0500)
commitcd789ab9cacbda1aad43304b89cff29004b793ea
tree1338d6dd30abd2b1828bc724c84599afbac9751e
parent4bb1f1ed0063870f34ae5783cda08924964bac0b
rbd: don't register snapshots in bus_add_dev()

When rbd_bus_add_dev() is called (one spot--in rbd_add()), the rbd
image header has not even been read yet.  This means that the list
of snapshots will be empty at the time of the call.  As a result,
there is no need for the code that calls rbd_register_snap_dev()
for each entry in that list--so get rid of it.

Once the header has been read (just after returning), a call will
be made to rbd_dev_snap_devs_update(), which will then find every
snapshot in the context to be new and will therefore call
rbd_register_snap_dev() via __rbd_add_snap_dev() accomplishing
the same thing.

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