*/
struct lafs_dev {
char idtag[16]; /* LaFS-DeviceBlock */
- char version[16]; /* number space options */
u8 uuid[16];
u32 checksum;
u32 seq;
+ u32 version; /* Currently must be LAFS_DEV_VERS == 1 */
+ u32 pad0;
u64 ctime;
u64 start, size; /* in array address space (array block)*/
u32 segment_offset; /* offset of first segment (device byte) */
u32 segment_count;
u32 usage_inum; /* inum of segment usage file */
- u32 level;
+ char options[512]; /* Space separated, nul terminated, Cap for
+ * read-only-if-you-don't-understand
+ */
} __attribute__((packed));
-#define LAFS_DEVBLK_SIZE 1024
+#define LAFS_DEVBLK_SIZE 1024
+#define LAFS_DEV_VERS 1
struct lafs_state {
char idtag[16]; /* LaFS-State-Block */
- char version[16]; /* number space options */
+ u8 uuid[16];
+ u8 alt_uuid[16]; /* allows sharing of read-only devices
+ * between arrays
+ */
u32 checksum;
+ u32 version; /* Must be LAFS_STATE_VERS == 1 */
u32 seq;
- u8 uuid[16];
- u32 levels;
+ u32 alt_seq; /* seq number of the alt_uuid devices */
u32 devices;
+ u32 pad0;
+
u32 nonlog_offset; /* offset into following segment of next non-logged
* block to allocate
*/
u16 nextyouth;
u32 maxsnapshot;
+ u64 inconsistencies;/* bit set of discovered inconsistency types.
+ * If any unknown bits are set, an fsck is needed
+ * for writing.
+ * If known bits are set, behaviour is dependant
+ * on those bits.
+ */
+
u64 checkpointcluster; /* (array block) */
+ char options[512]; /* Space separated, nul terminated. */
u64 root_inodes[0]; /* (array block) */
} __attribute__((packed));
+#define LAFS_STATE_VERS 1
struct descriptor {
u32 block_num; /* (file block) */
if (strncmp(db->idtag, "LaFS-DeviceBlock", 16) != 0)
return 0;
- if (strncmp(db->version, "AlphaDevel ", 16) != 0)
+ if (le32_to_cpu(db->version) != LAFS_DEV_VERS)
return 0;
/* uuid can be anything */
crc = db->checksum;
if (le32_to_cpu(db->segment_offset) + segsize > (size << db->blockbits))
return 0;
- if (le32_to_cpu(db->level) > 10)
- return 0;
-
/* I guess it look sane enough... */
return 1;
}
u32 crc;
if (strncmp(st->idtag, "LaFS-State-Block", 16) != 0)
return 0;
- if (strncmp(st->version, "AlphaDevel ", 16) != 0)
+ if (le32_to_cpu(st->version) != LAFS_STATE_VERS)
return 0;
crc = st->checksum;
st->checksum = 0;
> (1<<dv->statebits))
return 0;
+ /* Don't support RO sharing yet. */
+ if (st->alt_seq)
+ return 0;
+
return 1;
}
#endif
fs->seq = le32_to_cpu(st->seq);
- fs->levels = le32_to_cpu(st->levels);
fs->devices = op->devcnt;
fs->devs_loaded = fs->devices; /* FIXME use this or lose this */
fs->statesize = 1 << op->statebits;
dv->segment_offset = le32_to_cpu(dv->devblk->segment_offset);
dv->segment_count = le32_to_cpu(dv->devblk->segment_count);
dv->usage_inum = le32_to_cpu(dv->devblk->usage_inum);
- dv->level = le16_to_cpu(dv->devblk->level);
if (dv->segment_size > fs->max_segment)
fs->max_segment = dv->segment_size;