We have several API functions that allow the caller to request I/Os
larger than INT_MAX bytes, but that return an int. Ensure that we don't
try to do more I/O than we can represent in the return value.
Tracker: http://tracker.ceph.com/issues/22948
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Break the core of _preadv_pwritev out into a function that takes a Fh.
Make _preadv_pwritev into a wrapper around that.
Then add in plumbing for ceph_ll_readv and ceph_ll_writev.
Tracker: http://tracker.ceph.com/issues/22948
Signed-off-by: Jeff Layton <jlayton@redhat.com>
In the read codepath, bl->length() returns an unsigned value, and that
could end up looking negative when cast to int. On the write side,
totalwritten is a uint64_t, which could look negative when cast to int.
Have the underlying layers pass back an int64_t and convert them to
int at a higher level. This prepares the underlying infrastructure for
ceph_ll_readv and ceph_ll_writev support.
Tracker: http://tracker.ceph.com/issues/22948
Signed-off-by: Jeff Layton <jlayton@redhat.com>
otherwise we need to tackle with the circular import. it's not fatal, if
we can "import foo" in py2 and "from . import foo" in py3, respectively.
but we cannot unify them using "from . import foo", because the circular
reference issue. and conditionalize the import statement is ugly. so, i
think we'd better break the loop. so i am moving the "instance" variable
into its own file.
Signed-off-by: Kefu Chai <kchai@redhat.com>
we should not hardwire cython_modules's path to lib.2, it should be
cython_modules/lib.3 if ceph-mgr requires python3.
Signed-off-by: Kefu Chai <kchai@redhat.com>
no need to add them for each sub-interpreter. extensions are shared
among them.
Fixes: http://tracker.ceph.com/issues/22880
Signed-off-by: Kefu Chai <kchai@redhat.com>
* in python3, we cannot assume default relative import. instead, we should
be explicit. also, only import the `Module` and `StandbyModule` classes
from plugins, as they are what we are interested.
* and import urllib.parse in python3.
Fixes: http://tracker.ceph.com/issues/22880
Signed-off-by: Kefu Chai <kchai@redhat.com>
mon/OSDMonitor: Comment out unused function
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: Kefu Chai <kchai@redhat.com>
Test whether we're building with libstdc++ or libc++.
Use stdc++filesystem if the former and c++experimental if the later.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
to workaround buggy libc++ implementation. see
https://cplusplus.github.io/LWG/issue2807 . we should switch to
invoke_result_t once issue2807 is fixed in the latest release of
libc++.
Signed-off-by: Kefu Chai <kchai@redhat.com>
test/rbd: cli_generic fails if v1 image format or deep-flatten disabled
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Mykola Golub <mgolub@suse.com>
Key normalization involves some copying and strlens, and these are
expensive.
Check if key contain whitespaces, normalize it only when it does.
Signed-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>