mds: Revert CInode/Journaler changes as we'll move them into MDSMap later.

This commit is contained in:
Greg Farnum 2010-01-14 16:37:09 -08:00
parent eb27307055
commit b826611cae
4 changed files with 12 additions and 38 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -20,8 +20,7 @@ using namespace std;
#include <boost/pool/pool.hpp>
#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

View File

@ -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<Context*> ls;
ls.swap(waitfor_recover);
finish_contexts(ls, -EINVAL);
return;
}
dout(0) << "on disk magic '" << h.magic << "' != my magic '"
<< magic << "'" << dendl;
list<Context*> ls;
ls.swap(waitfor_recover);
finish_contexts(ls, -EINVAL);
return;
}
set_layout(&h.layout);