Subversion Repositories Kolibri OS

Rev

Rev 7736 | Rev 9889 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2013-2022. All rights reserved. ;;
  4. ;;  Distributed under terms of the GNU General Public License   ;;
  5. ;;                                                              ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8. $Revision: 9888 $
  9.  
  10. ; file types from stat.h
  11. S_IFMT      = 0170000o  ; These bits determine file type
  12. S_IFDIR     = 0040000o  ; Directory
  13. S_IFCHR     = 0020000o  ; Character device
  14. S_IFBLK     = 0060000o  ; Block device
  15. S_IFREG     = 0100000o  ; Regular file
  16. S_IFIFO     = 0010000o  ; FIFO
  17. S_IFLNK     = 0120000o  ; Symbolic link
  18. S_IFSOCK    = 0140000o  ; Socket
  19.  
  20. ; XFS null constant: empty fields must be all ones, not zeros!
  21. XFS_NULL                = -1
  22.  
  23. XFS_SECT_SB             = 0
  24.  
  25. ; signatures of file system structures
  26. XFS_AGF_MAGIC           = 'XAGF'
  27. XFS_DINODE_MAGIC        = 'IN'
  28. XFS_BMAP_MAGIC          = 'BMAP'
  29. XFS_DA_NODE_MAGIC       = 0xbefe
  30. XFS_DIR2_LEAF1_MAGIC    = 0xf1d2
  31. XFS_DIR2_LEAFN_MAGIC    = 0xffd2
  32. XFS_DIR2_BLOCK_MAGIC    = 'XD2B'
  33. XFS_DIR2_DATA_MAGIC     = 'XD2D'
  34.  
  35. XFS_BMAP3_MAGIC         = 'BMA3'
  36. XFS_DA3_NODE_MAGIC      = 0xbe3e        ; non-leaf blocks
  37. XFS_DIR3_LEAF1_MAGIC    = 0xf13d        ; v3 dir single blks
  38. XFS_DIR3_LEAFN_MAGIC    = 0xff3d        ; v3 dir multi blks
  39. XFS_DIR3_BLOCK_MAGIC    = 'XDB3'        ; single block dirs
  40. XFS_DIR3_DATA_MAGIC     = 'XDD3'        ; multiblock dirs
  41.  
  42. XFS_SB_MAGIC               = 'XFSB'
  43. XFS_SB_VERSION_NUMBITS     = 0x000f
  44. XFS_SB_VERSION_ALLFBITS    = 0xfff0
  45. XFS_SB_VERSION_REALFBITS   = 0x0ff0
  46. XFS_SB_VERSION_ATTRBIT     = 0x0010
  47. XFS_SB_VERSION_NLINKBIT    = 0x0020
  48. XFS_SB_VERSION_QUOTABIT    = 0x0040
  49. XFS_SB_VERSION_ALIGNBIT    = 0x0080
  50. XFS_SB_VERSION_DALIGNBIT   = 0x0100
  51. XFS_SB_VERSION_SHAREDBIT   = 0x0200
  52. XFS_SB_VERSION_LOGV2BIT    = 0x0400
  53. XFS_SB_VERSION_SECTORBIT   = 0x0800
  54. XFS_SB_VERSION_EXTFLGBIT   = 0x1000
  55. XFS_SB_VERSION_DIRV2BIT    = 0x2000
  56. XFS_SB_VERSION_BORGBIT     = 0x4000     ; ASCII only case-insensitive
  57. XFS_SB_VERSION_MOREBITSBIT = 0x8000
  58.  
  59. XFS_SB_VERSION_SUPPORTED = XFS_SB_VERSION_NUMBITS     OR \
  60.                            XFS_SB_VERSION_ATTRBIT     OR \
  61.                            XFS_SB_VERSION_NLINKBIT    OR \
  62.                            XFS_SB_VERSION_QUOTABIT    OR \
  63.                            XFS_SB_VERSION_ALIGNBIT    OR \
  64.                            XFS_SB_VERSION_LOGV2BIT    OR \
  65.                            XFS_SB_VERSION_SECTORBIT   OR \
  66.                            XFS_SB_VERSION_EXTFLGBIT   OR \
  67.                            XFS_SB_VERSION_DIRV2BIT    OR \
  68.                            XFS_SB_VERSION_MOREBITSBIT
  69.  
  70. XFS_SB_VERSION2_RESERVED1BIT   = 0x00000001
  71. XFS_SB_VERSION2_LAZYSBCOUNTBIT = 0x00000002     ; Superblk counters
  72. XFS_SB_VERSION2_RESERVED4BIT   = 0x00000004
  73. XFS_SB_VERSION2_ATTR2BIT       = 0x00000008     ; Inline attr rework
  74. XFS_SB_VERSION2_PARENTBIT      = 0x00000010     ; parent pointers in xattr
  75. XFS_SB_VERSION2_PROJID32BIT    = 0x00000080     ; 32 bit project id
  76. XFS_SB_VERSION2_CRCBIT         = 0x00000100     ; metadata CRCs
  77. XFS_SB_VERSION2_FTYPE          = 0x00000200     ; inode type in dir
  78.  
  79. XFS_SB_VERSION2_SUPPORTED = XFS_SB_VERSION2_LAZYSBCOUNTBIT OR \
  80.                             XFS_SB_VERSION2_ATTR2BIT       OR \
  81.                             XFS_SB_VERSION2_PARENTBIT      OR \
  82.                             XFS_SB_VERSION2_PROJID32BIT    OR \
  83.                             XFS_SB_VERSION2_CRCBIT         OR \
  84.                             XFS_SB_VERSION2_FTYPE
  85.  
  86. XFS_SB_FEAT_INCOMPAT_FTYPE     = 1      ; filetype in dirent
  87. XFS_SB_FEAT_INCOMPAT_SPINODES  = 2      ; sparse inode chunks
  88. XFS_SB_FEAT_INCOMPAT_META_UUID = 4      ; metadata UUID
  89. XFS_SB_FEAT_INCOMPAT_BIGTIME   = 8      ; large timestamps
  90. XFS_SB_FEAT_INCOMPAT_SUPPORTED = XFS_SB_FEAT_INCOMPAT_FTYPE    OR \
  91.                                  XFS_SB_FEAT_INCOMPAT_SPINODES OR \
  92.                                  XFS_SB_FEAT_INCOMPAT_META_UUID OR \
  93.                                  XFS_SB_FEAT_INCOMPAT_BIGTIME
  94.  
  95. ; bitfield lengths for packed extent
  96. ; MSB to LSB / left to right
  97. BMBT_EXNTFLAG_BITLEN    =  1
  98. BMBT_STARTOFF_BITLEN    = 54
  99. BMBT_STARTBLOCK_BITLEN  = 52
  100. BMBT_BLOCKCOUNT_BITLEN  = 21
  101.  
  102. XFS_DIR2_DATA_ALIGN_LOG = 3
  103. XFS_DIR2_DATA_ALIGN     = 1 SHL XFS_DIR2_DATA_ALIGN_LOG
  104. XFS_DIR2_SPACE_SIZE     = (1 SHL (32 + XFS_DIR2_DATA_ALIGN_LOG))
  105. XFS_DIR2_DATA_OFFSET    = 0*XFS_DIR2_SPACE_SIZE
  106. XFS_DIR2_LEAF_OFFSET    = 1*XFS_DIR2_SPACE_SIZE
  107. XFS_DIR2_FREE_OFFSET    = 2*XFS_DIR2_SPACE_SIZE
  108.  
  109. ; data section magic constants for directories (xfs_dir2_data.h)
  110. XFS_DIR2_DATA_FD_COUNT  = 3
  111.  
  112. ; valid inode formats
  113. ; enum xfs_dinode_fmt (xfs_dinode.h)
  114. XFS_DINODE_FMT_DEV      = 0
  115. XFS_DINODE_FMT_LOCAL    = 1
  116. XFS_DINODE_FMT_EXTENTS  = 2
  117. XFS_DINODE_FMT_BTREE    = 3
  118. XFS_DINODE_FMT_UUID     = 4
  119.  
  120. ; size of the unlinked inode hash table in the agi
  121. XFS_AGI_UNLINKED_BUCKETS = 64
  122.  
  123. ; possible extent states
  124. ; enum xfs_exntst_t (xfs_bmap_btree.h)
  125. XFS_EXT_NORM            = 0
  126. XFS_EXT_UNWRITTEN       = 1
  127. XFS_EXT_DMAPI_OFFLINE   = 2
  128. XFS_EXT_INVALID         = 3
  129.  
  130. ; values for inode core flags / di_flags (xfs_dinode.h)
  131. XFS_DIFLAG_REALTIME_BIT     =  0        ; file's blocks come from rt area
  132. XFS_DIFLAG_PREALLOC_BIT     =  1        ; file space has been preallocated
  133. XFS_DIFLAG_NEWRTBM_BIT      =  2        ; for rtbitmap inode, new format
  134. XFS_DIFLAG_NODUMP_BIT       =  7        ; do not dump
  135. XFS_DIFLAG_REALTIME         = (1 SHL XFS_DIFLAG_REALTIME_BIT)
  136. XFS_DIFLAG_PREALLOC         = (1 SHL XFS_DIFLAG_PREALLOC_BIT)
  137. XFS_DIFLAG_NEWRTBM          = (1 SHL XFS_DIFLAG_NEWRTBM_BIT)
  138. XFS_DIFLAG_NODUMP           = (1 SHL XFS_DIFLAG_NODUMP_BIT)
  139.  
  140. ; superblock _ondisk_ structure (xfs_sb.h)
  141. ; this is _not_ the partition structure
  142. ; for XFS partition structure see XFS below
  143. struct xfs_sb
  144.         sb_magicnum              dd ?   ; signature, must be XFS_SB_MAGIC
  145.         sb_blocksize             dd ?   ; block is the minimal file system unit, in bytes
  146.         sb_dblocks               DQ ?   ; number of data blocks
  147.         sb_rblocks               DQ ?   ; number of realtime blocks
  148.         sb_rextents              DQ ?   ; number of realtime extents
  149.         sb_uuid                  rb 16  ; file system unique identifier
  150.         sb_logstart              DQ ?   ; starting block of log (for internal journal)
  151.         sb_rootino               DQ ?   ; root inode number
  152.         sb_rbmino                DQ ?   ; bitmap inode for realtime extents
  153.         sb_rsumino               DQ ?   ; summary inode for rt bitmap
  154.         sb_rextsize              dd ?   ; realtime extent size, blocks
  155.         sb_agblocks              dd ?   ; size of an allocation group (the last one may be smaller!)
  156.         sb_agcount               dd ?   ; number of allocation groups
  157.         sb_rbmblocks             dd ?   ; number of rt bitmap blocks
  158.         sb_logblocks             dd ?   ; number of log blocks
  159.         sb_versionnum            dw ?   ; header version
  160.         sb_sectsize              dw ?   ; volume sector size in bytes
  161.         sb_inodesize             dw ?   ; inode size, bytes
  162.         sb_inopblock             dw ?   ; inodes per block
  163.         sb_fname                 rb 12  ; inodes per block (aka label)
  164.         sb_blocklog              db ?   ; log2 of sb_blocksize
  165.         sb_sectlog               db ?   ; log2 of sb_blocksize
  166.         sb_inodelog              db ?   ; log2 of sb_inodesize
  167.         sb_inopblog              db ?   ; log2 of sb_inopblock
  168.         sb_agblklog              db ?   ; log2 of sb_agblocks (rounded up!)
  169.         sb_rextslog              db ?   ; log2 of sb_rextents
  170.         sb_inprogress            db ?   ; mkfs is in progress, don't mount
  171.         sb_imax_pct              db ?   ; max % of fs for inode space
  172.         ; statistics
  173.         sb_icount                DQ ?   ; allocated inodes
  174.         sb_ifree                 DQ ?   ; free inodes
  175.         sb_fdblocks              DQ ?   ; free data blocks
  176.         sb_frextents             DQ ?   ; free realtime extents
  177.  
  178.         sb_uquotino              DQ ?   ; user quota inode
  179.         sb_gquotino              DQ ?   ; group quota inode
  180.         sb_qflags                dw ?   ; quota flags
  181.         sb_flags                 db ?   ; misc. flags
  182.         sb_shared_vn             db ?   ; shared version number
  183.         sb_inoalignmt            dd ?   ; inode chunk alignment, fsblocks
  184.         sb_unit                  dd ?   ; stripe or raid unit
  185.         sb_width                 dd ?   ; stripe or raid width
  186.         sb_dirblklog             db ?   ; log2 of dir block size (fsbs)
  187.         sb_logsectlog            db ?   ; log2 of the log sector size
  188.         sb_logsectsize           dw ?   ; sector size for the log, bytes
  189.         sb_logsunit              dd ?   ; stripe unit size for the log
  190.         sb_features2             dd ?   ; additional feature bits
  191.         sb_bad_features2         dd ?
  192.         sb_features_compat       dd ?
  193.         sb_features_ro_compat    dd ?
  194.         sb_features_incompat     dd ?
  195.         sb_features_log_incompat dd ?
  196.         sb_crc                   dd ?   ; superblock crc
  197.         sb_spino_align           dd ?   ; sparse inode chunk alignment
  198.         sb_pquotino              DQ ?   ; project quota inode
  199.         sb_lsn                   DQ ?   ; last write sequence
  200.         sb_meta_uuid             rb 16  ; metadata file system unique id
  201. ends
  202.  
  203. ; inode core structure: basic information about file
  204. struct xfs_dinode_core
  205.         di_magic         dw ?           ; inode magic = XFS_DINODE_MAGIC
  206.         di_mode          dw ?           ; mode and type of file
  207.         di_version       db ?           ; inode version
  208.         di_format        db ?           ; format of di_c data
  209.         di_onlink        dw ?           ; old number of links to file
  210.         di_uid           dd ?           ; owner's user id
  211.         di_gid           dd ?           ; owner's group id
  212.         di_nlink         dd ?           ; number of links to file
  213.         di_projid        dw ?           ; owner's project id
  214.         di_pad           rb 8           ; unused, zeroed space
  215.         di_flushiter     dw ?           ; incremented on flush
  216.         di_atime         DQ             ; time last accessed
  217.         di_mtime         DQ               ; time last modified
  218.         di_ctime         DQ             ; time created/inode modified
  219.         di_size          DQ ?           ; number of bytes in file
  220.         di_nblocks       DQ ?           ; number of direct & btree blocks used
  221.         di_extsize       dd ?           ; basic/minimum extent size for file
  222.         di_nextents      dd ?           ; number of extents in data fork
  223.         di_anextents     dw ?           ; number of extents in attribute fork
  224.         di_forkoff       db ?           ; attr fork offs, <<3 for 64b align
  225.         di_aformat       db ?           ; format of attr fork's data
  226.         di_dmevmask      dd ?           ; DMIG event mask
  227.         di_dmstate       dw ?           ; DMIG state info
  228.         di_flags         dw ?           ; random flags, XFS_DIFLAG_...
  229.         di_gen           dd ?           ; generation number
  230.         di_next_unlinked dd ?           ; unlinked but still used inode (if any, XFS_NULL otherwise)
  231. ends
  232.  
  233. struct xfs_dinode3_core xfs_dinode_core
  234.         di_crc           dd ?           ; CRC of the inode
  235.         di_changecount   DQ ?           ; number of attribute changes
  236.         di_lsn           DQ ?           ; flush sequence
  237.         di_flags2        DQ ?           ; more random flags
  238.         di_cowextsize    dd ?           ; basic cow extent size for file
  239.         di_pad2          rb 12          ; more padding for future expansion
  240.  
  241.         ; fields only written to during inode creation
  242.         di_crtime        DQ             ; time created
  243.         di_ino           DQ ?           ; inode number
  244.         di_uuid          rb 16          ; UUID of the filesystem
  245. ends
  246.  
  247.  
  248. struct xfs_dir2_sf_hdr
  249.         count           db ?
  250.         i8count         db ?
  251.         parent          DQ ?            ; parent inode number, 4 or 8 bytes
  252. ends        
  253.  
  254. struct xfs_dir2_sf_entry
  255.         namelen         db ?            ; actual name length (ASCII)
  256.         offset          rb 2            ; saved offset
  257.         name            db ?            ; name, variable size
  258.         inumber         DQ ?            ; 4 or 8 bytes
  259. ends
  260.  
  261. struct xfs_dir2_sf
  262.         hdr     xfs_dir2_sf_hdr
  263.         entries xfs_dir2_sf_entry
  264. ends
  265.  
  266. ; active entry in a data block
  267. ; aligned to 8 bytes
  268. ; tag appears as the last 2 bytes
  269. struct xfs_dir2_data_entry
  270.         inumber         DQ ?
  271.         namelen         db ?
  272.         name            db ?            ; name bytes array without terminator
  273. ;       tag             dw ?            ; starting offset of the entry
  274. ends
  275.  
  276. ; unused entry in a data block
  277. struct xfs_dir2_data_unused
  278.         freetag         dw ?            ; XFS_DIR2_DATA_FREE_TAG aka XFS_NULL
  279.         length          dw ?            ; total free length
  280. ;        tag             dw ?           ; starting offset of the entry
  281. ends
  282.  
  283. ; generic data entry
  284. struct xfs_dir2_data_union
  285.   union
  286.         xentry          xfs_dir2_data_entry
  287.         unused          xfs_dir2_data_unused
  288.   ends
  289. ends
  290.  
  291. ; describe a free area in the data block
  292. ; the freespace will be formatted as a xfs_dir2_data_unused_t
  293. struct xfs_dir2_data_free
  294.         offset          dw ?            ; start of freespace
  295.         length          dw ?            ; length of freespace
  296. ends
  297.  
  298. ; header for the data blocks
  299. ; always at the beginning of a directory-sized block
  300. ; the code knows that XFS_DIR2_DATA_FD_COUNT is 3
  301. struct xfs_dir2_data_hdr
  302.         magic           dd ?            ; XFS_DIR2_DATA_MAGIC or XFS_DIR2_BLOCK_MAGIC
  303.         bestfree        xfs_dir2_data_free
  304.         bestfree2       xfs_dir2_data_free
  305.         bestfree3       xfs_dir2_data_free
  306. ends
  307.  
  308. struct xfs_dir3_data_hdr xfs_dir2_data_hdr
  309.         magic3  dd ?
  310.         crc     dd ?
  311.         blkno   DQ ?
  312.         lsn     DQ ?
  313.         uuid    rb 16
  314.         owner   DQ ?
  315. ends
  316.  
  317. ; leaf block entry
  318. struct xfs_dir2_leaf_entry
  319.         hashval         dd ?            ; hash value of name
  320.         address         dd ?            ; address of data entry
  321. ends
  322.  
  323. ; the tail of directory block
  324. struct xfs_dir2_block_tail
  325.         count           dd ?            ; count of leaf entries
  326.         stale           dd ?            ; count of stale leaf entries
  327. ends
  328.  
  329. ; generic single-block structure, for xfs_db
  330. struct xfs_dir2_block
  331.         hdr             xfs_dir2_data_hdr       ; magic XFS_DIR2_DATA_MAGIC
  332.         u               xfs_dir2_data_union
  333. ;        leaf            xfs_dir2_leaf_entry
  334. ;        tail            xfs_dir2_block_tail
  335. ends
  336.  
  337. struct xfs_da_blkinfo
  338.         forw            dd ?            ; previous block in list
  339.         back            dd ?            ; following block in list
  340.         magic           dw ?            ; validity check on block
  341.         pad             dw ?            ; unused
  342. ends
  343.  
  344. struct xfs_dir2_leaf_hdr
  345.         info            xfs_da_blkinfo
  346.         count           dw ?
  347.         stale           dw ?
  348. ends
  349.  
  350. struct xfs_da3_blkinfo xfs_da_blkinfo
  351.         crc   dd ?      ; CRC of block
  352.         blkno DQ ?      ; first block of the buffer
  353.         lsn   DQ ?      ; sequence number of last write
  354.         uuid  rb 16     ; filesystem we belong to
  355.         owner DQ ?      ; inode that owns the block
  356. ends
  357.  
  358. struct xfs_dir3_leaf_hdr
  359.         info            xfs_da3_blkinfo
  360.         count           dw ?
  361.         stale           dw ?
  362.         pad             dd ?
  363. ends
  364.  
  365. ; bests and tail are at the end of the block for single-leaf only
  366. ; (magic = XFS_DIR2_LEAF1_MAGIC not XFS_DIR2_LEAFN_MAGIC)
  367. struct xfs_dir2_leaf
  368.         hdr             xfs_dir2_leaf_hdr
  369.         ents            xfs_dir2_leaf_entry
  370. ;       bests           dw ?
  371. ;       tail            xfs_dir2_leaf_tail
  372. ends
  373.  
  374. struct xfs_dir3_leaf
  375.         hdr             xfs_dir3_leaf_hdr
  376.         ents            xfs_dir2_leaf_entry
  377. ;       bests
  378. ;       tail
  379. ends
  380.  
  381. struct xfs_dir2_free_hdr
  382.         magic           dd ?    ; XFS_DIR2_FREE_MAGIC
  383.         firstdb         dd ?    ; db of first entry
  384.         nvalid          dd ?    ; count of valid entries
  385.         nused           dd ?    ; count of used entries
  386. ends
  387.  
  388. struct xfs_da_node_hdr
  389.         info            xfs_da_blkinfo
  390.         count           dw ?
  391.         level           dw ?
  392. ends
  393.  
  394. struct xfs_da_node_entry
  395.         hashval         dd ?            ; hash value for this descendant
  396.         before          dd ?            ; Btree block before this key
  397. ends
  398.  
  399. struct xfs_da_intnode
  400.         hdr             xfs_da_node_hdr
  401.         btree           xfs_da_node_entry
  402. ends
  403.  
  404. struct xfs_da3_node_hdr
  405.         info            xfs_da3_blkinfo
  406.         count           dw ?
  407.         level           dw ?
  408.         pad             dd ?
  409. ends
  410.  
  411. struct xfs_da3_intnode
  412.         hdr             xfs_da3_node_hdr
  413.         btree           xfs_da_node_entry
  414. ends
  415.  
  416. ; packet extent
  417. struct xfs_bmbt_rec
  418.         l0              DQ ?
  419.         l1              DQ ?
  420. ends
  421.  
  422. ; unpacked extent
  423. struct xfs_bmbt_irec
  424.         br_startoff     DQ ?
  425.         br_startblock   DQ ?
  426.         br_blockcount   dd ?
  427.         br_state        dd ?
  428. ends
  429.  
  430. struct xfs_dir2_bmx
  431.         bmx     xfs_bmbt_rec
  432. ends
  433.  
  434. ; bmap root header
  435. struct xfs_bmdr_block
  436.         bb_level        dw ?            ; 0 is a leaf
  437.         bb_numrecs      dw ?            ; current number of data records
  438. ends
  439.  
  440. ; key structure for non-leaf levels of the tree
  441. struct xfs_bmbt_key
  442.         br_startoff     DQ ?            ; starting file offset
  443. ends
  444.  
  445. struct xfs_bmdr_ptr DQ
  446. ends
  447.  
  448. struct xfs_bmbt_ptr DQ
  449. ends
  450.  
  451. ; long form header: bmap btrees
  452. ; xfs_btree_lblock is xfs_bmbt_block (xfs_btree.h)
  453. struct xfs_bmbt_block
  454.         bb_magic        dd ?            ; magic number for block type
  455.         bb_level        dw ?            ; 0 is a leaf
  456.         bb_numrecs      dw ?            ; current number of data records
  457.         bb_leftsib      DQ ?            ; left sibling block or NULLDFSBNO
  458.         bb_rightsib     DQ ?            ; right sibling block or NULLDFSBNO
  459. ends
  460.  
  461. struct xfs_bmbt3_block xfs_bmbt_block
  462.         bb_blkno        DQ ?
  463.         bb_lsn          DQ ?
  464.         bb_uuid         rb 16
  465.         bb_owner        DQ ?
  466.         bb_crc          dd ?
  467.         bb_pad          dd ?
  468. ends
  469.  
  470. struct xfs_inode
  471.         di_core                 xfs_dinode_core ; main info, aka core
  472.         union
  473.                 di_u            db ?            ; data fork inode part
  474.                 dir2_sf         xfs_dir2_sf
  475.                 bmx             xfs_dir2_bmx
  476.         ends
  477. ;        di_a                    db ?           ; data attribute
  478. ends
  479.  
  480. struct xfs_agf
  481.         agf_magicnum    dd ?    ; magic number == XFS_AGF_MAGIC
  482.         agf_versionnum  dd ?    ; header version == XFS_AGF_VERSION
  483.         agf_seqno       dd ?    ; sequence # starting from 0
  484.         agf_length      dd ?    ; size in blocks of AG
  485.         agf_roots       dd ?
  486.         agf_levels      dd ?
  487.         agf_flfirst     dd ?
  488.         agf_fllast      dd ?
  489.         agf_flcount     dd ?
  490.         agf_freeblks    dd ?    ; free blocks in AG
  491. ends
  492.  
  493. ; internal data for every XFS partition
  494. ; this _is_ XFS partition structure
  495. ; most fields are unpacked or bswap'ed values of the superblock, see xfs_sb structure above
  496. struct XFS PARTITION
  497.         Lock                    MUTEX ?         ; access mutex
  498.         sectsize                dd ?
  499.         blocksize               dd ?
  500.         dirblocksize            dd ?
  501.         inodesize               dd ?
  502.         rootino                 DQ ?
  503.         versionnum              dd ?
  504.         version                 dd ?
  505.         features2               dd ?
  506.         inopblock               dd ?
  507.         blkpdirblk              dd ?
  508.         blocklog                dd ?
  509.         sectlog                 dd ?
  510.         inodelog                dd ?
  511.         inopblog                dd ?
  512.         agblklog                dd ?
  513.         sectpblog               dd ?
  514.         dirblklog               dd ?    ; in fsblocks
  515.         sectpblock              dd ?
  516.         agblocks                dd ?
  517.         dir2_leaf_offset_blocks DQ ?
  518.         dir2_free_offset_blocks DQ ?
  519.         agblockmask             DQ ?
  520.         inode_core_size         dd ?
  521.         features_incompat       dd ?
  522.         ftype_size              dd ?
  523.         dir_block_magic         dd ?
  524.         dir_data_magic          dd ?
  525.         dir_leaf1_magic         dw ?
  526.         dir_leafn_magic         dw ?
  527.         da_node_magic           dw ?
  528.         bmap_magic              dd ?
  529.         bmbt_block_size         dd ?
  530.         dir_block_size          dd ?
  531.         dir_data_size           dd ?
  532.         dir_leaf1_size          dd ?
  533.         dir_leafn_size          dd ?
  534.         da_node_size            dd ?
  535.         da_blkinfo_size         dd ?
  536.         conv_time_to_kos_epoch  dd ?
  537.         ; helpers, temporary vars, etc
  538.         ; should go to file descriptor and local vars?
  539.         cur_block               dd ?
  540.         cur_block_data          dd ?
  541.         cur_inode               dd ?
  542.         cur_sect                dd ?
  543.         cur_dirblock            dd ?
  544.         tmp_inode               dd ?
  545.         extent                  xfs_bmbt_irec
  546.         bytes_to_read           dd ?
  547.         bytes_read              dd ?
  548.         bytes_left_in_file      DQ ?
  549.         file_offset             DQ ?
  550.         file_buffer             dd ?
  551.         entries_read            dd ?
  552.         requested_cnt           dd ?
  553.         dir_sf_self_done        dd ?
  554.         dir_sf_parent_done      dd ?
  555.         entries_left_in_dir     dd ?
  556.         entries_to_skip         dd ?
  557.         max_dirblockaddr        dd ?
  558.         cur_inode_save          dd ?
  559.         shortform_inodelen      dd ?
  560.         bdfe_nameenc            dd ?
  561.         bdfe_len                dd ?
  562.         bdfe_process            dd ?
  563.         inode_self              DQ ?
  564.         bdfe_buf                dd ?
  565.         eof                     dd ?
  566.         offset_begin            DQ ?
  567.         offset_end              DQ ?
  568. ends
  569.  
  570. struct f70s0arg
  571.         sf       dd ?
  572.         offset   DQ ?
  573.         count    dd ?
  574.         buf      dd ?
  575.         zero     db ?
  576.         path     dd ?
  577. ends
  578.  
  579. struct f70s1arg
  580.         sf        dd ?
  581.         start_idx dd ?
  582.         encoding  dd ?
  583.         count     dd ?
  584.         buf       dd ?
  585.         zero      db ?
  586.         path      dd ?
  587. ends
  588.  
  589. struct f70s5arg
  590.         sf     dd ?
  591.                dd ?
  592.         xflags dd ?     ; name flags is already used
  593.                dd ?
  594.         buf    dd ?
  595.         zero   db ?
  596.         path   dd ?
  597. ends
  598.  
  599. struct bdfe_hdr
  600.         version   dd ?
  601.         read_cnt  dd ?
  602.         total_cnt dd ?
  603.         zeroed    rd 5
  604. ends
  605.  
  606. struct bdfe
  607.         attr     dd ?
  608.         nameenc  dd ?
  609.         ctime    dd ?
  610.         cdate    dd ?
  611.         atime    dd ?
  612.         adate    dd ?
  613.         mtime    dd ?
  614.         mdate    dd ?
  615.         size     DQ ?
  616.         name     db ?
  617. ends
  618.