]> git.sur5r.net Git - bacula/bacula/commitdiff
bvfs: add clear_cache function
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 30 May 2011 15:52:25 +0000 (17:52 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:11 +0000 (14:50 +0200)
bacula/src/cats/bvfs.c
bacula/src/cats/bvfs.h

index 35e59c851d869e50c6d637cddc81c70b872e78b8..9aa58124f6d8a5f9b697176878293140550aeb72 100644 (file)
@@ -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;
index 0d85b2bf62b9a1cc093fb9e71ec4149e561dc710..5e5f39fb5aedcc18b59b12bad3c70e1106a93752 100644 (file)
@@ -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);