| 17139 | } |
| 17140 | |
| 17141 | int 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. */ |
no test coverage detected