]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Don't create the /.ceph directory
authorJohn Spray <john.spray@inktank.com>
Thu, 6 Feb 2014 22:16:21 +0000 (22:16 +0000)
committerJohn Spray <john.spray@inktank.com>
Thu, 20 Feb 2014 17:00:32 +0000 (17:00 +0000)
This was entirely unused.  On existing filesystems
it will live on, on new ones it will never be created.

Signed-off-by: John Spray <john.spray@inktank.com>
src/mds/MDCache.cc
src/mds/mdstypes.h

index c8641e4f69f2ea310f2da3f19ca5ce553d567d9e..3c44abdd61aee80df7cf0c8a4b94af587a821043 100644 (file)
@@ -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;
index eb150404e7c9295b98626675732405d4e76e5106..117a80a8dfc94c0b85aab73c25ade869c7a860f3 100644 (file)
@@ -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)