aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorKai Bankett <chaosman@ontika.net>2012-02-16 23:59:20 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-20 21:29:38 -0400
commit5d026c7242201e7c9d0e12fcb2bcaffead9d59fd (patch)
tree3a3663fd35e3077574e30cf705a614ede69925eb /include/linux
parent516cdb68e5b44ca1bef31619f5da8d5e9e298f88 (diff)
fs: initial qnx6fs addition
Adds support for qnx6fs readonly support to the linux kernel. * Mount option The option mmi_fs can be used to mount Harman Becker/Audi MMI 3G HDD qnx6fs filesystems. * Documentation A high level filesystem stucture description can be found in the Documentation/filesystems directory. (qnx6.txt) * Additional features - Active (stable) superblock selection - Superblock checksum check (enforced) - Supports mount of qnx6 filesystems with to host different endianess - Automatic endianess detection - Longfilename support (with non-enfocing crc check) - All blocksizes (512, 1024, 2048 and 4096 supported) Signed-off-by: Kai Bankett <chaosman@ontika.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/qnx6_fs.h134
2 files changed, 135 insertions, 0 deletions
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 2d4beab0d5b7..b7ed4759dbb2 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -42,6 +42,7 @@
42#define OPENPROM_SUPER_MAGIC 0x9fa1 42#define OPENPROM_SUPER_MAGIC 0x9fa1
43#define PROC_SUPER_MAGIC 0x9fa0 43#define PROC_SUPER_MAGIC 0x9fa0
44#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */ 44#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
45#define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */
45 46
46#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */ 47#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
47 /* used by file system utilities that 48 /* used by file system utilities that
diff --git a/include/linux/qnx6_fs.h b/include/linux/qnx6_fs.h
new file mode 100644
index 000000000000..26049eab9010
--- /dev/null
+++ b/include/linux/qnx6_fs.h
@@ -0,0 +1,134 @@
1/*
2 * Name : qnx6_fs.h
3 * Author : Kai Bankett
4 * Function : qnx6 global filesystem definitions
5 * History : 17-01-2012 created
6 */
7#ifndef _LINUX_QNX6_FS_H
8#define _LINUX_QNX6_FS_H
9
10#include <linux/types.h>
11#include <linux/magic.h>
12
13#define QNX6_ROOT_INO 1
14
15/* for di_status */
16#define QNX6_FILE_DIRECTORY 0x01
17#define QNX6_FILE_DELETED 0x02
18#define QNX6_FILE_NORMAL 0x03
19
20#define QNX6_SUPERBLOCK_SIZE 0x200 /* superblock always is 512 bytes */
21#define QNX6_SUPERBLOCK_AREA 0x1000 /* area reserved for superblock */
22#define QNX6_BOOTBLOCK_SIZE 0x2000 /* heading bootblock area */
23#define QNX6_DIR_ENTRY_SIZE 0x20 /* dir entry size of 32 bytes */
24#define QNX6_INODE_SIZE 0x80 /* each inode is 128 bytes */
25#define QNX6_INODE_SIZE_BITS 7 /* inode entry size shift */
26
27#define QNX6_NO_DIRECT_POINTERS 16 /* 16 blockptrs in sbl/inode */
28#define QNX6_PTR_MAX_LEVELS 5 /* maximum indirect levels */
29
30/* for filenames */
31#define QNX6_SHORT_NAME_MAX 27
32#define QNX6_LONG_NAME_MAX 510
33
34/* list of mount options */
35#define QNX6_MOUNT_MMI_FS 0x010000 /* mount as Audi MMI 3G fs */
36
37/*
38 * This is the original qnx6 inode layout on disk.
39 * Each inode is 128 byte long.
40 */
41struct qnx6_inode_entry {
42 __fs64 di_size;
43 __fs32 di_uid;
44 __fs32 di_gid;
45 __fs32 di_ftime;
46 __fs32 di_mtime;
47 __fs32 di_atime;
48 __fs32 di_ctime;
49 __fs16 di_mode;
50 __fs16 di_ext_mode;
51 __fs32 di_block_ptr[QNX6_NO_DIRECT_POINTERS];
52 __u8 di_filelevels;
53 __u8 di_status;
54 __u8 di_unknown2[2];
55 __fs32 di_zero2[6];
56};
57
58/*
59 * Each directory entry is maximum 32 bytes long.
60 * If more characters or special characters required it is stored
61 * in the longfilenames structure.
62 */
63struct qnx6_dir_entry {
64 __fs32 de_inode;
65 __u8 de_size;
66 char de_fname[QNX6_SHORT_NAME_MAX];
67};
68
69/*
70 * Longfilename direntries have a different structure
71 */
72struct qnx6_long_dir_entry {
73 __fs32 de_inode;
74 __u8 de_size;
75 __u8 de_unknown[3];
76 __fs32 de_long_inode;
77 __fs32 de_checksum;
78};
79
80struct qnx6_long_filename {
81 __fs16 lf_size;
82 __u8 lf_fname[QNX6_LONG_NAME_MAX];
83};
84
85struct qnx6_root_node {
86 __fs64 size;
87 __fs32 ptr[QNX6_NO_DIRECT_POINTERS];
88 __u8 levels;
89 __u8 mode;
90 __u8 spare[6];
91};
92
93struct qnx6_super_block {
94 __fs32 sb_magic;
95 __fs32 sb_checksum;
96 __fs64 sb_serial;
97 __fs32 sb_ctime; /* time the fs was created */
98 __fs32 sb_atime; /* last access time */
99 __fs32 sb_flags;
100 __fs16 sb_version1; /* filesystem version information */
101 __fs16 sb_version2; /* filesystem version information */
102 __u8 sb_volumeid[16];
103 __fs32 sb_blocksize;
104 __fs32 sb_num_inodes;
105 __fs32 sb_free_inodes;
106 __fs32 sb_num_blocks;
107 __fs32 sb_free_blocks;
108 __fs32 sb_allocgroup;
109 struct qnx6_root_node Inode;
110 struct qnx6_root_node Bitmap;
111 struct qnx6_root_node Longfile;
112 struct qnx6_root_node Unknown;
113};
114
115/* Audi MMI 3G superblock layout is different to plain qnx6 */
116struct qnx6_mmi_super_block {
117 __fs32 sb_magic;
118 __fs32 sb_checksum;
119 __fs64 sb_serial;
120 __u8 sb_spare0[12];
121 __u8 sb_id[12];
122 __fs32 sb_blocksize;
123 __fs32 sb_num_inodes;
124 __fs32 sb_free_inodes;
125 __fs32 sb_num_blocks;
126 __fs32 sb_free_blocks;
127 __u8 sb_spare1[4];
128 struct qnx6_root_node Inode;
129 struct qnx6_root_node Bitmap;
130 struct qnx6_root_node Longfile;
131 struct qnx6_root_node Unknown;
132};
133
134#endif