]> 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)
committerVenky Shankar <vshankar@redhat.com>
Thu, 9 Jan 2020 11:33:31 +0000 (06:33 -0500)
commit9b87bd72093eaecda5e2ffc3ed32e482431f9842
treeb8b8059fda088ff7a306be7cededa51f1bcae9cf
parent8a649148025620991a67ed761153f18594f5268c
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>
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