1H - Inline data support¶
Live Pad¶
The live pad can be found here: [pad]
Summit Snapshot¶
Coding tasks- Insert extended attribute of file for MDS to store data of small files
- piggyback on the File cap bits, existing cap writeback mechanism
- MDS uninline file content when it goes into the MIX state
- add fields to MClientCaps
- Inline data is returned to the client via encode_inodestat() (used by lookup, readdir, stat, open, etc.)
- MDS would store inline data inside inode_t (bufferlist inline_data)
- Client (libcephfs, ceph-fuse)
- if size is small and we are flushing, flush inline to mds
- prototype and refine protocol changes
- Linux kernel client
- read side
- copy into page cache from inode buffer from readpage()
- write side
- writepage[s]() ..
- begin_page_writeback() ???? somethign like that... set the writeback bit, lock page
- if (size is small and we want to inline) {
- copy into the inode buffer
- trigger mds cap flush
- wait for flush
- } else {
- do the regular thing
- }
- end_page_writeback()
- read side
- Document the communication protocol
1 Client side
1.1 ceph_write_end()
if (inode->status == INLINED) { if (write_pos < PAGE_SIZE) { write_page_to_inode(); err = mark_inode_dirty(); if (err == ESTATUS) // status has changed to NOTINLINING or NOTINLINED write_page_to_osd(); return; } if (write_pos > PAGE_SIZE) { inode->status = NOTINLINING; mark_inode_dirty(); // ansynchoronously tell mds to change status to NOTINLINING } if (the interval [write_pos, write_pos + write_len] overlap with the interval [0, PAGE_SIZE]) { inode->status = NOTINLINED; mark_inode_dirty(); } } if (inode->status == NOTINLINING) { if (the interval [write_pos, write_pos + write_len] overlap with the interval [0, PAGE_SIZE]) { inode->status = NOTINLINED; mark_inode_dirty(); } }
1.2 write_page()
if (page->index == 0 && inode->status == INLINED) { // for mmap(), it won't go through write_end err = write_page_to_inode(); mark_inode_dirty(); } write_page_to_osd();
1.3 read_page()
if (page->index == 0 && (inode->status == INLINED || inode->status == NOTINLING)) { err = copy_data_from_inode(); if (err == ESTATUS) // status has changed to NOTINLINED read_page_from_osd(); return; } read_page_from_osd();