From df90885ed178822e53f1cccdaa1bab517369b878 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Tue, 11 Sep 2018 13:16:28 +0200 Subject: [PATCH] common: drop write_fd_zero_copy() from bufferlist. Signed-off-by: Radoslaw Zarzynski --- src/common/buffer.cc | 27 --------------------------- src/include/buffer.h | 1 - 2 files changed, 28 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index d078a3a56cfd4..50574b3ce0d45 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -2069,9 +2069,6 @@ static int do_writev(int fd, struct iovec *vec, uint64_t offset, unsigned veclen int buffer::list::write_fd(int fd) const { - if (can_zero_copy()) - return write_fd_zero_copy(fd); - // use writev! iovec iov[IOV_MAX]; int iovlen = 0; @@ -2150,30 +2147,6 @@ int buffer::list::write_fd(int fd, uint64_t offset) const return 0; } -int buffer::list::write_fd_zero_copy(int fd) const -{ - if (!can_zero_copy()) - return -ENOTSUP; - /* pass offset to each call to avoid races updating the fd seek - * position, since the I/O may be non-blocking - */ - int64_t offset = ::lseek(fd, 0, SEEK_CUR); - int64_t *off_p = &offset; - if (offset < 0 && errno != ESPIPE) - return -errno; - if (errno == ESPIPE) - off_p = NULL; - for (std::list::const_iterator it = _buffers.begin(); - it != _buffers.end(); ++it) { - int r = it->zero_copy_to_fd(fd, off_p); - if (r < 0) - return r; - if (off_p) - offset += it->length(); - } - return 0; -} - __u32 buffer::list::crc32c(__u32 crc) const { int cache_misses = 0; diff --git a/src/include/buffer.h b/src/include/buffer.h index d79621fd2b3ca..f594551d98460 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -935,7 +935,6 @@ namespace buffer CEPH_BUFFER_API { int write_file(const char *fn, int mode=0644); int write_fd(int fd) const; int write_fd(int fd, uint64_t offset) const; - int write_fd_zero_copy(int fd) const; template void prepare_iov(VectorT *piov) const { #ifdef __CEPH__ -- 2.39.5