From: Eric Bollengier Date: Mon, 30 May 2011 15:52:25 +0000 (+0200) Subject: bvfs: add clear_cache function X-Git-Tag: Release-7.0.0~478 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0da3392f6754e4c174fca7f5c6b543691dadbf93;p=bacula%2Fbacula bvfs: add clear_cache function --- diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c index 35e59c851d..9aa58124f6 100644 --- a/bacula/src/cats/bvfs.c +++ b/bacula/src/cats/bvfs.c @@ -836,6 +836,15 @@ static bool check_temp(char *output_table) return false; } +void Bvfs::clear_cache() +{ + db_sql_query(db, "BEGIN", NULL, NULL); + db_sql_query(db, "UPDATE Job SET HasCache=0", NULL, NULL); + db_sql_query(db, "TRUNCATE PathHierarchy", NULL, NULL); + db_sql_query(db, "TRUNCATE PathVisibility", NULL, NULL); + db_sql_query(db, "COMMIT", NULL, NULL); +} + bool Bvfs::drop_restore_list(char *output_table) { POOL_MEM query; diff --git a/bacula/src/cats/bvfs.h b/bacula/src/cats/bvfs.h index 0d85b2bf62..5e5f39fb5a 100644 --- a/bacula/src/cats/bvfs.h +++ b/bacula/src/cats/bvfs.h @@ -153,6 +153,9 @@ public: offset+=limit; } + /* Clear all cache */ + void clear_cache(); + /* Compute restore list */ bool compute_restore_list(char *fileid, char *dirid, char *hardlink, char *output_table);