Some changes to support asynchronous fetching of inodes.
[bluesky.git] / bluesky / bluesky.h
index 6324ce2..6ddf605 100644 (file)
@@ -24,6 +24,11 @@ typedef struct {
 
     /* Write data in cache immediately after file is modified. */
     int writethrough_cache;
+
+    /* Can inodes be fetched asynchronously?  (Inode object is initially
+     * created in a pending state, and not unlocked until the data is actually
+     * available.) */
+    int async_inode_fetches;
 } BlueSkyOptions;
 
 extern BlueSkyOptions bluesky_options;
@@ -87,6 +92,10 @@ typedef enum {
     BLUESKY_SYMLINK = 5,
     BLUESKY_SOCKET = 6,
     BLUESKY_FIFO = 7,
+
+    /* Special types used only internally. */
+    BLUESKY_PENDING = 0,    /* Inode being loaded; type not yet determined */
+    BLUESKY_INVALID = -1,   /* Inode is invalid (failed to load) */
 } BlueSkyFileType;
 
 /* Filesystem state.  Each filesystem which is exported is represented by a
@@ -212,6 +221,7 @@ void bluesky_superblock_flush(BlueSkyFS *fs);
 int64_t bluesky_get_current_time();
 void bluesky_inode_update_ctime(BlueSkyInode *inode, gboolean update_mtime);
 uint64_t bluesky_fs_alloc_inode(BlueSkyFS *fs);
+void bluesky_init_inode(BlueSkyInode *i, BlueSkyFileType type);
 BlueSkyInode *bluesky_new_inode(uint64_t inum, BlueSkyFS *fs, BlueSkyFileType type);
 
 BlueSkyInode *bluesky_get_inode(BlueSkyFS *fs, uint64_t inum);