CernVM-FS  2.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cvmfs_fsck.cc File Reference
#include "cvmfs_config.h"
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdint.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include "atomic.h"
#include "compression.h"
#include "hash.h"
#include "logging.h"
#include "platform.h"
#include "smalloc.h"
#include "util/posix.h"
#include "util_concurrency.h"
Include dependency graph for cvmfs_fsck.cc:

Go to the source code of this file.

Macros

#define _FILE_OFFSET_BITS   64
 

Enumerations

enum  Errors {
  kErrorOk = 0, kErrorFixed = 1, kErrorReboot = 2, kErrorUnfixed = 4,
  kErrorOperational = 8, kErrorUsage = 16, kErrorOk = 0, kErrorFixed = 1,
  kErrorReboot = 2, kErrorUnfixed = 4, kErrorOperational = 8, kErrorUsage = 16
}
 

Functions

static void Usage ()
 
static bool GetNextFile (string *relative_path, string *hash_name)
 
static void * MainCheck (void *data __attribute__((unused)))
 
int main (int argc, char **argv)
 

Variables

string * g_cache_dir
 
atomic_int32 g_num_files
 
atomic_int32 g_num_err_fixed
 
atomic_int32 g_num_err_unfixed
 
atomic_int32 g_num_err_operational
 
atomic_int32 g_num_tmp_catalog
 
pthread_mutex_t g_lock_traverse = PTHREAD_MUTEX_INITIALIZER
 
DIR * g_DIRP_current = NULL
 
int g_num_dirs = -1
 
string * g_current_dir
 
int g_num_threads = 1
 
bool g_fix_errors = false
 
bool g_verbose = false
 
atomic_int32 g_force_rebuild
 
atomic_int32 g_modified_cache
 

Macro Definition Documentation

#define _FILE_OFFSET_BITS   64

This file is part of the CernVM File System.

This tool checks a cvmfs cache directory for consistency. If necessary, the managed cache db is removed so that it will be rebuilt on next mount.

Definition at line 9 of file cvmfs_fsck.cc.

Enumeration Type Documentation

enum Errors
Enumerator
kErrorOk 
kErrorFixed 
kErrorReboot 
kErrorUnfixed 
kErrorOperational 
kErrorUsage 
kErrorOk 
kErrorFixed 
kErrorReboot 
kErrorUnfixed 
kErrorOperational 
kErrorUsage 

Definition at line 37 of file cvmfs_fsck.cc.

Function Documentation

static bool GetNextFile ( string *  relative_path,
string *  hash_name 
)
static

Definition at line 83 of file cvmfs_fsck.cc.

Referenced by MainCheck().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 243 of file cvmfs_fsck.cc.

Here is the call graph for this function:

static void* MainCheck ( void *data   __attribute__(unused))
static

Definition at line 139 of file cvmfs_fsck.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void Usage ( )
static

Definition at line 67 of file cvmfs_fsck.cc.

Variable Documentation

string* g_cache_dir

Definition at line 46 of file cvmfs_fsck.cc.

Referenced by GetNextFile(), main(), and MainCheck().

string* g_current_dir

Current cache sub directory

Definition at line 58 of file cvmfs_fsck.cc.

Referenced by GetNextFile(), and main().

DIR* g_DIRP_current = NULL

Definition at line 56 of file cvmfs_fsck.cc.

Referenced by GetNextFile().

bool g_fix_errors = false

Definition at line 61 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

atomic_int32 g_force_rebuild

Definition at line 63 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

pthread_mutex_t g_lock_traverse = PTHREAD_MUTEX_INITIALIZER

Traversal of the file system tree is serialized.

Definition at line 55 of file cvmfs_fsck.cc.

Referenced by GetNextFile().

atomic_int32 g_modified_cache

Definition at line 64 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

int g_num_dirs = -1

Number of cache directories already examined.

Definition at line 57 of file cvmfs_fsck.cc.

Referenced by GetNextFile().

atomic_int32 g_num_err_fixed

Definition at line 48 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

atomic_int32 g_num_err_operational

Definition at line 50 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

atomic_int32 g_num_err_unfixed

Definition at line 49 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

atomic_int32 g_num_files

Definition at line 47 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

int g_num_threads = 1

Definition at line 60 of file cvmfs_fsck.cc.

Referenced by main().

atomic_int32 g_num_tmp_catalog

Definition at line 51 of file cvmfs_fsck.cc.

Referenced by main(), and MainCheck().

bool g_verbose = false

Definition at line 62 of file cvmfs_fsck.cc.

Referenced by GetNextFile(), main(), and MainCheck().