From: Sage Weil Date: Tue, 10 Sep 2013 01:16:08 +0000 (-0700) Subject: buffer: uninline, constify crc32c() X-Git-Tag: v0.71~91^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c56e039cac6cc2438547f6e26fe611ac5ffbe8a2;p=ceph.git buffer: uninline, constify crc32c() Signed-off-by: Sage Weil --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 0424887139e9..13fa5805c3f0 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1267,6 +1267,15 @@ int buffer::list::write_fd(int fd) const return 0; } +__u32 buffer::list::crc32c(__u32 crc) const +{ + for (std::list::const_iterator it = _buffers.begin(); + it != _buffers.end(); + ++it) + if (it->length()) + crc = ceph_crc32c(crc, (unsigned char*)it->c_str(), it->length()); + return crc; +} void buffer::list::hexdump(std::ostream &out) const { diff --git a/src/include/buffer.h b/src/include/buffer.h index 077cf0d9b0b7..f4a2f5c32645 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -420,15 +420,7 @@ public: ssize_t read_fd(int fd, size_t len); int write_file(const char *fn, int mode=0644); int write_fd(int fd) const; - __u32 crc32c(__u32 crc) { - for (std::list::const_iterator it = _buffers.begin(); - it != _buffers.end(); - ++it) - if (it->length()) - crc = ceph_crc32c(crc, (unsigned char*)it->c_str(), it->length()); - return crc; - } - + __u32 crc32c(__u32 crc) const; }; /*