From b826611cae134c3a70fd65c4bc0180cfad37a1ca Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 14 Jan 2010 16:37:09 -0800 Subject: [PATCH] mds: Revert CInode/Journaler changes as we'll move them into MDSMap later. --- src/mds/CInode.cc | 24 +++++------------------- src/mds/CInode.h | 5 ----- src/mds/mdstypes.h | 3 +-- src/osdc/Journaler.cc | 18 ++++++------------ 4 files changed, 12 insertions(+), 38 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 65fba2d463606..e641b2bed4263 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -42,6 +42,7 @@ #undef dout_prefix #define dout_prefix *_dout << dbeginl << "mds" << mdcache->mds->get_nodeid() << ".cache.ino(" << inode.ino << ") " + boost::pool<> CInode::pool(sizeof(CInode)); boost::pool<> Capability::pool(sizeof(Capability)); @@ -663,9 +664,6 @@ void CInode::store(Context *fin) bufferlist bl; nstring magic = CEPH_FS_ONDISK_MAGIC; ::encode(magic, bl); - //hack: in future will want to only write USED features - //since we currently only have one feature, though, this works - mdcache->mds->mds_features.encode(bl); encode_store(bl); // write it. @@ -726,30 +724,18 @@ void CInode::fetch(Context *fin) void CInode::_fetched(bufferlist& bl, Context *fin) { dout(10) << "_fetched" << dendl; - CompatSet& mds_features = mdcache->mds->mds_features; bufferlist::iterator p = bl.begin(); nstring magic; ::decode(magic, p); dout(10) << " magic is '" << magic << "' (expecting '" << CEPH_FS_ONDISK_MAGIC << "')" << dendl; - if (magic != CEPH_FS_ONDISK_MAGIC && magic != CEPH_FS_OLD_ONDISK_MAGIC) { + if (magic != CEPH_FS_ONDISK_MAGIC) { dout(0) << "on disk magic '" << magic << "' != my magic '" << CEPH_FS_ONDISK_MAGIC << "'" << dendl; fin->finish(-EINVAL); } else { - if (magic != CEPH_FS_OLD_ONDISK_MAGIC) ondisk_ino_features.decode(p); - else ondisk_ino_features = mds_features; - if ( !mds_features.writeable(ondisk_ino_features)) { - dout(0) << "mds data on-disk uses unknown features!" << dendl; - CompatSet diff = mds_features.unsupported(ondisk_ino_features); - dout(0) << "missing features:" << dendl; - for (CompatSet::iterator i = diff.begin(); i != diff.end(); ++i) - dout(0) << *i << dendl; - fin->finish(-EOPNOTSUPP); - } else { - decode_store(p); - dout(10) << "_fetched " << *this << dendl; - fin->finish(0); - } + decode_store(p); + dout(10) << "_fetched " << *this << dendl; + fin->finish(0); } delete fin; } diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 2b74308c15aae..17d45a463af9d 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -18,7 +18,6 @@ #define __CINODE_H #include "config.h" -#include "include/CompatSet.h" #include "include/types.h" #include "include/lru.h" @@ -54,13 +53,11 @@ class ObjectOperation; ostream& operator<<(ostream& out, CInode& in); - // cached inode wrapper class CInode : public MDSCacheObject { private: static boost::pool<> pool; public: - CompatSet ondisk_ino_features; static void *operator new(size_t num_bytes) { return pool.malloc(); } @@ -922,6 +919,4 @@ public: }; - - #endif diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 494a075e20e75..4f574aa61045a 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -20,8 +20,7 @@ using namespace std; #include -#define CEPH_FS_ONDISK_MAGIC "ceph fs volume v012" -#define CEPH_FS_OLD_ONDISK_MAGIC "ceph fs volume v011" +#define CEPH_FS_ONDISK_MAGIC "ceph fs volume v011" //#define MDS_REF_SET // define me for improved debug output, sanity checking diff --git a/src/osdc/Journaler.cc b/src/osdc/Journaler.cc index d3d17ad1274d8..d4111578e09a5 100644 --- a/src/osdc/Journaler.cc +++ b/src/osdc/Journaler.cc @@ -125,18 +125,12 @@ void Journaler::_finish_read_head(int r, bufferlist& bl) ::decode(h, p); if (h.magic != magic) { - //special-case nasty hack for an upgrade path -#define CEPH_FS_ONDISK_MAGIC "ceph fs volume v012" -#define CEPH_FS_OLD_ONDISK_MAGIC "ceph fs volume v011" - if (strcmp(magic, CEPH_FS_ONDISK_MAGIC) != 0 - && strcmp(h.magic.c_str(), CEPH_FS_OLD_ONDISK_MAGIC) != 0) { - dout(0) << "on disk magic '" << h.magic << "' != my magic '" - << magic << "'" << dendl; - list ls; - ls.swap(waitfor_recover); - finish_contexts(ls, -EINVAL); - return; - } + dout(0) << "on disk magic '" << h.magic << "' != my magic '" + << magic << "'" << dendl; + list ls; + ls.swap(waitfor_recover); + finish_contexts(ls, -EINVAL); + return; } set_layout(&h.layout); -- 2.39.5