From 4bd76c48487520c2b1c08ff67009f752e0bde941 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Sat, 14 Aug 2010 15:47:40 -0700 Subject: [PATCH] Serialized inode data should be dropped from caches, too. --- bluesky/cache.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bluesky/cache.c b/bluesky/cache.c index 2c1bc92..a4b9a0c 100644 --- a/bluesky/cache.c +++ b/bluesky/cache.c @@ -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 -- 2.20.1