3
0

jfs_dat.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * jfs_dat.h --- stripped down header file which only contains the JFS
  4. * on-disk data structures
  5. */
  6. #define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */
  7. /*
  8. * On-disk structures
  9. */
  10. /*
  11. * Descriptor block types:
  12. */
  13. #define JFS_DESCRIPTOR_BLOCK 1
  14. #define JFS_COMMIT_BLOCK 2
  15. #define JFS_SUPERBLOCK 3
  16. /*
  17. * Standard header for all descriptor blocks:
  18. */
  19. typedef struct journal_header_s
  20. {
  21. __u32 h_magic;
  22. __u32 h_blocktype;
  23. __u32 h_sequence;
  24. } journal_header_t;
  25. /*
  26. * The block tag: used to describe a single buffer in the journal
  27. */
  28. typedef struct journal_block_tag_s
  29. {
  30. __u32 t_blocknr; /* The on-disk block number */
  31. __u32 t_flags; /* See below */
  32. } journal_block_tag_t;
  33. /* Definitions for the journal tag flags word: */
  34. #define JFS_FLAG_ESCAPE 1 /* on-disk block is escaped */
  35. #define JFS_FLAG_SAME_UUID 2 /* block has same uuid as previous */
  36. #define JFS_FLAG_DELETED 4 /* block deleted by this transaction */
  37. #define JFS_FLAG_LAST_TAG 8 /* last tag in this descriptor block */
  38. /*
  39. * The journal superblock
  40. */
  41. typedef struct journal_superblock_s
  42. {
  43. journal_header_t s_header;
  44. /* Static information describing the journal */
  45. __u32 s_blocksize; /* journal device blocksize */
  46. __u32 s_maxlen; /* total blocks in journal file */
  47. __u32 s_first; /* first block of log information */
  48. /* Dynamic information describing the current state of the log */
  49. __u32 s_sequence; /* first commit ID expected in log */
  50. __u32 s_start; /* blocknr of start of log */
  51. } journal_superblock_t;