Subversion Repositories Kolibri OS

Rev

Rev 5363 | Rev 9888 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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