X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fbluesky.h;h=7419cd439daa2082fa6db0fca37db09b2fa590ee;hb=e9636461ac9e6c7075ac0866f8554b947fc464ba;hp=8980c981db7d73f6c91d6bb56969b08be526e3ce;hpb=a5a9eca66728d271a442125ac52098378c70cf42;p=bluesky.git diff --git a/bluesky/bluesky.h b/bluesky/bluesky.h index 8980c98..7419cd4 100644 --- a/bluesky/bluesky.h +++ b/bluesky/bluesky.h @@ -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