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

Method get_random_subdir

src/client/SyntheticClient.h:136–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134
135 filepath n1;
136 const char *get_random_subdir() {
137 ceph_assert(!subdirs.empty());
138 int r = ((rand() % subdirs.size()) + (rand() % subdirs.size())) / 2; // non-uniform distn
139 std::set<std::string>::iterator it = subdirs.begin();
140 while (r--) ++it;
141
142 n1 = cwd;
143 n1.push_dentry( *it );
144 return n1.get_path().c_str();
145 }
146 filepath n2;
147 const char *get_random_sub() {
148 ceph_assert(!contents.empty());

Callers

nothing calls this directly

Calls 6

emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
push_dentryMethod · 0.45
c_strMethod · 0.45
get_pathMethod · 0.45

Tested by

no test coverage detected