]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: drop buffer::list::read_fd_zero_copy.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 11 Sep 2018 10:04:35 +0000 (12:04 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 17 Sep 2018 13:31:45 +0000 (15:31 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/buffer.cc
src/include/buffer.h

index d5bf6703228b672a09e0292cd74d77f02249893d..7068d9fc8775321102bde5f8dd9738d85f1fe421 100644 (file)
@@ -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));
index 0fdbec51ac9dbddeae7ede6806d3e9f42657facc..c6590bc317901adeef28a976a105663aba963da6 100644 (file)
@@ -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;