X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fbluesky.h;h=5524c4435cd53039d570ece09de6a4c4af03e643;hb=92a6fa8cd45e12f70f65f9d9fc6d1cdd6592878a;hp=2cf97f6e475a24928f3ec80c8b3a311b70052a00;hpb=6357b9d1de3bfb09811297406688810b4900df7b;p=bluesky.git diff --git a/bluesky/bluesky.h b/bluesky/bluesky.h index 2cf97f6..5524c44 100644 --- a/bluesky/bluesky.h +++ b/bluesky/bluesky.h @@ -10,6 +10,7 @@ #define _BLUESKY_H #include +#include #include #ifdef __cplusplus @@ -18,6 +19,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 +131,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; @@ -200,7 +208,12 @@ 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 }