MCPcopy Create free account
hub / github.com/ceph/ceph / lookup_hash

Method lookup_hash

src/client/Client.cc:10755–10779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10753}
10754
10755int Client::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name,
10756 const UserPerm& perms)
10757{
10758 ldout(cct, 3) << __func__ << " enter(" << ino << ", #" << dirino << "/" << name << ")" << dendl;
10759
10760 RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
10761 if (!mref_reader.is_state_satisfied())
10762 return -ENOTCONN;
10763
10764 std::scoped_lock lock(client_lock);
10765 MetaRequest *req = new MetaRequest(CEPH_MDS_OP_LOOKUPHASH);
10766 req->set_filepath(filepath(ino));
10767
10768 uint32_t h = ceph_str_hash(CEPH_STR_HASH_RJENKINS, name, strlen(name));
10769 char f[30];
10770 sprintf(f, "%u", h);
10771 filepath path(dirino);
10772 path.push_dentry(string(f));
10773 req->set_filepath2(path);
10774
10775 int r = make_request(req, perms, NULL, NULL,
10776 rand() % mdsmap->get_num_in_mds());
10777 ldout(cct, 3) << __func__ << " exit(" << ino << ", #" << dirino << "/" << name << ") = " << r << dendl;
10778 return r;
10779}
10780
10781
10782/**

Callers

nothing calls this directly

Calls 8

ceph_str_hashFunction · 0.85
is_state_satisfiedMethod · 0.80
get_num_in_mdsMethod · 0.80
filepathClass · 0.70
make_requestFunction · 0.50
set_filepathMethod · 0.45
push_dentryMethod · 0.45
set_filepath2Method · 0.45

Tested by

no test coverage detected