1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Function : qnx6 global filesystem definitions
6 * History : 17-01-2012 created
8 #ifndef _LINUX_QNX6_FS_H
9 #define _LINUX_QNX6_FS_H
11 #include <linux/types.h>
12 #include <linux/magic.h>
14 #define QNX6_ROOT_INO 1
17 #define QNX6_FILE_DIRECTORY 0x01
18 #define QNX6_FILE_DELETED 0x02
19 #define QNX6_FILE_NORMAL 0x03
21 #define QNX6_SUPERBLOCK_SIZE 0x200 /* superblock always is 512 bytes */
22 #define QNX6_SUPERBLOCK_AREA 0x1000 /* area reserved for superblock */
23 #define QNX6_BOOTBLOCK_SIZE 0x2000 /* heading bootblock area */
24 #define QNX6_DIR_ENTRY_SIZE 0x20 /* dir entry size of 32 bytes */
25 #define QNX6_INODE_SIZE 0x80 /* each inode is 128 bytes */
26 #define QNX6_INODE_SIZE_BITS 7 /* inode entry size shift */
28 #define QNX6_NO_DIRECT_POINTERS 16 /* 16 blockptrs in sbl/inode */
29 #define QNX6_PTR_MAX_LEVELS 5 /* maximum indirect levels */
32 #define QNX6_SHORT_NAME_MAX 27
33 #define QNX6_LONG_NAME_MAX 510
35 /* list of mount options */
36 #define QNX6_MOUNT_MMI_FS 0x010000 /* mount as Audi MMI 3G fs */
39 * This is the original qnx6 inode layout on disk.
40 * Each inode is 128 byte long.
42 struct qnx6_inode_entry {
52 __fs32 di_block_ptr[QNX6_NO_DIRECT_POINTERS];
60 * Each directory entry is maximum 32 bytes long.
61 * If more characters or special characters required it is stored
62 * in the longfilenames structure.
64 struct qnx6_dir_entry {
67 char de_fname[QNX6_SHORT_NAME_MAX];
71 * Longfilename direntries have a different structure
73 struct qnx6_long_dir_entry {
81 struct qnx6_long_filename {
83 __u8 lf_fname[QNX6_LONG_NAME_MAX];
86 struct qnx6_root_node {
88 __fs32 ptr[QNX6_NO_DIRECT_POINTERS];
94 struct qnx6_super_block {
98 __fs32 sb_ctime; /* time the fs was created */
99 __fs32 sb_atime; /* last access time */
101 __fs16 sb_version1; /* filesystem version information */
102 __fs16 sb_version2; /* filesystem version information */
103 __u8 sb_volumeid[16];
105 __fs32 sb_num_inodes;
106 __fs32 sb_free_inodes;
107 __fs32 sb_num_blocks;
108 __fs32 sb_free_blocks;
109 __fs32 sb_allocgroup;
110 struct qnx6_root_node Inode;
111 struct qnx6_root_node Bitmap;
112 struct qnx6_root_node Longfile;
113 struct qnx6_root_node Unknown;
116 /* Audi MMI 3G superblock layout is different to plain qnx6 */
117 struct qnx6_mmi_super_block {
124 __fs32 sb_num_inodes;
125 __fs32 sb_free_inodes;
126 __fs32 sb_num_blocks;
127 __fs32 sb_free_blocks;
129 struct qnx6_root_node Inode;
130 struct qnx6_root_node Bitmap;
131 struct qnx6_root_node Longfile;
132 struct qnx6_root_node Unknown;