cvmfs/catalog_mgr_rw.cc
void WritableCatalogManager::RemoveDirectory(const std::string &path) {
  const string directory_path = MakeRelativePath(path);
  const string parent_path = GetParentPath(directory_path);

  SyncLock();
  WritableCatalog *catalog;
  DirectoryEntry parent_entry;
  if (!FindCatalog(parent_path, &catalog, &parent_entry)) {
    LogCvmfs(kLogCatalog, kLogStderr,
             "catalog for directory '%s' cannot be found",
             directory_path.c_str());
    assert(false);
  }

  parent_entry.set_linkcount(parent_entry.linkcount() - 1);

  catalog->RemoveEntry(directory_path);
  catalog->UpdateEntry(parent_entry, parent_path);
  if (parent_entry.IsNestedCatalogRoot()) {
    LogCvmfs(kLogCatalog, kLogVerboseMsg, "updating transition point %s",
             parent_path.c_str());
    WritableCatalog *parent_catalog =
      reinterpret_cast<WritableCatalog *>(catalog->parent());
    parent_entry.set_is_nested_catalog_mountpoint(true);
    parent_entry.set_is_nested_catalog_root(false);
    parent_catalog->UpdateEntry(parent_entry, parent_path);
  }
  SyncUnlock();
}
/**
 * Remove the given directory from the catalogs.
 * @param directory_path the full path to the directory to be removed
 * @return true on success, false otherwise
 */
Remove the given directory from the catalogs.
@param directory_path the full path to the directory to be removed
@return true on success, false otherwise
Remove the given directory from the catalogs . @param directory_path the full path to the directory to be removed @return true on success false otherwise
void WritableCatalogManager::RemoveDirectory(const std::string &path) {
  const string directory_path = MakeRelativePath(path);
  const string parent_path = GetParentPath(directory_path);
  SyncLock();
  WritableCatalog *catalog;
  DirectoryEntry parent_entry;
  if (!FindCatalog(parent_path, &catalog, &parent_entry)) {
    LogCvmfs(kLogCatalog, kLogStderr,
             "catalog for directory '%s' cannot be found",
             directory_path.c_str());
    assert(false);
  }
  parent_entry.set_linkcount(parent_entry.linkcount() - 1);
  catalog->RemoveEntry(directory_path);
  catalog->UpdateEntry(parent_entry, parent_path);
  if (parent_entry.IsNestedCatalogRoot()) {
    LogCvmfs(kLogCatalog, kLogVerboseMsg, "updating transition point %s",
             parent_path.c_str());
    WritableCatalog *parent_catalog =
      reinterpret_cast<WritableCatalog *>(catalog->parent());
    parent_entry.set_is_nested_catalog_mountpoint(true);
    parent_entry.set_is_nested_catalog_root(false);
    parent_catalog->UpdateEntry(parent_entry, parent_path);
  }
  SyncUnlock();
}
void WritableCatalogManager :: RemoveDirectory ( const std :: string & path ) { const string directory_path = MakeRelativePath ( path ) ; const string parent_path = GetParentPath ( directory_path ) ; SyncLock ( ) ; WritableCatalog * catalog ; DirectoryEntry parent_entry ; if ( ! FindCatalog ( parent_path , & catalog , & parent_entry ) ) { LogCvmfs ( kLogCatalog , kLogStderr , " " , directory_path . c_str ( ) ) ; assert ( false ) ; } parent_entry . set_linkcount ( parent_entry . linkcount ( ) - 1 ) ; catalog -> RemoveEntry ( directory_path ) ; catalog -> UpdateEntry ( parent_entry , parent_path ) ; if ( parent_entry . IsNestedCatalogRoot ( ) ) { LogCvmfs ( kLogCatalog , kLogVerboseMsg , " " , parent_path . c_str ( ) ) ; WritableCatalog * parent_catalog = reinterpret_cast < WritableCatalog * > ( catalog -> parent ( ) ) ; parent_entry . set_is_nested_catalog_mountpoint ( true ) ; parent_entry . set_is_nested_catalog_root ( false ) ; parent_catalog -> UpdateEntry ( parent_entry , parent_path ) ; } SyncUnlock ( ) ; }
Remove the given directory from the catalogs.
Remove the given directory from the catalogs .