X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Finode.c;h=40531cdd1aaa1157b29644b51b2f7c272a2c5a53;hb=4db23448ce252728f10df967b55b2787d5fb8db5;hp=ef6e75d0718b179758827eacbc75542f8a7a584c;hpb=e26a903ddf80011e3b72a780d7392a8333c996af;p=bluesky.git diff --git a/bluesky/inode.c b/bluesky/inode.c index ef6e75d..40531cd 100644 --- a/bluesky/inode.c +++ b/bluesky/inode.c @@ -83,6 +83,7 @@ BlueSkyFS *bluesky_new_fs(gchar *name) bluesky_fs_key_equal_func); fs->next_inum = BLUESKY_ROOT_INUM + 1; fs->store = bluesky_store_new("file"); + fs->flushd_lock = g_mutex_new(); return fs; } @@ -133,10 +134,14 @@ void bluesky_inode_unref(BlueSkyInode *inode) /* Sanity check: Is the inode clean? */ if (inode->change_commit < inode->change_count + || inode->accessed_list != NULL || inode->dirty_list != NULL) { - g_warning("Dropping inode which is not clean (commit %"PRIi64" < change %"PRIi64"; dirty_list = %p)\n", inode->change_commit, inode->change_count, inode->dirty_list); + g_warning("Dropping inode which is not clean (commit %"PRIi64" < change %"PRIi64"; accessed_list = %p; dirty_list = %p)\n", inode->change_commit, inode->change_count, inode->accessed_list, inode->dirty_list); } + /* These shouldn't be needed, but in case the above warning fires and + * we delete the inode anyway, we ought to be sure the inode is not on + * any LRU list. */ g_mutex_lock(inode->fs->lock); bluesky_list_unlink(&inode->fs->accessed_list, inode->accessed_list); bluesky_list_unlink(&inode->fs->dirty_list, inode->dirty_list);