summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-10-17 16:46:10 -0700
committerSage Weil <sage@inktank.com>2013-10-17 16:46:10 -0700
commit8ec3aed516980e30aaacd071d8560a9afc9163f8 (patch)
treedd1f5d979661188e9a7bb6f2c4efdfe2789adde9
parent394ec17540a683349f3a28b43b689d6eef6c4b90 (diff)
downloadceph-8ec3aed516980e30aaacd071d8560a9afc9163f8.tar.gz
common/buffer: fix crc_map types
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/common/buffer.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/buffer.cc b/src/common/buffer.cc
index d4589653d42..221a9977109 100644
--- a/src/common/buffer.cc
+++ b/src/common/buffer.cc
@@ -77,7 +77,7 @@ static uint32_t simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZE
atomic_t nref;
Spinlock crc_lock;
- map<pair<off_t, off_t>, pair<int64_t, int64_t> > crc_map;
+ map<pair<size_t, size_t>, pair<uint32_t, uint32_t> > crc_map;
raw(unsigned l) : data(NULL), len(l), nref(0)
{ }
@@ -106,18 +106,18 @@ static uint32_t simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZE
bool is_n_page_sized() {
return (len & ~CEPH_PAGE_MASK) == 0;
}
- bool get_crc(const pair<off_t, off_t> &fromto,
- pair<int64_t, int64_t> *crc) const {
+ bool get_crc(const pair<size_t, size_t> &fromto,
+ pair<uint32_t, uint32_t> *crc) const {
Spinlock::Locker l(crc_lock);
- map<pair<off_t, off_t>, pair<int64_t, int64_t> >::const_iterator i =
+ map<pair<size_t, size_t>, pair<uint32_t, uint32_t> >::const_iterator i =
crc_map.find(fromto);
if (i == crc_map.end())
return false;
*crc = i->second;
return true;
}
- void set_crc(const pair<off_t, off_t> &fromto,
- const pair<uint64_t, uint64_t> &crc) {
+ void set_crc(const pair<size_t, size_t> &fromto,
+ const pair<uint32_t, uint32_t> &crc) {
Spinlock::Locker l(crc_lock);
crc_map[fromto] = crc;
}
@@ -1315,8 +1315,8 @@ __u32 buffer::list::crc32c(__u32 crc) const
++it) {
if (it->length()) {
raw *r = it->get_raw();
- pair<off_t, off_t> ofs(it->offset(), it->offset() + it->length());
- pair<int64_t, int64_t> ccrc;
+ pair<size_t, size_t> ofs(it->offset(), it->offset() + it->length());
+ pair<uint32_t, uint32_t> ccrc;
if (r->get_crc(ofs, &ccrc)) {
if (ccrc.first == crc) {
// got it already