From: John Spray Date: Thu, 6 Feb 2014 22:16:21 +0000 (+0000) Subject: mds: Don't create the /.ceph directory X-Git-Tag: v0.79~196^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=81bcf43080a7be8a48aa13b88287cbfac0e01e3e;p=ceph.git mds: Don't create the /.ceph directory This was entirely unused. On existing filesystems it will live on, on new ones it will never be created. Signed-off-by: John Spray --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index c8641e4f69f2..3c44abdd61ae 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -344,18 +344,7 @@ void MDCache::create_empty_hierarchy(C_Gather *gather) adjust_subtree_auth(rootdir, mds->whoami); rootdir->dir_rep = CDir::REP_ALL; //NONE; - // create ceph dir - CInode *ceph = create_system_inode(MDS_INO_CEPH, S_IFDIR); - CDentry *dn = rootdir->add_primary_dentry(".ceph", ceph); - dn->_mark_dirty(mds->mdlog->get_current_segment()); - - CDir *cephdir = ceph->get_or_open_dirfrag(this, frag_t()); - cephdir->dir_rep = CDir::REP_ALL; //NONE; - - ceph->inode.dirstat = cephdir->fnode.fragstat; - rootdir->fnode.fragstat.nsubdirs = 1; - rootdir->fnode.rstat = ceph->inode.rstat; rootdir->fnode.accounted_fragstat = rootdir->fnode.fragstat; rootdir->fnode.accounted_rstat = rootdir->fnode.rstat; @@ -363,10 +352,6 @@ void MDCache::create_empty_hierarchy(C_Gather *gather) root->inode.rstat = rootdir->fnode.rstat; root->inode.accounted_rstat = root->inode.rstat; - cephdir->mark_complete(); - cephdir->mark_dirty(cephdir->pre_dirty(), mds->mdlog->get_current_segment()); - cephdir->commit(0, gather->new_sub()); - rootdir->mark_complete(); rootdir->mark_dirty(rootdir->pre_dirty(), mds->mdlog->get_current_segment()); rootdir->commit(0, gather->new_sub()); @@ -380,7 +365,6 @@ void MDCache::create_mydir_hierarchy(C_Gather *gather) char myname[10]; snprintf(myname, sizeof(myname), "mds%d", mds->whoami); CInode *my = create_system_inode(MDS_INO_MDSDIR(mds->whoami), S_IFDIR); - //cephdir->add_remote_dentry(myname, MDS_INO_MDSDIR(mds->whoami), S_IFDIR); CDir *mydir = my->get_or_open_dirfrag(this, frag_t()); adjust_subtree_auth(mydir, mds->whoami); @@ -10298,23 +10282,7 @@ void MDCache::handle_discover(MDiscover *dis) reply->set_flag_error_ino(); break; } - - // is this a new mds dir? - /* - if (curdir->ino() == MDS_INO_CEPH) { - char t[10]; - snprintf(t, sizeof(t), "mds%d", from); - if (t == dis->get_dentry(i)) { - // yes. - _create_mdsdir_dentry(curdir, from, t, new C_MDS_RetryMessage(mds, dis)); - //_create_system_file(curdir, t, create_system_inode(MDS_INO_MDSDIR(from), S_IFDIR), - //new C_MDS_RetryMessage(mds, dis)); - reply->put(); - return; - } - } - */ - + // send null dentry dout(7) << "dentry " << dis->get_dentry(i) << " dne, returning null in " << *curdir << dendl; diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index eb150404e7c9..117a80a8dfc9 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -45,6 +45,9 @@ using namespace std; #define NUM_STRAY 10 #define MDS_INO_ROOT 1 + +// No longer created but recognised in existing filesystems +// so that we don't try to fragment it. #define MDS_INO_CEPH 2 #define MDS_INO_MDSDIR_OFFSET (1*MAX_MDS)