From: Radoslaw Zarzynski Date: Tue, 11 Sep 2018 10:04:35 +0000 (+0200) Subject: common: drop buffer::list::read_fd_zero_copy. X-Git-Tag: v14.0.1~273^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7518eed56b4ff82f198073e40556a3ab27d53bb5;p=ceph.git common: drop buffer::list::read_fd_zero_copy. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index d5bf6703228b6..7068d9fc87753 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -2185,12 +2185,6 @@ int buffer::list::read_file(const char *fn, std::string *error) ssize_t buffer::list::read_fd(int fd, size_t len) { - // try zero copy first - if (false && read_fd_zero_copy(fd, len) == 0) { - // TODO fix callers to not require correct read size, which is not - // available for raw_pipe until we actually inspect the data - return 0; - } bufferptr bp = buffer::create(len); ssize_t ret = safe_read(fd, (void*)bp.c_str(), len); if (ret >= 0) { @@ -2200,22 +2194,6 @@ ssize_t buffer::list::read_fd(int fd, size_t len) return ret; } -int buffer::list::read_fd_zero_copy(int fd, size_t len) -{ -#ifdef CEPH_HAVE_SPLICE - try { - append(buffer::create_zero_copy(len, fd, NULL)); - } catch (buffer::error_code &e) { - return e.code; - } catch (buffer::malformed_input &e) { - return -EIO; - } - return 0; -#else - return -ENOTSUP; -#endif -} - int buffer::list::write_file(const char *fn, int mode) { int fd = TEMP_FAILURE_RETRY(::open(fn, O_WRONLY|O_CREAT|O_TRUNC, mode)); diff --git a/src/include/buffer.h b/src/include/buffer.h index 0fdbec51ac9db..c6590bc317901 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -934,7 +934,6 @@ namespace buffer CEPH_BUFFER_API { void hexdump(std::ostream &out, bool trailing_newline = true) const; int read_file(const char *fn, std::string *error); ssize_t read_fd(int fd, size_t len); - int read_fd_zero_copy(int fd, size_t len); int write_file(const char *fn, int mode=0644); int write_fd(int fd) const; int write_fd(int fd, uint64_t offset) const;