g_string_append_len(state->data, (const char *)&header, sizeof(header));
g_string_append_len(state->data, log->data->data, log->data->len);
+ /* If the object we flushed was an inode, update the inode map. */
+ if (log->type == LOGTYPE_INODE) {
+ g_mutex_lock(fs->lock);
+ InodeMapEntry *entry = bluesky_inode_map_lookup(fs->inode_map,
+ log->inum, 1);
+ entry->id = log->id;
+ entry->location = log->location;
+ g_mutex_unlock(fs->lock);
+ }
+
/* TODO: We should mark the objects as committed on the cloud until the
* data is flushed and acknowledged. */
log->pending_write |= CLOUDLOG_CLOUD;