fin->complete(0);
}
+void CInode::flush(MDSInternalContextBase *fin)
+{
+ dout(10) << "flush " << *this << dendl;
+ assert(is_auth() && can_auth_pin());
+
+ MDSGatherBuilder gather(g_ceph_context);
+
+ if (is_dirty_parent()) {
+ store_backtrace(gather.new_sub());
+ }
+ if (is_dirty()) {
+ if (is_base()) {
+ store(gather.new_sub());
+ } else {
+ parent->dir->commit(0, gather.new_sub());
+ }
+ }
+
+ if (gather.has_subs()) {
+ gather.set_finisher(fin);
+ gather.activate();
+ } else {
+ fin->complete(0);
+ }
+}
+
struct C_IO_Inode_Fetched : public CInodeIOContext {
bufferlist bl, bl2;
Context *fin;
void store(MDSInternalContextBase *fin);
void _stored(version_t cv, Context *fin);
+ /**
+ * Flush a CInode to disk. This includes the backtrace, the parent
+ * directory's link, and the Inode object itself (if a base directory).
+ * @pre is_auth() on both the inode and its containing directory
+ * @pre can_auth_pin()
+ * @param fin The Context to call when the flush is completed.
+ */
+ void flush(MDSInternalContextBase *fin);
void fetch(MDSInternalContextBase *fin);
void _fetched(bufferlist& bl, bufferlist& bl2, Context *fin);
+
void build_backtrace(int64_t pool, inode_backtrace_t& bt);
void store_backtrace(MDSInternalContextBase *fin, int op_prio=-1);
void _stored_backtrace(version_t v, Context *fin);