From: Michael Vrable Date: Sat, 14 Aug 2010 22:47:40 +0000 (-0700) Subject: Serialized inode data should be dropped from caches, too. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=4bd76c48487520c2b1c08ff67009f752e0bde941;p=bluesky.git Serialized inode data should be dropped from caches, too. --- 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