From a27897fd811a648e856e38aee6925f665e6f0640 Mon Sep 17 00:00:00 2001 From: sage Date: Wed, 1 Feb 2006 05:40:48 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@585 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/mds/CDentry.cc | 5 +++++ ceph/mds/CDir.cc | 5 +++++ ceph/mds/MDLog.cc | 11 +++++++++++ ceph/mds/MDStore.cc | 4 ++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ceph/mds/CDentry.cc b/ceph/mds/CDentry.cc index 666db5ef87d..a4a552aa336 100644 --- a/ceph/mds/CDentry.cc +++ b/ceph/mds/CDentry.cc @@ -19,6 +19,9 @@ ostream& operator<<(ostream& out, CDentry& dn) if (dn.is_dirty()) out << " dirty"; if (dn.get_lockstate() == DN_LOCK_PREXLOCK) out << " prexlock=" << dn.get_xlockedby() << " g=" << dn.get_gather_set(); if (dn.get_lockstate() == DN_LOCK_XLOCK) out << " xlock=" << dn.get_xlockedby(); + + out << " dirv=" << dn.get_parent_dir_version(); + out << " inode=" << dn.get_inode(); out << " " << &dn; out << " in " << *dn.get_dir(); @@ -48,6 +51,8 @@ void CDentry::mark_dirty() } void CDentry::mark_clean() { dout(10) << " mark_clean " << *this << endl; + assert(parent_dir_version <= dir->get_version()); + assert(parent_dir_version >= dir->get_last_committed_version()); if (is_primary() && dirty && inode) inode->put(CINODE_PIN_DNDIRTY); dirty = false; diff --git a/ceph/mds/CDir.cc b/ceph/mds/CDir.cc index 954f964cf2c..5f02c6e434a 100644 --- a/ceph/mds/CDir.cc +++ b/ceph/mds/CDir.cc @@ -71,6 +71,11 @@ ostream& operator<<(ostream& out, CDir& dir) out << " state=" << dir.get_state(); out << " sz=" << dir.get_nitems() << "+" << dir.get_nnull(); + + out << " v=" << dir.get_version(); + out << " cv=" << dir.get_committing_version(); + out << " lastcv=" << dir.get_last_committed_version(); + out << " " << &dir; return out << "]"; } diff --git a/ceph/mds/MDLog.cc b/ceph/mds/MDLog.cc index 7ac2bd37aee..738df9591cc 100644 --- a/ceph/mds/MDLog.cc +++ b/ceph/mds/MDLog.cc @@ -31,6 +31,17 @@ MDLog::MDLog(MDS *m) char name[80]; sprintf(name, "mds%d.log", mds->get_nodeid()); logger = new Logger(name, (LogType*)&mdlog_logtype); + + static bool didit = false; + if (!didit) { + mdlog_logtype.add_inc("add"); + mdlog_logtype.add_inc("retire"); + mdlog_logtype.add_inc("obs"); + mdlog_logtype.add_inc("trim"); + mdlog_logtype.add_set("size"); + mdlog_logtype.add_set("read"); + mdlog_logtype.add_set("append"); + } } diff --git a/ceph/mds/MDStore.cc b/ceph/mds/MDStore.cc index b250fbb0d99..f596fe8fdfa 100644 --- a/ceph/mds/MDStore.cc +++ b/ceph/mds/MDStore.cc @@ -658,7 +658,7 @@ void MDStore::commit_dir_slice_2( int result, __uint64_t committed_version, int hashcode ) { - dout(11) << "commit_dir_slice_2 hashcode " << hashcode << " " << *dir << endl; + dout(11) << "commit_dir_slice_2 hashcode " << hashcode << " " << *dir << " v " << committed_version << endl; // mark inodes and dentries clean too (if we committed them!) list null_clean; @@ -690,7 +690,7 @@ void MDStore::commit_dir_slice_2( int result, } else { dout(15) << " dir " << committed_version << " < dn " << dn->get_parent_dir_version() << " still dirty " << *dn << endl; assert(committed_version < dn->get_parent_dir_version()); - assert(dn->is_dirty() || !dn->is_sync()); + //assert(dn->is_dirty() || !dn->is_sync()); // -OR- we did a fetch_dir in order to do a newer commit... } // only do primary...