Serialized inode data should be dropped from caches, too.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Sat, 14 Aug 2010 22:47:40 +0000 (15:47 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Sat, 14 Aug 2010 22:47:40 +0000 (15:47 -0700)
bluesky/cache.c

index 2c1bc92..a4b9a0c 100644 (file)
@@ -163,6 +163,21 @@ static void drop_caches(BlueSkyInode *inode)
 {
     if (inode->type == BLUESKY_REGULAR)
         bluesky_file_drop_cached(inode);
+
+    BlueSkyCloudLog *log = inode->committed_item;
+    if (log != NULL) {
+        g_mutex_lock(log->lock);
+        if (log->data != NULL
+            && g_atomic_int_get(&log->data_lock_count) == 0
+            && (log->location_flags != 0))
+        {
+            bluesky_cloudlog_stats_update(log, -1);
+            bluesky_string_unref(log->data);
+            log->data = NULL;
+            bluesky_cloudlog_stats_update(log, 1);
+        }
+        g_mutex_unlock(log->lock);
+    }
 }
 
 /* Drop clean data from the cache if needed.  Clean data should generally be