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

Method ll_read_block

src/client/Client.cc:17141–17172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17139}
17140
17141int Client::ll_read_block(Inode *in, uint64_t blockid,
17142 char *buf,
17143 uint64_t offset,
17144 uint64_t length,
17145 file_layout_t* layout)
17146{
17147 RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
17148 if (!mref_reader.is_state_satisfied())
17149 return -ENOTCONN;
17150
17151 vinodeno_t vino = _get_vino(in);
17152 object_t oid = file_object_t(vino.ino, blockid);
17153 C_SaferCond onfinish;
17154 bufferlist bl;
17155
17156 objecter->read(oid,
17157 object_locator_t(layout->pool_id),
17158 offset,
17159 length,
17160 vino.snapid,
17161 &bl,
17162 CEPH_OSD_FLAG_READ,
17163 &onfinish);
17164
17165 int r = onfinish.wait();
17166 if (r >= 0) {
17167 bl.begin().copy(bl.length(), buf);
17168 r = bl.length();
17169 }
17170
17171 return r;
17172}
17173
17174/* It appears that the OSD doesn't return success unless the entire
17175 buffer was written, return the write length on success. */

Callers 1

ceph_ll_read_blockFunction · 0.80

Calls 8

file_object_tClass · 0.85
object_locator_tClass · 0.85
is_state_satisfiedMethod · 0.80
readMethod · 0.45
waitMethod · 0.45
copyMethod · 0.45
beginMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected