return (int64_t)t.tv_sec * 1000000 + t.tv_usec;
}
+/* Update an inode to indicate that a modification was made. This increases
+ * the change counter, updates the ctime to the current time, and optionally
+ * updates the mtime. */
+void bluesky_inode_update_ctime(BlueSkyInode *inode, gboolean update_mtime)
+{
+ int64_t now = bluesky_get_current_time();
+ inode->change_count++;
+ inode->ctime = now;
+ if (update_mtime)
+ inode->mtime = now;
+}
+
/* Unfortunately a glib hash table is only guaranteed to be able to store
* 32-bit keys if we use the key directly. If we want 64-bit inode numbers,
* we'll have to allocate memory to store the 64-bit inumber, and use a pointer
break;
case BLUESKY_DIRECTORY:
i->dirents = g_sequence_new(bluesky_dirent_destroy);
+ i->dirhash = g_hash_table_new(g_str_hash, g_str_equal);
break;
case BLUESKY_BLOCK:
case BLUESKY_CHARACTER: