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

Method ll_read

src/client/Client.cc:17103–17139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17101}
17102
17103int Client::ll_read(Fh *fh, loff_t off, loff_t len, bufferlist *bl)
17104{
17105 RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
17106 if (!mref_reader.is_state_satisfied()) {
17107 return -ENOTCONN;
17108 }
17109
17110#if defined(__linux__)
17111 /* We can't return bytes written larger than INT_MAX, clamp size to
17112 * that or FSCRYPT_MAXIO_SIZE*/
17113 Inode *in = fh->inode.get();
17114 if (in->is_fscrypt_enabled()) {
17115 len = std::min(len, (loff_t)FSCRYPT_MAXIO_SIZE);
17116 } else {
17117 /* We can't return bytes written larger than INT_MAX, clamp len to that */
17118 len = std::min(len, (loff_t)INT_MAX);
17119 }
17120#else
17121 len = std::min(len, (loff_t)INT_MAX);
17122#endif
17123 std::scoped_lock lock(client_lock);
17124 if (fh == NULL || !_ll_fh_exists(fh)) {
17125 ldout(cct, 3) << "(fh)" << fh << " is invalid" << dendl;
17126 return -EBADF;
17127 }
17128
17129 ldout(cct, 3) << "ll_read " << fh << " " << fh->inode->ino << " " << " " << off << "~" << len << dendl;
17130 tout(cct) << "ll_read" << std::endl;
17131 tout(cct) << (uintptr_t)fh << std::endl;
17132 tout(cct) << off << std::endl;
17133 tout(cct) << len << std::endl;
17134
17135 int r = _read(fh, off, len, bl);
17136 ldout(cct, 3) << "ll_read " << fh << " " << off << "~" << len << " = " << r
17137 << dendl;
17138 return r;
17139}
17140
17141int Client::ll_read_block(Inode *in, uint64_t blockid,
17142 char *buf,

Callers 3

ceph_ll_readFunction · 0.80
fuse_ll_readFunction · 0.80
play_traceMethod · 0.80

Calls 4

is_state_satisfiedMethod · 0.80
_readFunction · 0.50
getMethod · 0.45
is_fscrypt_enabledMethod · 0.45

Tested by

no test coverage detected