1#ifndef _ISOFS_FS_H
2#define _ISOFS_FS_H
3
4#include <linux/types.h>
5#include <linux/magic.h>
6
7
8
9
10
11
12#define ISODCL(from, to) (to - from + 1)
13
14struct iso_volume_descriptor {
15 char type[ISODCL(1,1)];
16 char id[ISODCL(2,6)];
17 char version[ISODCL(7,7)];
18 char data[ISODCL(8,2048)];
19};
20
21
22#define ISO_VD_PRIMARY 1
23#define ISO_VD_SUPPLEMENTARY 2
24#define ISO_VD_END 255
25
26#define ISO_STANDARD_ID "CD001"
27
28struct iso_primary_descriptor {
29 char type [ISODCL ( 1, 1)];
30 char id [ISODCL ( 2, 6)];
31 char version [ISODCL ( 7, 7)];
32 char unused1 [ISODCL ( 8, 8)];
33 char system_id [ISODCL ( 9, 40)];
34 char volume_id [ISODCL ( 41, 72)];
35 char unused2 [ISODCL ( 73, 80)];
36 char volume_space_size [ISODCL ( 81, 88)];
37 char unused3 [ISODCL ( 89, 120)];
38 char volume_set_size [ISODCL (121, 124)];
39 char volume_sequence_number [ISODCL (125, 128)];
40 char logical_block_size [ISODCL (129, 132)];
41 char path_table_size [ISODCL (133, 140)];
42 char type_l_path_table [ISODCL (141, 144)];
43 char opt_type_l_path_table [ISODCL (145, 148)];
44 char type_m_path_table [ISODCL (149, 152)];
45 char opt_type_m_path_table [ISODCL (153, 156)];
46 char root_directory_record [ISODCL (157, 190)];
47 char volume_set_id [ISODCL (191, 318)];
48 char publisher_id [ISODCL (319, 446)];
49 char preparer_id [ISODCL (447, 574)];
50 char application_id [ISODCL (575, 702)];
51 char copyright_file_id [ISODCL (703, 739)];
52 char abstract_file_id [ISODCL (740, 776)];
53 char bibliographic_file_id [ISODCL (777, 813)];
54 char creation_date [ISODCL (814, 830)];
55 char modification_date [ISODCL (831, 847)];
56 char expiration_date [ISODCL (848, 864)];
57 char effective_date [ISODCL (865, 881)];
58 char file_structure_version [ISODCL (882, 882)];
59 char unused4 [ISODCL (883, 883)];
60 char application_data [ISODCL (884, 1395)];
61 char unused5 [ISODCL (1396, 2048)];
62};
63
64
65struct iso_supplementary_descriptor {
66 char type [ISODCL ( 1, 1)];
67 char id [ISODCL ( 2, 6)];
68 char version [ISODCL ( 7, 7)];
69 char flags [ISODCL ( 8, 8)];
70 char system_id [ISODCL ( 9, 40)];
71 char volume_id [ISODCL ( 41, 72)];
72 char unused2 [ISODCL ( 73, 80)];
73 char volume_space_size [ISODCL ( 81, 88)];
74 char escape [ISODCL ( 89, 120)];
75 char volume_set_size [ISODCL (121, 124)];
76 char volume_sequence_number [ISODCL (125, 128)];
77 char logical_block_size [ISODCL (129, 132)];
78 char path_table_size [ISODCL (133, 140)];
79 char type_l_path_table [ISODCL (141, 144)];
80 char opt_type_l_path_table [ISODCL (145, 148)];
81 char type_m_path_table [ISODCL (149, 152)];
82 char opt_type_m_path_table [ISODCL (153, 156)];
83 char root_directory_record [ISODCL (157, 190)];
84 char volume_set_id [ISODCL (191, 318)];
85 char publisher_id [ISODCL (319, 446)];
86 char preparer_id [ISODCL (447, 574)];
87 char application_id [ISODCL (575, 702)];
88 char copyright_file_id [ISODCL (703, 739)];
89 char abstract_file_id [ISODCL (740, 776)];
90 char bibliographic_file_id [ISODCL (777, 813)];
91 char creation_date [ISODCL (814, 830)];
92 char modification_date [ISODCL (831, 847)];
93 char expiration_date [ISODCL (848, 864)];
94 char effective_date [ISODCL (865, 881)];
95 char file_structure_version [ISODCL (882, 882)];
96 char unused4 [ISODCL (883, 883)];
97 char application_data [ISODCL (884, 1395)];
98 char unused5 [ISODCL (1396, 2048)];
99};
100
101
102#define HS_STANDARD_ID "CDROM"
103
104struct hs_volume_descriptor {
105 char foo [ISODCL ( 1, 8)];
106 char type [ISODCL ( 9, 9)];
107 char id [ISODCL ( 10, 14)];
108 char version [ISODCL ( 15, 15)];
109 char data[ISODCL(16,2048)];
110};
111
112
113struct hs_primary_descriptor {
114 char foo [ISODCL ( 1, 8)];
115 char type [ISODCL ( 9, 9)];
116 char id [ISODCL ( 10, 14)];
117 char version [ISODCL ( 15, 15)];
118 char unused1 [ISODCL ( 16, 16)];
119 char system_id [ISODCL ( 17, 48)];
120 char volume_id [ISODCL ( 49, 80)];
121 char unused2 [ISODCL ( 81, 88)];
122 char volume_space_size [ISODCL ( 89, 96)];
123 char unused3 [ISODCL ( 97, 128)];
124 char volume_set_size [ISODCL (129, 132)];
125 char volume_sequence_number [ISODCL (133, 136)];
126 char logical_block_size [ISODCL (137, 140)];
127 char path_table_size [ISODCL (141, 148)];
128 char type_l_path_table [ISODCL (149, 152)];
129 char unused4 [ISODCL (153, 180)];
130 char root_directory_record [ISODCL (181, 214)];
131};
132
133
134
135struct iso_path_table{
136 unsigned char name_len[2];
137 char extent[4];
138 char parent[2];
139 char name[0];
140} __attribute__((packed));
141
142
143
144
145struct iso_directory_record {
146 char length [ISODCL (1, 1)];
147 char ext_attr_length [ISODCL (2, 2)];
148 char extent [ISODCL (3, 10)];
149 char size [ISODCL (11, 18)];
150 char date [ISODCL (19, 25)];
151 char flags [ISODCL (26, 26)];
152 char file_unit_size [ISODCL (27, 27)];
153 char interleave [ISODCL (28, 28)];
154 char volume_sequence_number [ISODCL (29, 32)];
155 unsigned char name_len [ISODCL (33, 33)];
156 char name [0];
157} __attribute__((packed));
158
159#define ISOFS_BLOCK_BITS 11
160#define ISOFS_BLOCK_SIZE 2048
161
162#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize)
163#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits)
164
165#endif
166