NULL, 0, onfinish);
if (r == 0) {
ldout(cct, 20) << "readahead initiated, c " << onfinish << dendl;
- in->get();
+ get_cap_ref(in, CEPH_CAP_FILE_RD | CEPH_CAP_FILE_CACHE);
} else {
ldout(cct, 20) << "readahead was no-op, already cached" << dendl;
delete onfinish;
r = objectcacher->file_read(&in->oset, &in->layout, in->snapid,
off, len, bl, 0, onfinish);
if (r == 0) {
+ get_cap_ref(in, CEPH_CAP_FILE_CACHE);
client_lock.Unlock();
flock.Lock();
while (!done)
cond.Wait(flock);
flock.Unlock();
client_lock.Lock();
+ put_cap_ref(in, CEPH_CAP_FILE_CACHE);
r = rvalue;
} else {
// it was cached.
inode(i) { }
void finish(int r) {
lsubdout(client->cct, client, 20) << "C_Readahead on " << inode << dendl;
- client->put_inode(inode, 1);
+ client->put_cap_ref(inode, CEPH_CAP_FILE_RD | CEPH_CAP_FILE_CACHE);
}
};