mirror of
https://github.com/ceph/ceph
synced 2025-01-15 23:43:06 +00:00
Merge pull request #25766 from tchaikov/wip-rgw-readdir-flags
pybind/rgw: pass the flags to callback function Reviewed-by: Matt Benjamin <mbenjami@redhat.com>
This commit is contained in:
commit
a3e37c2019
@ -154,6 +154,9 @@
|
||||
* librados::IoCtx::nobjects_begin() and librados::NObjectIterator now communicate
|
||||
errors by throwing a std::system_error exception instead of std::runtime_error.
|
||||
|
||||
* the callback function passed to LibRGWFS.readdir() now accepts a ``flags``
|
||||
parameter. it will be the last parameter passed to ``readdir()` method.
|
||||
|
||||
>=13.1.0
|
||||
--------
|
||||
|
||||
|
@ -144,7 +144,7 @@ cdef extern from "rados/rgw_file.h" nogil:
|
||||
|
||||
int rgw_readdir(rgw_fs *fs,
|
||||
rgw_file_handle *parent_fh, uint64_t *offset,
|
||||
bool (*cb)(const char *name, void *arg, uint64_t offset) nogil except? -9000,
|
||||
bool (*cb)(const char *name, void *arg, uint64_t offset, uint32_t flags) nogil except? -9000,
|
||||
void *cb_arg, bool *eof, uint32_t flags) except? -9000
|
||||
|
||||
int rgw_getattr(rgw_fs *fs,
|
||||
@ -314,11 +314,11 @@ cdef make_ex(ret, msg):
|
||||
return Error(msg + (": error code %d" % ret))
|
||||
|
||||
|
||||
cdef bool readdir_cb(const char *name, void *arg, uint64_t offset) \
|
||||
cdef bool readdir_cb(const char *name, void *arg, uint64_t offset, uint32_t flags) \
|
||||
except? -9000 with gil:
|
||||
if exc.PyErr_Occurred():
|
||||
return False
|
||||
(<object>arg)(name, offset)
|
||||
(<object>arg)(name, offset, flags)
|
||||
return True
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ def setup_test():
|
||||
except Exception:
|
||||
root_dir_handler = rgwfs.mkdir(root_handler, b"bucket", 0)
|
||||
|
||||
def cb(name, offset):
|
||||
def cb(name, offset, flags):
|
||||
names.append(name)
|
||||
rgwfs.readdir(root_dir_handler, cb, 0, 0)
|
||||
for name in names:
|
||||
|
Loading…
Reference in New Issue
Block a user