Because it only depends on the data in the store, not
anything from a live MDS, and it's useful when
we're dealing with fragmented directories from
an offline tool.
Signed-off-by: John Spray <john.spray@redhat.com>
// dirfrags
-__u32 CInode::hash_dentry_name(const string &dn)
+__u32 InodeStoreBase::hash_dentry_name(const string &dn)
{
int which = inode.dir_layout.dl_dir_hash;
if (!which)
return ceph_str_hash(which, dn.data(), dn.length());
}
-frag_t CInode::pick_dirfrag(const string& dn)
+frag_t InodeStoreBase::pick_dirfrag(const string& dn)
{
if (dirfragtree.empty())
return frag_t(); // avoid the string hash if we can.
/* For test/debug output */
void dump(Formatter *f) const;
+
+ /* For use by offline tools */
+ __u32 hash_dentry_name(const std::string &dn);
+ frag_t pick_dirfrag(const std::string &dn);
};
class InodeStore : public InodeStoreBase {
int stickydir_ref;
public:
- __u32 hash_dentry_name(const std::string &dn);
- frag_t pick_dirfrag(const std::string &dn);
bool has_dirfrags() { return !dirfrags.empty(); }
CDir* get_dirfrag(frag_t fg) {
if (dirfrags.count(fg)) {