cvmfs/catalog_mgr_rw.cc
void WritableCatalogManager::RemoveNestedCatalog(const string &mountpoint) {
  const string nested_root_path = MakeRelativePath(mountpoint);

  SyncLock();
  // Find the catalog which should be removed
  WritableCatalog *nested_catalog = NULL;
  if (!FindCatalog(nested_root_path, &nested_catalog)) {
    LogCvmfs(kLogCatalog, kLogStderr, "failed to remove nested catalog '%s': "
             "mountpoint was not found in current catalog structure",
             nested_root_path.c_str());
    assert(false);
  }

  // Check if the found catalog is really the nested catalog to be deleted
  assert(!nested_catalog->IsRoot() &&
         (nested_catalog->path().ToString() == nested_root_path));

  // Merge all data from the nested catalog into it's parent
  nested_catalog->MergeIntoParent();

  // Delete the catalog database file from the working copy
  if (unlink(nested_catalog->database_path().c_str()) != 0) {
    LogCvmfs(kLogCatalog, kLogStderr,
             "unable to delete the removed nested catalog database file '%s'",
             nested_catalog->database_path().c_str());
    assert(false);
  }

  // Remove the catalog from internal data structures
  DetachCatalog(nested_catalog);
  SyncUnlock();
}
/**
 * Remove a nested catalog.
 * When you remove a nested catalog all entries currently held by it
 * will be merged into its parent catalog.
 * @param mountpoint the path of the nested catalog to be removed
 * @return true on success, false otherwise
 */
Remove a nested catalog.
When you remove a nested catalog all entries currently held by it
will be merged into its parent catalog.
@param mountpoint the path of the nested catalog to be removed
@return true on success, false otherwise
Remove a nested catalog . When you remove a nested catalog all entries currently held by it will be merged into its parent catalog . @param mountpoint the path of the nested catalog to be removed @return true on success false otherwise
void WritableCatalogManager::RemoveNestedCatalog(const string &mountpoint) {
  const string nested_root_path = MakeRelativePath(mountpoint);
  SyncLock();
  WritableCatalog *nested_catalog = NULL;
  if (!FindCatalog(nested_root_path, &nested_catalog)) {
    LogCvmfs(kLogCatalog, kLogStderr, "failed to remove nested catalog '%s': "
             "mountpoint was not found in current catalog structure",
             nested_root_path.c_str());
    assert(false);
  }
  assert(!nested_catalog->IsRoot() &&
         (nested_catalog->path().ToString() == nested_root_path));
  nested_catalog->MergeIntoParent();
  if (unlink(nested_catalog->database_path().c_str()) != 0) {
    LogCvmfs(kLogCatalog, kLogStderr,
             "unable to delete the removed nested catalog database file '%s'",
             nested_catalog->database_path().c_str());
    assert(false);
  }
  DetachCatalog(nested_catalog);
  SyncUnlock();
}
void WritableCatalogManager :: RemoveNestedCatalog ( const string & mountpoint ) { const string nested_root_path = MakeRelativePath ( mountpoint ) ; SyncLock ( ) ; WritableCatalog * nested_catalog = NULL ; if ( ! FindCatalog ( nested_root_path , & nested_catalog ) ) { LogCvmfs ( kLogCatalog , kLogStderr , " " " " , nested_root_path . c_str ( ) ) ; assert ( false ) ; } assert ( ! nested_catalog -> IsRoot ( ) && ( nested_catalog -> path ( ) . ToString ( ) == nested_root_path ) ) ; nested_catalog -> MergeIntoParent ( ) ; if ( unlink ( nested_catalog -> database_path ( ) . c_str ( ) ) != 0 ) { LogCvmfs ( kLogCatalog , kLogStderr , " " , nested_catalog -> database_path ( ) . c_str ( ) ) ; assert ( false ) ; } DetachCatalog ( nested_catalog ) ; SyncUnlock ( ) ; }
Remove a nested catalog.
Remove a nested catalog .
// Find the catalog which should be removed // Check if the found catalog is really the nested catalog to be deleted // Merge all data from the nested catalog into it's parent // Delete the catalog database file from the working copy // Remove the catalog from internal data structures