From 58240bdb2614c6728bd87d7f8f0201b546cb7b35 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 6 Dec 2018 23:58:40 +0100 Subject: [PATCH] common: drop unused get_max_pipe_size() in buffer.cc. Signed-off-by: Radoslaw Zarzynski --- src/common/buffer.cc | 35 ----------------------------------- src/include/config-h.in.cmake | 3 --- 2 files changed, 38 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 10cfbc9a0cfb1..51861216f66c3 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -107,41 +107,6 @@ using namespace ceph; return buffer_missed_crc; } -#ifdef CEPH_HAVE_SETPIPE_SZ - static std::atomic buffer_max_pipe_size { 0 }; - int update_max_pipe_size() { - char buf[32]; - int r; - std::string err; - struct stat stat_result; - if (::stat(PROCPREFIX "/proc/sys/fs/pipe-max-size", &stat_result) == -1) - return -errno; - r = safe_read_file(PROCPREFIX "/proc/sys/fs/", "pipe-max-size", - buf, sizeof(buf) - 1); - if (r < 0) - return r; - buf[r] = '\0'; - size_t size = strict_strtol(buf, 10, &err); - if (!err.empty()) - return -EIO; - buffer_max_pipe_size = size; - return 0; - } - - size_t get_max_pipe_size() { - size_t size = buffer_max_pipe_size; - if (size) - return size; - if (update_max_pipe_size() == 0) - return buffer_max_pipe_size; - // this is the max size hardcoded in linux before 2.6.35 - return 65536; - } -#else - size_t get_max_pipe_size() { return 65536; } -#endif - - const char * buffer::error::what() const throw () { return "buffer::exception"; } diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index 329fb526febc6..456ae30403e69 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -265,9 +265,6 @@ /* Define if the C compiler supports __PRETTY_FUNCTION__ */ #cmakedefine HAVE_PRETTY_FUNC -/* F_SETPIPE_SZ is supported */ -#cmakedefine CEPH_HAVE_SETPIPE_SZ - /* Have eventfd extension. */ #cmakedefine HAVE_EVENTFD -- 2.39.5