X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Frocksdb%2Fcache%2Fsharded_cache.h;h=920898b871f4a382f72984c59fd2efe040a633de;hb=494da23a05e25ed98f5539f3b89e6af3cafe3fec;hp=4f9dea2ad0fe670ad68b1374a418ece3eca6915a;hpb=931c18d5142274109ebfaecd012da8e5a3ebc67e;p=ceph.git diff --git a/ceph/src/rocksdb/cache/sharded_cache.h b/ceph/src/rocksdb/cache/sharded_cache.h index 4f9dea2ad..920898b87 100644 --- a/ceph/src/rocksdb/cache/sharded_cache.h +++ b/ceph/src/rocksdb/cache/sharded_cache.h @@ -47,7 +47,8 @@ class CacheShard { // Keys are sharded by the highest num_shard_bits bits of hash value. class ShardedCache : public Cache { public: - ShardedCache(size_t capacity, int num_shard_bits, bool strict_capacity_limit); + ShardedCache(size_t capacity, int num_shard_bits, bool strict_capacity_limit, + std::shared_ptr memory_allocator = nullptr); virtual ~ShardedCache() = default; virtual const char* Name() const override = 0; virtual CacheShard* GetShard(int shard) = 0; @@ -82,7 +83,7 @@ class ShardedCache : public Cache { private: static inline uint32_t HashSlice(const Slice& s) { - return Hash(s.data(), s.size(), 0); + return static_cast(GetSliceNPHash64(s)); } uint32_t Shard(uint32_t hash) {