This needs to match up with the hash used by the kernel when
hashing the object name for placement.
Use the better hash for all strings, while we're at it.
{
size_t operator()( const nstring& x ) const
{
- static hash<const char*> H;
- return H(x.c_str());
+ //static hash<const char*> H;
+ //return H(x.c_str());
+ return ceph_full_name_hash(x.c_str(), x.length());
}
};
}
namespace __gnu_cxx {
template<> struct hash<object_t> {
size_t operator()(const object_t& r) const {
- static hash<nstring> H;
- return H(r.name);
+ //static hash<nstring> H;
+ //return H(r.name);
+ return ceph_full_name_hash(r.name.c_str(), r.name.length());
}
};
}