mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: add functions for initializing global variables
When the rbd-driver starts, it initializes some global (yuck!) variables in the rbd package. Because the rbd-driver is moved out into its own package, these variables can not easily be set anymore. Introcude SetGlobalInt(), SetGlobalBool() and InitJournals() so that the rbd-driver can configure the rbd package. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
3eeac3d36c
commit
8b531f337e
@ -200,34 +200,30 @@ type migrationVolID struct {
|
||||
clusterID string
|
||||
}
|
||||
|
||||
var (
|
||||
supportedFeatures = map[string]imageFeature{
|
||||
librbd.FeatureNameLayering: {
|
||||
needRbdNbd: false,
|
||||
},
|
||||
librbd.FeatureNameExclusiveLock: {
|
||||
needRbdNbd: false,
|
||||
},
|
||||
librbd.FeatureNameObjectMap: {
|
||||
needRbdNbd: false,
|
||||
dependsOn: []string{librbd.FeatureNameExclusiveLock},
|
||||
},
|
||||
librbd.FeatureNameFastDiff: {
|
||||
needRbdNbd: false,
|
||||
dependsOn: []string{librbd.FeatureNameObjectMap},
|
||||
},
|
||||
librbd.FeatureNameJournaling: {
|
||||
needRbdNbd: true,
|
||||
dependsOn: []string{librbd.FeatureNameExclusiveLock},
|
||||
},
|
||||
}
|
||||
var supportedFeatures = map[string]imageFeature{
|
||||
librbd.FeatureNameLayering: {
|
||||
needRbdNbd: false,
|
||||
},
|
||||
librbd.FeatureNameExclusiveLock: {
|
||||
needRbdNbd: false,
|
||||
},
|
||||
librbd.FeatureNameObjectMap: {
|
||||
needRbdNbd: false,
|
||||
dependsOn: []string{librbd.FeatureNameExclusiveLock},
|
||||
},
|
||||
librbd.FeatureNameFastDiff: {
|
||||
needRbdNbd: false,
|
||||
dependsOn: []string{librbd.FeatureNameObjectMap},
|
||||
},
|
||||
librbd.FeatureNameJournaling: {
|
||||
needRbdNbd: true,
|
||||
dependsOn: []string{librbd.FeatureNameExclusiveLock},
|
||||
},
|
||||
}
|
||||
|
||||
krbdFeatures uint64 // krbd features supported by the loaded driver.
|
||||
)
|
||||
|
||||
// getKrbdSupportedFeatures load the module if needed and return supported
|
||||
// GetKrbdSupportedFeatures load the module if needed and return supported
|
||||
// features attribute as a string.
|
||||
func getKrbdSupportedFeatures() (string, error) {
|
||||
func GetKrbdSupportedFeatures() (string, error) {
|
||||
// check if the module is loaded or compiled in
|
||||
_, err := os.Stat(krbdSupportedFeaturesFile)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user