]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: drop write_fd_zero_copy() from bufferlist.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 11 Sep 2018 11:16:28 +0000 (13:16 +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 d078a3a56cfd40e42d6860f30a37c4187bdc9c1a..50574b3ce0d452ebb561db4272da92c4c057a9c2 100644 (file)
@@ -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<ptr>::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;
index d79621fd2b3cab3389790e685a7e6ee5e74f3173..f594551d98460bb1bc13f8bb6ebb121176a9cf9f 100644 (file)
@@ -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<typename VectorT>
     void prepare_iov(VectorT *piov) const {
 #ifdef __CEPH__