from .template import SubvolumeOpType
from .versions import loaded_subvolumes
-def create_subvol(mgr, fs, vol_spec, group, subvolname, size, isolate_nspace, pool, mode, uid, gid, earmark, normalization):
+def create_subvol(mgr, fs, vol_spec, group, subvolname, size, isolate_nspace, pool, mode, uid, gid, earmark, normalization, case_insensitive):
"""
create a subvolume (create a subvolume with the max known version).
:param gid: the group identifier
:param earmark: metadata string to identify if subvolume is associated with nfs/smb
:param normalization: the unicode normalization form to use (nfd, nfc, nfkd or nfkc)
+ :param case_insensitive: whether to make the subvolume case insensitive or not
:return: None
"""
subvolume = loaded_subvolumes.get_subvolume_object_max(mgr, fs, vol_spec, group, subvolname)
- subvolume.create(size, isolate_nspace, pool, mode, uid, gid, earmark, normalization)
+ subvolume.create(size, isolate_nspace, pool, mode, uid, gid, earmark, normalization, case_insensitive)
def create_clone(mgr, fs, vol_spec, group, subvolname, pool, source_volume, source_subvolume, snapname):
""" Path to user data directory within a subvolume snapshot named 'snapname' """
return self.snapshot_path(snapname)
- def create(self, size, isolate_nspace, pool, mode, uid, gid, earmark, normalization):
+ def create(self, size, isolate_nspace, pool, mode, uid, gid, earmark, normalization, case_insensitive):
subvolume_type = SubvolumeTypes.TYPE_NORMAL
try:
initial_state = SubvolumeOpSm.get_init_state(subvolume_type)
'quota': size,
'earmark': earmark,
'normalization': normalization,
+ 'case_insensitive': case_insensitive,
}
self.set_attrs(subvol_path, attrs)
self.metadata_mgr.update_global_section(MetadataManager.GLOBAL_META_KEY_PATH, qpath)
self.metadata_mgr.update_global_section(MetadataManager.GLOBAL_META_KEY_STATE, initial_state.value)
- def create(self, size, isolate_nspace, pool, mode, uid, gid, earmark, normalization):
+ def create(self, size, isolate_nspace, pool, mode, uid, gid, earmark, normalization, case_insensitive):
subvolume_type = SubvolumeTypes.TYPE_NORMAL
try:
initial_state = SubvolumeOpSm.get_init_state(subvolume_type)
'quota': size,
'earmark': earmark,
'normalization': normalization,
+ 'case_insensitive': case_insensitive,
}
self.set_attrs(subvol_path, attrs)
isolate_nspace = kwargs['namespace_isolated']
earmark = kwargs['earmark'] or '' # if not set, default to empty string --> no earmark
normalization = kwargs['normalization']
+ case_insensitive = kwargs['case_insensitive']
oct_mode = octal_str_to_decimal_int(mode)
try:
create_subvol(
- self.mgr, fs_handle, self.volspec, group, subvolname, size, isolate_nspace, pool, oct_mode, uid, gid, earmark, normalization)
+ self.mgr, fs_handle, self.volspec, group, subvolname, size, isolate_nspace, pool, oct_mode, uid, gid, earmark, normalization, case_insensitive)
except VolumeException as ve:
# kick the purge threads for async removal -- note that this
# assumes that the subvolume is moved to trashcan for cleanup on error.
isolate_nspace = kwargs['namespace_isolated']
earmark = kwargs['earmark'] or '' # if not set, default to empty string --> no earmark
normalization = kwargs['normalization']
+ case_insensitive = kwargs['case_insensitive']
try:
with open_volume(self, volname) as fs_handle:
'quota': size,
'earmark': earmark,
'normalization': normalization,
+ 'case_insensitive': case_insensitive,
}
subvolume.set_attrs(subvolume.path, attrs)
except VolumeException as ve:
'name=mode,type=CephString,req=false '
'name=namespace_isolated,type=CephBool,req=false '
'name=earmark,type=CephString,req=false '
- 'name=normalization,type=CephChoices,strings=nfd|nfc|nfkd|nfkc,req=false ',
+ 'name=normalization,type=CephChoices,strings=nfd|nfc|nfkd|nfkc,req=false '
+ 'name=case_insensitive,type=CephBool,req=false ',
'desc': "Create a CephFS subvolume in a volume, and optionally, "
"with a specific size (in bytes), a specific data pool layout, "
"a specific mode, in a specific subvolume group and in separate "
mode=cmd.get('mode', '755'),
namespace_isolated=cmd.get('namespace_isolated', False),
earmark=cmd.get('earmark', None),
- normalization=cmd.get('normalization', None))
+ normalization=cmd.get('normalization', None),
+ case_insensitive=cmd.get('case_insensitive', False))
@mgr_cmd_wrap
def _cmd_fs_subvolume_rm(self, inbuf, cmd):