filer: snapid should be nonzero on all reads

This commit is contained in:
Sage Weil 2008-09-10 07:10:33 -07:00
parent 2a57107a04
commit 7f78004bb5
4 changed files with 7 additions and 4 deletions

View File

@ -3295,7 +3295,7 @@ int SyntheticClient::chunk_file(string &filename)
lock.Lock();
Context *onfinish = new C_SafeCond(&lock, &cond, &done);
filer->read(inode.ino, &inode.layout, 0, pos, get, &bl, 0, onfinish);
filer->read(inode.ino, &inode.layout, CEPH_NOSNAP, pos, get, &bl, 0, onfinish);
while (!done)
cond.Wait(lock);
lock.Unlock();

View File

@ -57,6 +57,8 @@ int Filer::probe(inodeno_t ino,
<< " starting from " << start_from
<< dendl;
assert(snapid); // (until there is a non-NOSNAP write)
Probe *probe = new Probe(ino, *layout, snapid, start_from, end, flags, fwd, onfinish);
// period (bytes before we jump unto a new set of object(s))

View File

@ -99,6 +99,7 @@ class Filer {
bufferlist *bl, // ptr to data
int flags,
Context *onfinish) {
assert(snapid); // (until there is a non-NOSNAP write)
Objecter::OSDRead *rd = prepare_read(ino, layout, snapid, offset, len, bl, flags);
return objecter->readx(rd, onfinish) > 0 ? 0:-1;
}

View File

@ -82,7 +82,7 @@ void Journaler::recover(Context *onread)
state = STATE_READHEAD;
C_ReadHead *fin = new C_ReadHead(this);
vector<snapid_t> snaps;
filer.read(ino, &layout, 0,
filer.read(ino, &layout, CEPH_NOSNAP,
0, sizeof(Header), &fin->bl, CEPH_OSD_OP_INCLOCK_FAIL, fin);
}
@ -114,7 +114,7 @@ void Journaler::_finish_read_head(int r, bufferlist& bl)
// probe the log
state = STATE_PROBING;
C_ProbeEnd *fin = new C_ProbeEnd(this);
filer.probe(ino, &layout, 0,
filer.probe(ino, &layout, CEPH_NOSNAP,
h.write_pos, (__u64 *)&fin->end, true, CEPH_OSD_OP_INCLOCK_FAIL, fin);
}
@ -533,7 +533,7 @@ void Journaler::_issue_read(__s64 len)
<< ", read pointers " << read_pos << "/" << received_pos << "/" << (requested_pos+len)
<< dendl;
filer.read(ino, &layout, 0,
filer.read(ino, &layout, CEPH_NOSNAP,
requested_pos, len, &reading_buf, CEPH_OSD_OP_INCLOCK_FAIL,
new C_Read(this));
requested_pos += len;