mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-17 20:29:24 +00:00
docs: filesystems: convert qnx6.txt to ReST
- Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/ccd22c1e1426ce4cb30ece9a71c39ebb41844762.1581955849.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
c33e97efa9
commit
d5eefa2c5e
2 changed files with 23 additions and 0 deletions
|
@ -82,5 +82,6 @@ Documentation for filesystem implementations.
|
||||||
orangefs
|
orangefs
|
||||||
overlayfs
|
overlayfs
|
||||||
proc
|
proc
|
||||||
|
qnx6
|
||||||
virtiofs
|
virtiofs
|
||||||
vfat
|
vfat
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
.. SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
===================
|
||||||
The QNX6 Filesystem
|
The QNX6 Filesystem
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
@ -14,10 +17,12 @@ Specification
|
||||||
|
|
||||||
qnx6fs shares many properties with traditional Unix filesystems. It has the
|
qnx6fs shares many properties with traditional Unix filesystems. It has the
|
||||||
concepts of blocks, inodes and directories.
|
concepts of blocks, inodes and directories.
|
||||||
|
|
||||||
On QNX it is possible to create little endian and big endian qnx6 filesystems.
|
On QNX it is possible to create little endian and big endian qnx6 filesystems.
|
||||||
This feature makes it possible to create and use a different endianness fs
|
This feature makes it possible to create and use a different endianness fs
|
||||||
for the target (QNX is used on quite a range of embedded systems) platform
|
for the target (QNX is used on quite a range of embedded systems) platform
|
||||||
running on a different endianness.
|
running on a different endianness.
|
||||||
|
|
||||||
The Linux driver handles endianness transparently. (LE and BE)
|
The Linux driver handles endianness transparently. (LE and BE)
|
||||||
|
|
||||||
Blocks
|
Blocks
|
||||||
|
@ -26,6 +31,7 @@ Blocks
|
||||||
The space in the device or file is split up into blocks. These are a fixed
|
The space in the device or file is split up into blocks. These are a fixed
|
||||||
size of 512, 1024, 2048 or 4096, which is decided when the filesystem is
|
size of 512, 1024, 2048 or 4096, which is decided when the filesystem is
|
||||||
created.
|
created.
|
||||||
|
|
||||||
Blockpointers are 32bit, so the maximum space that can be addressed is
|
Blockpointers are 32bit, so the maximum space that can be addressed is
|
||||||
2^32 * 4096 bytes or 16TB
|
2^32 * 4096 bytes or 16TB
|
||||||
|
|
||||||
|
@ -50,6 +56,7 @@ Each of these root nodes holds information like total size of the stored
|
||||||
data and the addressing levels in that specific tree.
|
data and the addressing levels in that specific tree.
|
||||||
If the level value is 0, up to 16 direct blocks can be addressed by each
|
If the level value is 0, up to 16 direct blocks can be addressed by each
|
||||||
node.
|
node.
|
||||||
|
|
||||||
Level 1 adds an additional indirect addressing level where each indirect
|
Level 1 adds an additional indirect addressing level where each indirect
|
||||||
addressing block holds up to blocksize / 4 bytes pointers to data blocks.
|
addressing block holds up to blocksize / 4 bytes pointers to data blocks.
|
||||||
Level 2 adds an additional indirect addressing block level (so, already up
|
Level 2 adds an additional indirect addressing block level (so, already up
|
||||||
|
@ -57,11 +64,13 @@ to 16 * 256 * 256 = 1048576 blocks that can be addressed by such a tree).
|
||||||
|
|
||||||
Unused block pointers are always set to ~0 - regardless of root node,
|
Unused block pointers are always set to ~0 - regardless of root node,
|
||||||
indirect addressing blocks or inodes.
|
indirect addressing blocks or inodes.
|
||||||
|
|
||||||
Data leaves are always on the lowest level. So no data is stored on upper
|
Data leaves are always on the lowest level. So no data is stored on upper
|
||||||
tree levels.
|
tree levels.
|
||||||
|
|
||||||
The first Superblock is located at 0x2000. (0x2000 is the bootblock size)
|
The first Superblock is located at 0x2000. (0x2000 is the bootblock size)
|
||||||
The Audi MMI 3G first superblock directly starts at byte 0.
|
The Audi MMI 3G first superblock directly starts at byte 0.
|
||||||
|
|
||||||
Second superblock position can either be calculated from the superblock
|
Second superblock position can either be calculated from the superblock
|
||||||
information (total number of filesystem blocks) or by taking the highest
|
information (total number of filesystem blocks) or by taking the highest
|
||||||
device address, zeroing the last 3 bytes and then subtracting 0x1000 from
|
device address, zeroing the last 3 bytes and then subtracting 0x1000 from
|
||||||
|
@ -84,6 +93,7 @@ Object mode field is POSIX format. (which makes things easier)
|
||||||
|
|
||||||
There are also pointers to the first 16 blocks, if the object data can be
|
There are also pointers to the first 16 blocks, if the object data can be
|
||||||
addressed with 16 direct blocks.
|
addressed with 16 direct blocks.
|
||||||
|
|
||||||
For more than 16 blocks an indirect addressing in form of another tree is
|
For more than 16 blocks an indirect addressing in form of another tree is
|
||||||
used. (scheme is the same as the one used for the superblock root nodes)
|
used. (scheme is the same as the one used for the superblock root nodes)
|
||||||
|
|
||||||
|
@ -96,13 +106,18 @@ Directories
|
||||||
A directory is a filesystem object and has an inode just like a file.
|
A directory is a filesystem object and has an inode just like a file.
|
||||||
It is a specially formatted file containing records which associate each
|
It is a specially formatted file containing records which associate each
|
||||||
name with an inode number.
|
name with an inode number.
|
||||||
|
|
||||||
'.' inode number points to the directory inode
|
'.' inode number points to the directory inode
|
||||||
|
|
||||||
'..' inode number points to the parent directory inode
|
'..' inode number points to the parent directory inode
|
||||||
|
|
||||||
Eeach filename record additionally got a filename length field.
|
Eeach filename record additionally got a filename length field.
|
||||||
|
|
||||||
One special case are long filenames or subdirectory names.
|
One special case are long filenames or subdirectory names.
|
||||||
|
|
||||||
These got set a filename length field of 0xff in the corresponding directory
|
These got set a filename length field of 0xff in the corresponding directory
|
||||||
record plus the longfile inode number also stored in that record.
|
record plus the longfile inode number also stored in that record.
|
||||||
|
|
||||||
With that longfilename inode number, the longfilename tree can be walked
|
With that longfilename inode number, the longfilename tree can be walked
|
||||||
starting with the superblock longfilename root node pointers.
|
starting with the superblock longfilename root node pointers.
|
||||||
|
|
||||||
|
@ -111,6 +126,7 @@ Special files
|
||||||
|
|
||||||
Symbolic links are also filesystem objects with inodes. They got a specific
|
Symbolic links are also filesystem objects with inodes. They got a specific
|
||||||
bit in the inode mode field identifying them as symbolic link.
|
bit in the inode mode field identifying them as symbolic link.
|
||||||
|
|
||||||
The directory entry file inode pointer points to the target file inode.
|
The directory entry file inode pointer points to the target file inode.
|
||||||
|
|
||||||
Hard links got an inode, a directory entry, but a specific mode bit set,
|
Hard links got an inode, a directory entry, but a specific mode bit set,
|
||||||
|
@ -126,9 +142,11 @@ Long filenames
|
||||||
|
|
||||||
Long filenames are stored in a separate addressing tree. The staring point
|
Long filenames are stored in a separate addressing tree. The staring point
|
||||||
is the longfilename root node in the active superblock.
|
is the longfilename root node in the active superblock.
|
||||||
|
|
||||||
Each data block (tree leaves) holds one long filename. That filename is
|
Each data block (tree leaves) holds one long filename. That filename is
|
||||||
limited to 510 bytes. The first two starting bytes are used as length field
|
limited to 510 bytes. The first two starting bytes are used as length field
|
||||||
for the actual filename.
|
for the actual filename.
|
||||||
|
|
||||||
If that structure shall fit for all allowed blocksizes, it is clear why there
|
If that structure shall fit for all allowed blocksizes, it is clear why there
|
||||||
is a limit of 510 bytes for the actual filename stored.
|
is a limit of 510 bytes for the actual filename stored.
|
||||||
|
|
||||||
|
@ -138,6 +156,7 @@ Bitmap
|
||||||
The qnx6fs filesystem allocation bitmap is stored in a tree under bitmap
|
The qnx6fs filesystem allocation bitmap is stored in a tree under bitmap
|
||||||
root node in the superblock and each bit in the bitmap represents one
|
root node in the superblock and each bit in the bitmap represents one
|
||||||
filesystem block.
|
filesystem block.
|
||||||
|
|
||||||
The first block is block 0, which starts 0x1000 after superblock start.
|
The first block is block 0, which starts 0x1000 after superblock start.
|
||||||
So for a normal qnx6fs 0x3000 (bootblock + superblock) is the physical
|
So for a normal qnx6fs 0x3000 (bootblock + superblock) is the physical
|
||||||
address at which block 0 is located.
|
address at which block 0 is located.
|
||||||
|
@ -149,11 +168,14 @@ Bitmap system area
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
The bitmap itself is divided into three parts.
|
The bitmap itself is divided into three parts.
|
||||||
|
|
||||||
First the system area, that is split into two halves.
|
First the system area, that is split into two halves.
|
||||||
|
|
||||||
Then userspace.
|
Then userspace.
|
||||||
|
|
||||||
The requirement for a static, fixed preallocated system area comes from how
|
The requirement for a static, fixed preallocated system area comes from how
|
||||||
qnx6fs deals with writes.
|
qnx6fs deals with writes.
|
||||||
|
|
||||||
Each superblock got it's own half of the system area. So superblock #1
|
Each superblock got it's own half of the system area. So superblock #1
|
||||||
always uses blocks from the lower half while superblock #2 just writes to
|
always uses blocks from the lower half while superblock #2 just writes to
|
||||||
blocks represented by the upper half bitmap system area bits.
|
blocks represented by the upper half bitmap system area bits.
|
Loading…
Add table
Reference in a new issue