]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/volumes: tie everything together to implement versioned subvolumes
authorVenky Shankar <vshankar@redhat.com>
Wed, 20 Nov 2019 14:11:17 +0000 (09:11 -0500)
committerRamana Raja <rraja@redhat.com>
Wed, 12 Feb 2020 10:11:59 +0000 (05:11 -0500)
commitc21fa0c30fdd67aa007dd760a79cc93ca346cf64
tree00b68c8a44ac0ed4b19fe9ffa3de946a37b56137
parentca4cc7166ebc38fd923669174ce7c9b074d6975a
mgr/volumes: tie everything together to implement versioned subvolumes

apart from the new way of provisioning subvolumes, this makes heavy
use of context manager for volumes, groups and subvolumes.

this change classifies volumes, groups and subvolumes to be treated
as filesystem dentries and inodes. a "volume" can be thought as a
dentry with "groups" as it's entries (inodes). likewise, a "group"
is a dentry again with "subvolumes" as entries (inodes). this is
built into the access mechanism as follows:

      with open_volume(...) as fs_handle:
          with open_gorup(fs_handle, ...) as group:
              with open_subvolume(group, ...) as subvolume:
                  # call subvolume object API
                  path = subvolume.getpath()

this way, lot of redundant checks such as verifying if a volume or
group exist before accessing a subvolume is built right into the
access mechanism, plus, an added bonus of simple error handling.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 9b87bd72093eaecda5e2ffc3ed32e482431f9842)
src/pybind/mgr/volumes/fs/purge_queue.py
src/pybind/mgr/volumes/fs/subvolspec.py [deleted file]
src/pybind/mgr/volumes/fs/volume.py
src/pybind/mgr/volumes/module.py