1 #ifndef _BLUESKY_INODE_H
2 #define _BLUESKY_INODE_H
7 /* File types. The numeric values are chosen to match with those used in
12 BLUESKY_DIRECTORY = 2,
14 BLUESKY_CHARACTER = 4,
20 /* Filesystem state. Each filesystem which is exported is represented by a
21 * single bluesky_fs structure in memory. */
25 gchar *name; /* Descriptive name for the filesystem */
26 GHashTable *inodes; /* Cached inodes */
27 uint64_t next_inum; /* Next available inode for allocation */
30 /* Timestamp, measured in microseconds since the Unix epoch. */
31 typedef int64_t bluesky_time;
33 /* In-memory representation of an inode within a Blue Sky server. This
34 * corresponds roughly with information that is committed to persistent
37 gint refcnt; /* May be accessed atomically without lock */
45 /* Rather than track an inode number and generation number, we will simply
46 * never re-use a fileid after a file is deleted. 64 bits should be enough
47 * that we don't exhaust the identifier space. */
50 uint64_t change_count; /* Incremented each with each change made */
51 int64_t atime; /* Microseconds since the Unix epoch */
54 int64_t ntime; /* "new time": time object was created */
56 /* File-specific fields */
59 /* Directory-specific fields */
63 /* A directory entry. The name is UTF-8 and is a freshly-allocated string.
64 * The name is hashed to a 64-bit value, and the directory entries are sorted
65 * by hash value (the hash value can then be used as a cookie for resuming a
73 uint64_t bluesky_directory_hash(gchar *name);