mirror of
https://github.com/ceph/go-ceph
synced 2025-02-27 08:00:46 +00:00
rbd: convert NamespaceList for nautilus to use cutil.SplitSparseBuffer
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
4d2d6493af
commit
2a62588181
@ -13,9 +13,9 @@ package rbd
|
|||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/ceph/go-ceph/internal/cutil"
|
||||||
"github.com/ceph/go-ceph/internal/retry"
|
"github.com/ceph/go-ceph/internal/retry"
|
||||||
"github.com/ceph/go-ceph/rados"
|
"github.com/ceph/go-ceph/rados"
|
||||||
)
|
)
|
||||||
@ -100,12 +100,7 @@ func NamespaceList(ioctx *rados.IOContext) (names []string, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
tmpList := bytes.Split(buf[:cSize-1], []byte{0})
|
|
||||||
for _, s := range tmpList {
|
names = cutil.SplitSparseBuffer(buf[:cSize])
|
||||||
if len(s) > 0 {
|
|
||||||
name := C.GoString((*C.char)(unsafe.Pointer(&s[0])))
|
|
||||||
names = append(names, name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return names, nil
|
return names, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user