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

Method enqueue

src/mds/ScrubStack.cc:169–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169int ScrubStack::enqueue(CInode *in, ScrubHeaderRef& header, bool top)
170{
171 // abort in progress
172 if (clear_stack)
173 return -EAGAIN;
174
175 header->set_origin(in->ino());
176 auto ret = scrubbing_map.emplace(header->get_tag(), header);
177 if (!ret.second) {
178 dout(10) << __func__ << " with {" << *in << "}"
179 << ", conflicting tag " << header->get_tag() << dendl;
180 return -EEXIST;
181 }
182 if (header->get_scrub_mdsdir()) {
183 filepath fp;
184 mds_rank_t rank;
185 rank = mdcache->mds->get_nodeid();
186 if(rank >= 0 && rank < MAX_MDS) {
187 fp.set_path("", MDS_INO_MDSDIR(rank));
188 }
189 int r = _enqueue(mdcache->get_inode(fp.get_ino()), header, true);
190 if (r < 0) {
191 return r;
192 }
193 //to make sure mdsdir is always on the top
194 top = false;
195 }
196
197 std::string path;
198 in->make_path_string(path);
199 init_scrub_counters(path, header->get_tag());
200 int r = _enqueue(in, header, top);
201 if (r < 0)
202 return r;
203
204 clog_scrub_summary(in);
205
206 kick_off_scrubs();
207 return 0;
208}
209
210void ScrubStack::add_to_waiting(MDSCacheObject *obj)
211{

Callers 8

queue_file_recoverMethod · 0.45
enqueue_scrub_workMethod · 0.45
load_test_dataMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
fill_queueMethod · 0.45
TEST_FFunction · 0.45

Calls 10

set_originMethod · 0.80
get_scrub_mdsdirMethod · 0.80
inoMethod · 0.45
emplaceMethod · 0.45
get_tagMethod · 0.45
get_nodeidMethod · 0.45
set_pathMethod · 0.45
get_inodeMethod · 0.45
get_inoMethod · 0.45
make_path_stringMethod · 0.45

Tested by 6

load_test_dataMethod · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
fill_queueMethod · 0.36
TEST_FFunction · 0.36