| 10753 | } |
| 10754 | |
| 10755 | int 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 | /** |
nothing calls this directly
no test coverage detected