CernVM-FS
2.12.0
|
#include "garbage_collector.h"
#include <dirent.h>
#include <errno.h>
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#include "helpers.h"
#include "shrinkwrap/fs_traversal.h"
#include "util/logging.h"
#include "util/posix.h"
#include "util/smalloc.h"
Go to the source code of this file.
Functions | |
void | InitializeGarbageCollection (struct fs_traversal_context *ctx) |
void | FinalizeGarbageCollection (struct fs_traversal_context *ctx) |
void * | PosixGcMainWorker (void *data) |
int | RunGarbageCollection (struct fs_traversal_context *ctx) |
void FinalizeGarbageCollection | ( | struct fs_traversal_context * | ctx | ) |
Finalizes the garbage collection Stores the content of the garbage collection hash map in the file at [data directory] + POSIX_GARBAGE_DIR + POSIX_GARBAGE_FLAGGED_FILE
Definition at line 61 of file garbage_collector.cc.
Referenced by FinalizeFsOperations().
void InitializeGarbageCollection | ( | struct fs_traversal_context * | ctx | ) |
This file is part of the CernVM File System. Initializes garbage collection by setting up the corresponding hash map in the fs_traversal_posix_context The initialization uses the data stored in the file at [data directory] + POSIX_GARBAGE_DIR + POSIX_GARBAGE_FLAGGED_FILE
This file contains a fixed length concatenation of inodes (type ino_t) which should be checked and deleted upon garbage collection
Definition at line 31 of file garbage_collector.cc.
Referenced by InitialFsOperations().
void* PosixGcMainWorker | ( | void * | data | ) |
Main Worker of the Posix Garbage Collector Iterates over a calculated set of directories and check for inodes that can be deleted. For the thread with thread number j the thread starts with the top level data directory /j/ and iterates over the contained files. Afterwards it continues with /j+i*n/ where n is the number of total threads and i is an arbitrary integer.
Definition at line 87 of file garbage_collector.cc.
Referenced by RunGarbageCollection().
int RunGarbageCollection | ( | struct fs_traversal_context * | ctx | ) |
Method which runs the garbage collection. Will start posix_ctx->num_threads in parallel for the task. For posix_ctx->num_threads <= 1 there is a fallback to a sequential version.
Definition at line 162 of file garbage_collector.cc.
Referenced by posix_garbage_collector().