g_string_append_len(out, (gchar *)&size, sizeof(uint64_t));
for (int i = 0; i < inode->blocks->len; i++) {
BlueSkyBlock *b = &g_array_index(inode->blocks, BlueSkyBlock, i);
+ BlueSkyCloudID id;
+ memset(&id, 0, sizeof(id));
if (b->ref != NULL)
- g_string_append(out, b->ref);
- g_string_append_c(out, '\0');
+ id = b->ref->id;
+ g_string_append_len(out, (const char *)&id, sizeof(id));
}
break;
}
* indicating whether the deserialization was successful. */
gboolean bluesky_deserialize_inode(BlueSkyInode *inode, const gchar *buf)
{
- g_print("Deserializing inode %lld...\n", (long long)inode->inum);
+ if (bluesky_verbose) {
+ g_log("bluesky/serialize", G_LOG_LEVEL_DEBUG,
+ "Deserializing inode %lld...", (long long)inode->inum);
+ }
struct serialized_inode *raw = (struct serialized_inode *)buf;
g_array_set_size(inode->blocks,
(inode->size + BLUESKY_BLOCK_SIZE - 1)
/ BLUESKY_BLOCK_SIZE);
+ // TODO
+#if 0
for (int i = 0; i < inode->blocks->len; i++) {
BlueSkyBlock *b = &g_array_index(inode->blocks, BlueSkyBlock, i);
b->type = BLUESKY_BLOCK_REF;
b->ref = g_strdup(buf);
buf += strlen(b->ref) + 1;
}
+#endif
break;
case BLUESKY_DIRECTORY:
g_hash_table_insert(inode->dirhash_folded, dirent->name_folded,
dirent);
- g_print(" dirent[%08x]: %s -> %"PRIu64"\n",
- dirent->cookie, dirent->name, dirent->inum);
-
buf = strchr(d->name, '\0') + 1;
d = (struct serialized_dirent *)buf;
}