We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8be184a + a49d154 commit d5457a2Copy full SHA for d5457a2
src/pybind/rbd/c_rbd.pxd
@@ -2,6 +2,7 @@
2
3
from libc.stdint cimport *
4
from ctime cimport time_t, timespec
5
+cimport libcpp
6
7
cdef extern from "rados/librados.h":
8
enum:
@@ -525,7 +526,7 @@ cdef extern from "rbd/librbd.h" nogil:
525
526
int rbd_snap_unprotect(rbd_image_t image, const char *snap_name)
527
int rbd_snap_is_protected(rbd_image_t image, const char *snap_name,
528
int *is_protected)
- int rbd_snap_exists(rbd_image_t image, const char *snapname, bint *exists)
529
+ int rbd_snap_exists(rbd_image_t image, const char *snapname, libcpp.bool *exists)
530
int rbd_snap_get_limit(rbd_image_t image, uint64_t *limit)
531
int rbd_snap_set_limit(rbd_image_t image, uint64_t limit)
532
int rbd_snap_get_timestamp(rbd_image_t image, uint64_t snap_id, timespec *timestamp)
@@ -711,7 +712,7 @@ cdef extern from "rbd/librbd.h" nogil:
711
712
int rbd_namespace_list(rados_ioctx_t io, char *namespace_names,
713
size_t *size)
714
int rbd_namespace_exists(rados_ioctx_t io, const char *namespace_name,
- bint *exists)
715
+ libcpp.bool *exists)
716
717
int rbd_pool_init(rados_ioctx_t, bint force)
718
src/pybind/rbd/mock_rbd.pxi
@@ -3,6 +3,11 @@
+# Make the bool type available as libcpp.bool, for both C and C++.
+cdef extern from "<stdbool.h>":
9
+ pass
10
+
11
cdef nogil:
12
13
_LIBRADOS_SNAP_HEAD "LIBRADOS_SNAP_HEAD"
@@ -637,7 +642,7 @@ cdef nogil:
637
642
638
643
int *is_protected):
639
644
pass
640
- int rbd_snap_exists(rbd_image_t image, const char *snapname, bint *exists):
645
+ int rbd_snap_exists(rbd_image_t image, const char *snapname, libcpp.bool *exists):
641
646
647
int rbd_snap_get_limit(rbd_image_t image, uint64_t *limit):
648
@@ -896,7 +901,7 @@ cdef nogil:
896
901
size_t *size):
897
902
898
903
899
- bint *exists):
904
+ libcpp.bool *exists):
900
905
906
int rbd_pool_init(rados_ioctx_t io, bint force):
907
src/pybind/rbd/rbd.pyx
@@ -23,6 +23,7 @@ from libc cimport errno
23
24
from libc.stdlib cimport malloc, realloc, free
25
from libc.string cimport strdup, memset
26
27
28
try:
29
from collections.abc import Iterable
@@ -1935,12 +1936,12 @@ class RBD(object):
1935
1936
cdef:
1937
rados_ioctx_t _ioctx = convert_ioctx(ioctx)
1938
const char *_name = name
- bint _exists = False
1939
+ libcpp.bool _exists = False
1940
with nogil:
1941
ret = rbd_namespace_exists(_ioctx, _name, &_exists)
1942
if ret != 0:
1943
raise make_ex(ret, 'error verifying namespace')
- return bool(_exists != 0)
1944
+ return _exists
1945
1946
def namespace_list(self, ioctx):
1947
"""
@@ -3679,12 +3680,12 @@ cdef class Image(object):
3679
3680
name = cstr(name, 'name')
3681
3682
char *_name = name
3683
3684
3685
ret = rbd_snap_exists(self.image, _name, &_exists)
3686
3687
raise make_ex(ret, 'error getting snapshot exists for %s' % self.name)
3688
3689
3690
@requires_not_closed
3691
def get_snap_limit(self):
src/pybind/rgw/mock_rgw.pxi
@@ -1,5 +1,10 @@
1
# cython: embedsignature=True
ctypedef void* librgw_t
@@ -111,8 +116,8 @@ cdef nogil:
111
116
112
117
int rgw_readdir(rgw_fs *fs,
113
118
rgw_file_handle *parent_fh, uint64_t *offset,
114
- bint (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
115
- void *cb_arg, bint *eof, uint32_t flags) except? -9000:
119
+ libcpp.bool (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
120
+ void *cb_arg, libcpp.bool *eof, uint32_t flags) except? -9000:
121
122
123
int rgw_getattr(rgw_fs *fs,
src/pybind/rgw/rgw.pyx
@@ -7,6 +7,7 @@ from cpython cimport PyObject, ref, exc, array
from cstat cimport stat
IF BUILD_DOC:
include "mock_rgw.pxi"
@@ -373,7 +374,7 @@ cdef class LibRGWFS(object):
373
374
375
rgw_file_handle *_dir_handler = <rgw_file_handle*>dir_handler.handler
376
uint64_t _offset = offset
- bint _eof
377
+ libcpp.bool _eof
378
uint32_t _flags = flags
379
380
ret = rgw_readdir(self.fs, _dir_handler, &_offset, &readdir_cb,
src/tracing/librados.tp
@@ -2628,7 +2628,7 @@ TRACEPOINT_EVENT(librados, rados_watch3_enter,
2628
TP_FIELDS(
2629
ctf_integer_hex(rados_ioctx_t, ioctx, ioctx)
2630
ctf_string(oid, oid)
2631
- ctf_integer_hex(uint64_t, phandle, phandle)
+ ctf_integer_hex(uint64_t*, phandle, phandle)
2632
ctf_integer_hex(rados_watchcb2_t, callback, callback)
2633
ctf_integer(uint32_t, timeout, timeout)
2634
ctf_integer_hex(void*, arg, arg)
@@ -2658,7 +2658,7 @@ TRACEPOINT_EVENT(librados, rados_aio_watch2_enter,
2658
2659
2660
ctf_integer_hex(rados_completion_t, completion, completion)
2661
2662
2663
2664
src/tracing/tracing-common.h
@@ -21,7 +21,7 @@
21
// type should be an integer type
22
// val should have type type*
#define ceph_ctf_integerp(type, field, val) \
- ctf_integer(type, field, (val) == NULL ? 0 : (val)) \
+ ctf_integer(type, field, (val) == NULL ? 0 : *(val)) \
ctf_integer(uint8_t, field##_isnull, (val) == NULL)
// val should have type char*
0 commit comments