From 98afaf6376393ce596076f9339dc3d1891a6fd7e Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Mon, 30 Nov 2020 15:44:03 -0500 Subject: [PATCH] cephfs admin: rename rmFlags type to commonRmFlags This is to clarify that for "normal" cases the private commonRmFlags type is correct. Signed-off-by: John Mulligan --- cephfs/admin/flags.go | 4 ++-- cephfs/admin/subvolume.go | 12 ++++++------ cephfs/admin/subvolumegroup.go | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cephfs/admin/flags.go b/cephfs/admin/flags.go index ce753d7..db1f9f9 100644 --- a/cephfs/admin/flags.go +++ b/cephfs/admin/flags.go @@ -2,11 +2,11 @@ package admin -type rmFlags struct { +type commonRmFlags struct { force bool } -func (f rmFlags) Update(m map[string]string) map[string]interface{} { +func (f commonRmFlags) Update(m map[string]string) map[string]interface{} { o := make(map[string]interface{}) for k, v := range m { o[k] = v diff --git a/cephfs/admin/subvolume.go b/cephfs/admin/subvolume.go index b0d6935..176a90b 100644 --- a/cephfs/admin/subvolume.go +++ b/cephfs/admin/subvolume.go @@ -87,7 +87,7 @@ func (fsa *FSAdmin) ListSubVolumes(volume, group string) ([]string, error) { // Similar To: // ceph fs subvolume rm --group-name= func (fsa *FSAdmin) RemoveSubVolume(volume, group, name string) error { - return fsa.rmSubVolume(volume, group, name, rmFlags{}) + return fsa.rmSubVolume(volume, group, name, commonRmFlags{}) } // ForceRemoveSubVolume will delete a CephFS subvolume in a volume and optional @@ -96,10 +96,10 @@ func (fsa *FSAdmin) RemoveSubVolume(volume, group, name string) error { // Similar To: // ceph fs subvolume rm --group-name= --force func (fsa *FSAdmin) ForceRemoveSubVolume(volume, group, name string) error { - return fsa.rmSubVolume(volume, group, name, rmFlags{force: true}) + return fsa.rmSubVolume(volume, group, name, commonRmFlags{force: true}) } -func (fsa *FSAdmin) rmSubVolume(volume, group, name string, o rmFlags) error { +func (fsa *FSAdmin) rmSubVolume(volume, group, name string, o commonRmFlags) error { m := map[string]string{ "prefix": "fs subvolume rm", "vol_name": volume, @@ -264,7 +264,7 @@ func (fsa *FSAdmin) CreateSubVolumeSnapshot(volume, group, source, name string) // Similar To: // ceph fs subvolume snapshot rm --group-name= func (fsa *FSAdmin) RemoveSubVolumeSnapshot(volume, group, subvolume, name string) error { - return fsa.rmSubVolumeSnapshot(volume, group, subvolume, name, rmFlags{}) + return fsa.rmSubVolumeSnapshot(volume, group, subvolume, name, commonRmFlags{}) } // ForceRemoveSubVolumeSnapshot removes the specified snapshot from the subvolume. @@ -272,10 +272,10 @@ func (fsa *FSAdmin) RemoveSubVolumeSnapshot(volume, group, subvolume, name strin // Similar To: // ceph fs subvolume snapshot rm --group-name= --force func (fsa *FSAdmin) ForceRemoveSubVolumeSnapshot(volume, group, subvolume, name string) error { - return fsa.rmSubVolumeSnapshot(volume, group, subvolume, name, rmFlags{force: true}) + return fsa.rmSubVolumeSnapshot(volume, group, subvolume, name, commonRmFlags{force: true}) } -func (fsa *FSAdmin) rmSubVolumeSnapshot(volume, group, subvolume, name string, o rmFlags) error { +func (fsa *FSAdmin) rmSubVolumeSnapshot(volume, group, subvolume, name string, o commonRmFlags) error { m := map[string]string{ "prefix": "fs subvolume snapshot rm", diff --git a/cephfs/admin/subvolumegroup.go b/cephfs/admin/subvolumegroup.go index 0e2caf9..d1209cf 100644 --- a/cephfs/admin/subvolumegroup.go +++ b/cephfs/admin/subvolumegroup.go @@ -69,17 +69,17 @@ func (fsa *FSAdmin) ListSubVolumeGroups(volume string) ([]string, error) { // Similar To: // ceph fs subvolumegroup rm func (fsa *FSAdmin) RemoveSubVolumeGroup(volume, name string) error { - return fsa.rmSubVolumeGroup(volume, name, rmFlags{}) + return fsa.rmSubVolumeGroup(volume, name, commonRmFlags{}) } // ForceRemoveSubVolumeGroup will delete a subvolume group in a volume. // Similar To: // ceph fs subvolumegroup rm --force func (fsa *FSAdmin) ForceRemoveSubVolumeGroup(volume, name string) error { - return fsa.rmSubVolumeGroup(volume, name, rmFlags{force: true}) + return fsa.rmSubVolumeGroup(volume, name, commonRmFlags{force: true}) } -func (fsa *FSAdmin) rmSubVolumeGroup(volume, name string, o rmFlags) error { +func (fsa *FSAdmin) rmSubVolumeGroup(volume, name string, o commonRmFlags) error { res := fsa.marshalMgrCommand(o.Update(map[string]string{ "prefix": "fs subvolumegroup rm", "vol_name": volume,