]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/vol: use more precise name for mark_subvolume()
authorRishabh Dave <ridave@redhat.com>
Sat, 29 Mar 2025 13:42:05 +0000 (19:12 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 21 Nov 2025 05:46:43 +0000 (11:16 +0530)
mark_subvolume() is a pretty non-transparent name as it doesn't tell
what this method marks the subvolume with. A better name will make it
easier to read thos code and modify it in upcoming commits.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py

index ae1c7fe93b4deed3de6de8efee0d2efe9151c623..f64ee87643819c7b9319b949f7a23eef6f240114 100644 (file)
@@ -92,7 +92,7 @@ class SubvolumeV2(SubvolumeV1):
             else:
                 raise VolumeException(-e.args[0], e.args[1])
 
-    def mark_subvolume(self):
+    def set_subvol_xattr(self):
         # set subvolume attr, on subvolume root, marking it as a CephFS subvolume
         # subvolume root is where snapshots would be taken, and hence is the base_path for v2 subvolumes
         try:
@@ -169,7 +169,7 @@ class SubvolumeV2(SubvolumeV1):
             # create group directory with default mode(0o755) if it doesn't exist.
             create_base_dir(self.fs, self.group.path, self.vol_spec.DEFAULT_MODE)
             self.fs.mkdirs(subvol_path, mode)
-            self.mark_subvolume()
+            self.set_subvol_xattr()
             attrs = {
                 'uid': uid,
                 'gid': gid,
@@ -236,7 +236,7 @@ class SubvolumeV2(SubvolumeV1):
 
             # create directory and set attributes
             self.fs.mkdirs(subvol_path, attrs.get("mode"))
-            self.mark_subvolume()
+            self.set_subvol_xattr()
             self.set_attrs(subvol_path, attrs)
 
             # persist subvolume metadata and clone source
@@ -304,7 +304,7 @@ class SubvolumeV2(SubvolumeV1):
         try:
             self.metadata_mgr.refresh()
             # unconditionally mark as subvolume, to handle pre-existing subvolumes without the mark
-            self.mark_subvolume()
+            self.set_subvol_xattr()
 
             etype = self.subvol_type
             if op_type not in self.allowed_ops_by_type(etype):