1 .. SPDX-License-Identifier: GPL-2.0 2 3 =================== 4 The QNX6 Filesystem 5 =================== 6 7 The qnx6fs is used by newer QNX operating syst 8 It got introduced in QNX 6.4.0 and is used def 9 10 Option 11 ====== 12 13 mmi_fs Mount filesystem as used for e 14 15 Specification 16 ============= 17 18 qnx6fs shares many properties with traditional 19 concepts of blocks, inodes and directories. 20 21 On QNX it is possible to create little endian 22 This feature makes it possible to create and u 23 for the target (QNX is used on quite a range o 24 running on a different endianness. 25 26 The Linux driver handles endianness transparen 27 28 Blocks 29 ------ 30 31 The space in the device or file is split up in 32 size of 512, 1024, 2048 or 4096, which is deci 33 created. 34 35 Blockpointers are 32bit, so the maximum space 36 2^32 * 4096 bytes or 16TB 37 38 The superblocks 39 --------------- 40 41 The superblock contains all global information 42 Each qnx6fs got two superblocks, each one havi 43 That serial number is used to identify the "ac 44 In write mode with reach new snapshot (after e 45 serial of the new master superblock is increas 46 47 So basically the snapshot functionality is rea 48 update of the serial number. Before updating t 49 are done by copying all modified blocks during 50 (or period) and building up a new (stable) fil 51 inactive superblock. 52 53 Each superblock holds a set of root inodes for 54 parts. (Inode, Bitmap and Longfilenames) 55 Each of these root nodes holds information lik 56 data and the addressing levels in that specifi 57 If the level value is 0, up to 16 direct block 58 node. 59 60 Level 1 adds an additional indirect addressing 61 addressing block holds up to blocksize / 4 byt 62 Level 2 adds an additional indirect addressing 63 to 16 * 256 * 256 = 1048576 blocks that can be 64 65 Unused block pointers are always set to ~0 - r 66 indirect addressing blocks or inodes. 67 68 Data leaves are always on the lowest level. So 69 tree levels. 70 71 The first Superblock is located at 0x2000. (0x 72 The Audi MMI 3G first superblock directly star 73 74 Second superblock position can either be calcu 75 information (total number of filesystem blocks 76 device address, zeroing the last 3 bytes and t 77 that address. 78 79 0x1000 is the size reserved for each superbloc 80 blocksize of the filesystem. 81 82 Inodes 83 ------ 84 85 Each object in the filesystem is represented b 86 The inode structure contains pointers to the f 87 the data held in the object and all of the met 88 its longname. (filenames longer than 27 charac 89 The metadata about an object includes the perm 90 size, number of blocks used, access time, chan 91 92 Object mode field is POSIX format. (which make 93 94 There are also pointers to the first 16 blocks 95 addressed with 16 direct blocks. 96 97 For more than 16 blocks an indirect addressing 98 used. (scheme is the same as the one used for 99 100 The filesize is stored 64bit. Inode counting s 101 filename inodes start with 0) 102 103 Directories 104 ----------- 105 106 A directory is a filesystem object and has an 107 It is a specially formatted file containing re 108 name with an inode number. 109 110 '.' inode number points to the directory inode 111 112 '..' inode number points to the parent directo 113 114 Eeach filename record additionally got a filen 115 116 One special case are long filenames or subdire 117 118 These got set a filename length field of 0xff 119 record plus the longfile inode number also sto 120 121 With that longfilename inode number, the longf 122 starting with the superblock longfilename root 123 124 Special files 125 ------------- 126 127 Symbolic links are also filesystem objects wit 128 bit in the inode mode field identifying them a 129 130 The directory entry file inode pointer points 131 132 Hard links got an inode, a directory entry, bu 133 no block pointers and the directory file recor 134 inode. 135 136 Character and block special devices do not exi 137 are handled by the QNX kernel/drivers and crea 138 underlying filesystem. 139 140 Long filenames 141 -------------- 142 143 Long filenames are stored in a separate addres 144 is the longfilename root node in the active su 145 146 Each data block (tree leaves) holds one long f 147 limited to 510 bytes. The first two starting b 148 for the actual filename. 149 150 If that structure shall fit for all allowed bl 151 is a limit of 510 bytes for the actual filenam 152 153 Bitmap 154 ------ 155 156 The qnx6fs filesystem allocation bitmap is sto 157 root node in the superblock and each bit in th 158 filesystem block. 159 160 The first block is block 0, which starts 0x100 161 So for a normal qnx6fs 0x3000 (bootblock + sup 162 address at which block 0 is located. 163 164 Bits at the end of the last bitmap block are s 165 smaller than addressing space in the bitmap. 166 167 Bitmap system area 168 ------------------ 169 170 The bitmap itself is divided into three parts. 171 172 First the system area, that is split into two 173 174 Then userspace. 175 176 The requirement for a static, fixed preallocat 177 qnx6fs deals with writes. 178 179 Each superblock got its own half of the system 180 always uses blocks from the lower half while s 181 blocks represented by the upper half bitmap sy 182 183 Bitmap blocks, Inode blocks and indirect addre 184 tree structures are treated as system blocks. 185 186 The rational behind that is that a write reque 187 (system area of the inactive - resp. lower ser 188 at the same time there is still a complete sta 189 other half of the system area. 190 191 When finished with writing (a sync write is co 192 time or a filesystem sync is requested), seria 193 superblock atomically is increased and the fs 194 stable declared - superblock. 195 196 For all data outside the system area, blocks a
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.