Skip to content

Commit

Permalink
SERVER-6405: remove old addNewNamespaceToCatalog
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Oct 8, 2013
1 parent 2b4444c commit 97dbb58
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
5 changes: 2 additions & 3 deletions src/mongo/db/database.cpp
Expand Up @@ -372,8 +372,6 @@ namespace mongo {



void addNewNamespaceToCatalog(const char *ns, const BSONObj *options = 0); // XXX

Status Database::renameCollection( const StringData& fromNS, const StringData& toNS,
bool stayTemp ) {

Expand Down Expand Up @@ -504,7 +502,8 @@ namespace mongo {
}
newSpec = b.obj();
}
addNewNamespaceToCatalog( toNSString.c_str(), newSpec.isEmpty() ? 0 : &newSpec );

_addNamespaceToCatalog( toNSString, newSpec.isEmpty() ? 0 : &newSpec );

deleteObjects( _namespacesName, BSON( "name" << fromNS ), false, false, true );

Expand Down
23 changes: 0 additions & 23 deletions src/mongo/db/namespace_details.cpp
Expand Up @@ -920,29 +920,6 @@ namespace mongo {

/* ------------------------------------------------------------------------- */

/* add a new namespace to the system catalog (<dbname>.system.namespaces).
options: { capped : ..., size : ... }
*/
void addNewNamespaceToCatalog(const char *ns, const BSONObj *options = 0) {
LOG(1) << "New namespace: " << ns << endl;
if ( strstr(ns, "system.namespaces") ) {
// system.namespaces holds all the others, so it is not explicitly listed in the catalog.
// TODO: fix above should not be strstr!
return;
}

BSONObjBuilder b;
b.append("name", ns);
if ( options )
b.append("options", *options);
BSONObj j = b.done();
char database[256];
nsToDatabase(ns, database);
string s = string(database) + ".system.namespaces";
theDataFileMgr.insert(s.c_str(), j.objdata(), j.objsize(), false, true);
}


bool legalClientSystemNS( const StringData& ns , bool write ) {
if( ns == "local.system.replset" ) return true;

Expand Down
1 change: 0 additions & 1 deletion src/mongo/db/pdfile.cpp
Expand Up @@ -136,7 +136,6 @@ namespace mongo {
return _dbHolder;
}

void addNewNamespaceToCatalog(const char *ns, const BSONObj *options = 0);
void ensureIdIndexForNewNs(const char *ns) {
if ( ( strstr( ns, ".system." ) == 0 || legalClientSystemNS( ns , false ) ) &&
strstr( ns, FREELIST_NS ) == 0 ) {
Expand Down

0 comments on commit 97dbb58

Please sign in to comment.