Track memory usage statistics for cached data.
[bluesky.git] / bluesky / bluesky.h
index fdc2e39..3fc1c6a 100644 (file)
@@ -116,6 +116,12 @@ typedef struct {
     uint64_t next_inum;         /* Next available inode for allocation */
 
     BlueSkyStore *store;
+
+    /* Accounting for memory used for caches.  Space is measured in blocks, not
+     * bytes.  We track both total data in the caches and dirty data (total
+     * data includes dirty data).  Updates to these variables must be made
+     * atomically. */
+    gint cache_total, cache_dirty;
 } BlueSkyFS;
 
 /* Inode number of the root directory. */