Miscellaneous fixes.
[bluesky.git] / bluesky / bluesky.h
index 8980c98..7419cd4 100644 (file)
@@ -18,6 +18,8 @@ extern "C" {
 
 void bluesky_init(void);
 
+gchar *bluesky_lowercase(const gchar *s);
+
 /* Reference-counted blocks of memory, used for passing data in and out of
  * storage backends and in other places. */
 typedef struct {
@@ -128,7 +130,12 @@ typedef struct {
      * that we don't exhaust the identifier space. */
     uint64_t inum;
 
-    uint64_t change_count;      /* Incremented each with each change made */
+    /* change_count is increased with every operation which modifies the inode,
+     * and can be used to determine if cached data is still valid.
+     * change_commit is the value of change_count when the inode was last
+     * committed to stable storage. */
+    uint64_t change_count, change_commit;
+
     int64_t atime;              /* Microseconds since the Unix epoch */
     int64_t ctime;
     int64_t mtime;
@@ -199,6 +206,14 @@ void bluesky_file_write(BlueSkyInode *inode, uint64_t offset,
 void bluesky_file_read(BlueSkyInode *inode, uint64_t offset,
                        char *buf, gint len);
 
+void bluesky_inode_flush(BlueSkyFS *fs, BlueSkyInode *inode);
+void bluesky_inode_fetch(BlueSkyFS *fs, uint64_t inum);
+void bluesky_serialize_inode(GString *out, BlueSkyInode *inode);
+BlueSkyInode *bluesky_deserialize_inode(BlueSkyFS *fs, const gchar *buf);
+
+gint bluesky_dirent_compare(gconstpointer a, gconstpointer b,
+                            gpointer unused);
+
 #ifdef __cplusplus
 }
 #endif