From: Patrick Donnelly Date: Sat, 13 Mar 2021 20:53:50 +0000 (-0800) Subject: Revert "libradosstriper: add function to read into char*" X-Git-Tag: v17.1.0~2521^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0092746c7d1d234da9a9ba8fd6e3822d98897c6;p=ceph.git Revert "libradosstriper: add function to read into char*" This reverts commit f7494cc1288dd4ba075975c110170e485c3e211b. This change is no longer needed. Signed-off-by: Patrick Donnelly --- diff --git a/src/include/radosstriper/libradosstriper.hpp b/src/include/radosstriper/libradosstriper.hpp index 064c7d2c3d84..fb790b0d7ef1 100644 --- a/src/include/radosstriper/libradosstriper.hpp +++ b/src/include/radosstriper/libradosstriper.hpp @@ -168,7 +168,6 @@ namespace libradosstriper * synchronously read from the striped object at the specified offset. */ int read(const std::string& soid, ceph::bufferlist* pbl, size_t len, uint64_t off); - int read(const std::string& soid, char *buf, size_t len, uint64_t off); /** * asynchronously read from the striped object at the specified offset. diff --git a/src/libradosstriper/libradosstriper.cc b/src/libradosstriper/libradosstriper.cc index 7f23a380550e..e98dfc17935a 100644 --- a/src/libradosstriper/libradosstriper.cc +++ b/src/libradosstriper/libradosstriper.cc @@ -254,28 +254,6 @@ int libradosstriper::RadosStriper::read(const std::string& soid, return rados_striper_impl->read(soid, bl, len, off); } -int libradosstriper::RadosStriper::read(const std::string& soid, - char *buf, - size_t len, - uint64_t off) -{ - bufferlist bl; - bufferptr bp = buffer::create_static(len, buf); - - bl.push_back(bp); - - int ret = rados_striper_impl->read(soid, &bl, len, off); - - if (ret >= 0) { - if (bl.length() > len) - return -ERANGE; - if (!bl.is_provided_buffer(buf)) - bl.begin().copy(bl.length(), buf); - ret = bl.length(); // hrm :/ - } - return ret; -} - int libradosstriper::RadosStriper::aio_read(const std::string& soid, librados::AioCompletion *c, bufferlist* bl,