mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: export HexStringToInteger()
HexStringToInteger() used to return a uint64, but everywhere else uint is used. Having HexStringToInteger() return a uint as well makes it a little easier to use when setting it with SetGlobalInt(). Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
8b531f337e
commit
44d69502bc
@ -250,8 +250,8 @@ func GetKrbdSupportedFeatures() (string, error) {
|
||||
return strings.TrimSuffix(string(val), "\n"), nil
|
||||
}
|
||||
|
||||
// hexStringToInteger convert hex value to uint.
|
||||
func hexStringToInteger(hexString string) (uint64, error) {
|
||||
// HexStringToInteger convert hex value to uint.
|
||||
func HexStringToInteger(hexString string) (uint, error) {
|
||||
// trim 0x prefix
|
||||
numberStr := strings.TrimPrefix(strings.ToLower(hexString), "0x")
|
||||
|
||||
@ -262,7 +262,7 @@ func hexStringToInteger(hexString string) (uint64, error) {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return output, nil
|
||||
return uint(output), nil
|
||||
}
|
||||
|
||||
// isKrbdFeatureSupported checks if a given Image Feature is supported by krbd
|
||||
@ -274,7 +274,7 @@ func isKrbdFeatureSupported(ctx context.Context, imageFeatures string) bool {
|
||||
|
||||
supported := true
|
||||
for _, featureName := range imageFeatureSet.Names() {
|
||||
if (uint64(librbd.FeatureSetFromNames(strings.Split(featureName, " "))) & krbdFeatures) == 0 {
|
||||
if (uint(librbd.FeatureSetFromNames(strings.Split(featureName, " "))) & krbdFeatures) == 0 {
|
||||
supported = false
|
||||
log.ErrorLog(ctx, "krbd feature %q not supported", featureName)
|
||||
|
||||
|
Reference in New Issue
Block a user