diff options
author | Sage Weil <sage@inktank.com> | 2013-09-09 18:16:08 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-09 18:16:08 -0700 |
commit | c56e039cac6cc2438547f6e26fe611ac5ffbe8a2 (patch) | |
tree | 6f55b8637b15aada5e1823b15a565431c6871b8a | |
parent | 7281354f727cf56313b657ab0f113dce348d9166 (diff) | |
download | ceph-c56e039cac6cc2438547f6e26fe611ac5ffbe8a2.tar.gz |
buffer: uninline, constify crc32c()
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/common/buffer.cc | 9 | ||||
-rw-r--r-- | src/include/buffer.h | 10 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 0424887139e..13fa5805c3f 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<ptr>::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 077cf0d9b0b..f4a2f5c3264 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<ptr>::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; }; /* |