Hi,
I am trying to track the actual system open and write call on a OSD when a new
file is created and written. So far, my tracking is as follows:
Using the debug log messages, I located the first write call in do_osd_ops
function (case CEPH_OSD_OP_WRITE) in os/ReplicatedPG.cc (line 3727)
t->write(soid, op.extent.offset, op.extent.length, osd_op.indata);
where t is a transaction object.
This function is defined in os/ObjectStore.h (line 652)
void write(coll_t cid, const ghobject_t& oid, uint64_t off, uint64_t len,
const bufferlist& data) {
__u32 op = OP_WRITE;
::encode(op, tbl);
::encode(cid, tbl);
::encode(oid, tbl);
::encode(off, tbl);
::encode(len, tbl);
assert(len == data.length());
if (data.length() > largest_data_len) {
largest_data_len = data.length();
largest_data_off = off;
largest_data_off_in_tbl = tbl.length() + sizeof(__u32); // we are
about to
}
::encode(data, tbl);
ops++;
}
The encode functions are defined as a template in include/encoding.h (line 61)
which eventually calls bufferlist.append in src/common/buffers.cc (line 1272)
to insert the buffers from one list to another.
void buffer::list::append(const list& bl)
{
_len += bl._len;
for (std::list<ptr>::const_iterator p = bl._buffers.begin();
p != bl._buffers.end();
++p)
_buffers.push_back(*p);
}
Since the buffers are "push_back" I figured that there must be a call to
pop_front in ReplicatedPG.cc . But there is not pop_front associated with any
write. This is where I am stuck.
At this point I have two questions:
1. When does the actual file open happen?
2. Where is the system call to physically write the file to the disk?
Any help is appreciated.
Rajesh
_______________________________________________
ceph-users mailing list
[email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com