Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 932722 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 932722