#include <sys/types.h> #include <sys/fs/bfs.h>
struct bfs_bdsuphead { long bh_bfsmagic; /* Magic number */ off_t bh_start; /* Filesystem data start offset */ off_t bh_end; /* Filesystem data end offset */ };/* * The sanity structure is used to promote sanity in compaction. Used * correctly, a crash at any point during compaction is recoverable. */ struct bfs_sanity { daddr_t fromblock; /* "From" block of current transfer */ daddr_t toblock; /* "To" block of current transfer */ daddr_t bfromblock; /* Backup of "from" block */ daddr_t btoblock; /* Backup of "to" block */ };
struct bdsuper { struct bfs_bdsuphead bdsup_head; /* Header info */ struct bfs_sanity bdsup_sane; /* Crash recovery info whilst compacting */ char bdsup_fsname[6]; /* file system name */ char bdsup_volume[6]; /* file system volume name */ long bdsup_filler[118]; /* Padding */
}; #define BFS_MAGIC 0x1BADFACE /* bfs magic number */
The sanity structure is used to promote sanity during compaction. It is used by fsck(1M) to recover from a system crash at any point during compaction.