diff options
Diffstat (limited to 'src/common/buffer.cc')
-rw-r--r-- | src/common/buffer.cc | 9 |
1 files changed, 9 insertions, 0 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 { |