xref: /linux/include/uapi/linux/qnx4_fs.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  *  Name                         : qnx4_fs.h
4607ca46eSDavid Howells  *  Author                       : Richard Frowijn
5607ca46eSDavid Howells  *  Function                     : qnx4 global filesystem definitions
6607ca46eSDavid Howells  *  History                      : 23-03-1998 created
7607ca46eSDavid Howells  */
8607ca46eSDavid Howells #ifndef _LINUX_QNX4_FS_H
9607ca46eSDavid Howells #define _LINUX_QNX4_FS_H
10607ca46eSDavid Howells 
11607ca46eSDavid Howells #include <linux/types.h>
12607ca46eSDavid Howells #include <linux/qnxtypes.h>
13607ca46eSDavid Howells #include <linux/magic.h>
14607ca46eSDavid Howells 
15607ca46eSDavid Howells #define QNX4_ROOT_INO 1
16607ca46eSDavid Howells 
17607ca46eSDavid Howells #define QNX4_MAX_XTNTS_PER_XBLK	60
18607ca46eSDavid Howells /* for di_status */
19607ca46eSDavid Howells #define QNX4_FILE_USED          0x01
20607ca46eSDavid Howells #define QNX4_FILE_MODIFIED      0x02
21607ca46eSDavid Howells #define QNX4_FILE_BUSY          0x04
22607ca46eSDavid Howells #define QNX4_FILE_LINK          0x08
23607ca46eSDavid Howells #define QNX4_FILE_INODE         0x10
24607ca46eSDavid Howells #define QNX4_FILE_FSYSCLEAN     0x20
25607ca46eSDavid Howells 
26607ca46eSDavid Howells #define QNX4_I_MAP_SLOTS	8
27607ca46eSDavid Howells #define QNX4_Z_MAP_SLOTS	64
28607ca46eSDavid Howells #define QNX4_VALID_FS		0x0001	/* Clean fs. */
29607ca46eSDavid Howells #define QNX4_ERROR_FS		0x0002	/* fs has errors. */
30607ca46eSDavid Howells #define QNX4_BLOCK_SIZE         0x200	/* blocksize of 512 bytes */
31607ca46eSDavid Howells #define QNX4_BLOCK_SIZE_BITS    9	/* blocksize shift */
32607ca46eSDavid Howells #define QNX4_DIR_ENTRY_SIZE     0x040	/* dir entry size of 64 bytes */
33607ca46eSDavid Howells #define QNX4_DIR_ENTRY_SIZE_BITS 6	/* dir entry size shift */
34607ca46eSDavid Howells #define QNX4_XBLK_ENTRY_SIZE    0x200	/* xblk entry size */
35607ca46eSDavid Howells #define QNX4_INODES_PER_BLOCK   0x08	/* 512 / 64 */
36607ca46eSDavid Howells 
37607ca46eSDavid Howells /* for filenames */
38607ca46eSDavid Howells #define QNX4_SHORT_NAME_MAX	16
39607ca46eSDavid Howells #define QNX4_NAME_MAX		48
40607ca46eSDavid Howells 
41607ca46eSDavid Howells /*
42607ca46eSDavid Howells  * This is the original qnx4 inode layout on disk.
43607ca46eSDavid Howells  */
44607ca46eSDavid Howells struct qnx4_inode_entry {
45607ca46eSDavid Howells 	char		di_fname[QNX4_SHORT_NAME_MAX];
46607ca46eSDavid Howells 	qnx4_off_t	di_size;
47607ca46eSDavid Howells 	qnx4_xtnt_t	di_first_xtnt;
48607ca46eSDavid Howells 	__le32		di_xblk;
49607ca46eSDavid Howells 	__le32		di_ftime;
50607ca46eSDavid Howells 	__le32		di_mtime;
51607ca46eSDavid Howells 	__le32		di_atime;
52607ca46eSDavid Howells 	__le32		di_ctime;
53607ca46eSDavid Howells 	qnx4_nxtnt_t	di_num_xtnts;
54607ca46eSDavid Howells 	qnx4_mode_t	di_mode;
55607ca46eSDavid Howells 	qnx4_muid_t	di_uid;
56607ca46eSDavid Howells 	qnx4_mgid_t	di_gid;
57607ca46eSDavid Howells 	qnx4_nlink_t	di_nlink;
58607ca46eSDavid Howells 	__u8		di_zero[4];
59607ca46eSDavid Howells 	qnx4_ftype_t	di_type;
60607ca46eSDavid Howells 	__u8		di_status;
61607ca46eSDavid Howells };
62607ca46eSDavid Howells 
63607ca46eSDavid Howells struct qnx4_link_info {
64607ca46eSDavid Howells 	char		dl_fname[QNX4_NAME_MAX];
65607ca46eSDavid Howells 	__le32		dl_inode_blk;
66607ca46eSDavid Howells 	__u8		dl_inode_ndx;
67607ca46eSDavid Howells 	__u8		dl_spare[10];
68607ca46eSDavid Howells 	__u8		dl_status;
69607ca46eSDavid Howells };
70607ca46eSDavid Howells 
71607ca46eSDavid Howells struct qnx4_xblk {
72607ca46eSDavid Howells 	__le32		xblk_next_xblk;
73607ca46eSDavid Howells 	__le32		xblk_prev_xblk;
74607ca46eSDavid Howells 	__u8		xblk_num_xtnts;
75607ca46eSDavid Howells 	__u8		xblk_spare[3];
76607ca46eSDavid Howells 	__le32		xblk_num_blocks;
77607ca46eSDavid Howells 	qnx4_xtnt_t	xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK];
78607ca46eSDavid Howells 	char		xblk_signature[8];
79607ca46eSDavid Howells 	qnx4_xtnt_t	xblk_first_xtnt;
80607ca46eSDavid Howells };
81607ca46eSDavid Howells 
82607ca46eSDavid Howells struct qnx4_super_block {
83607ca46eSDavid Howells 	struct qnx4_inode_entry RootDir;
84607ca46eSDavid Howells 	struct qnx4_inode_entry Inode;
85607ca46eSDavid Howells 	struct qnx4_inode_entry Boot;
86607ca46eSDavid Howells 	struct qnx4_inode_entry AltBoot;
87607ca46eSDavid Howells };
88607ca46eSDavid Howells 
89607ca46eSDavid Howells #endif
90