diff options
author | Alex Elder <elder@inktank.com> | 2012-08-31 17:29:52 -0500 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-10-01 14:30:52 -0500 |
commit | 304f68086f8206da7c5930a9cb0207c91d1983a6 (patch) | |
tree | 915bdd3d884dd36fb62acd4e761e98191d001f98 /drivers/atm | |
parent | 3fcf2581c2c3c910aa46f6d205e502a97243ca2c (diff) |
rbd: defer registering snapshot devices
When a new snapshot is found in an rbd device's updated snapshot
context, __rbd_add_snap_dev() is called to create and insert an
entry in the rbd devices list of snapshots. In addition, a Linux
device is registered to represent the snapshot.
For version 2 rbd images, it will be undesirable to initialize the
device right away. So in anticipation of that, this patch separates
the insertion of a snapshot entry in the snaps list from the
creation of devices for those snapshots.
To do this, create a new function rbd_dev_snaps_register() which
traverses the list of snapshots and calls rbd_register_snap_dev()
on any that have not yet been registered.
Rename rbd_dev_snap_devs_update() to be rbd_dev_snaps_update()
to better reflect that only the entry in the snaps list and not
the snapshot's device is affected by the function.
For now, call rbd_dev_snaps_register() immediately after each
call to rbd_dev_snaps_update().
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/atm')
0 files changed, 0 insertions, 0 deletions