Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


iso_fs.h
001: #ifndef _ISOFS_FS_H
002: #define _ISOFS_FS_H
003: 
004: #include <linux/types.h>
005: #include <linux/magic.h>
006: 
007: /*
008:  * The isofs filesystem constants/structures
009:  */
010: 
011: /* This part borrowed from the bsd386 isofs */
012: #define ISODCL(from, to) (to - from + 1)
013: 
014: struct iso_volume_descriptor {
015:         char type[ISODCL(1,1)]; /* 711 */
016:         char id[ISODCL(2,6)];
017:         char version[ISODCL(7,7)];
018:         char data[ISODCL(8,2048)];
019: };
020: 
021: /* volume descriptor types */
022: #define ISO_VD_PRIMARY 1
023: #define ISO_VD_SUPPLEMENTARY 2
024: #define ISO_VD_END 255
025: 
026: #define ISO_STANDARD_ID "CD001"
027: 
028: struct iso_primary_descriptor {
029:         char type                       [ISODCL (  1,   1)]; /* 711 */
030:         char id                         [ISODCL (  2,   6)];
031:         char version                    [ISODCL (  7,   7)]; /* 711 */
032:         char unused1                    [ISODCL (  8,   8)];
033:         char system_id                  [ISODCL (  9,  40)]; /* achars */
034:         char volume_id                  [ISODCL ( 41,  72)]; /* dchars */
035:         char unused2                    [ISODCL ( 73,  80)];
036:         char volume_space_size          [ISODCL ( 81,  88)]; /* 733 */
037:         char unused3                    [ISODCL ( 89, 120)];
038:         char volume_set_size            [ISODCL (121, 124)]; /* 723 */
039:         char volume_sequence_number     [ISODCL (125, 128)]; /* 723 */
040:         char logical_block_size         [ISODCL (129, 132)]; /* 723 */
041:         char path_table_size            [ISODCL (133, 140)]; /* 733 */
042:         char type_l_path_table          [ISODCL (141, 144)]; /* 731 */
043:         char opt_type_l_path_table      [ISODCL (145, 148)]; /* 731 */
044:         char type_m_path_table          [ISODCL (149, 152)]; /* 732 */
045:         char opt_type_m_path_table      [ISODCL (153, 156)]; /* 732 */
046:         char root_directory_record      [ISODCL (157, 190)]; /* 9.1 */
047:         char volume_set_id              [ISODCL (191, 318)]; /* dchars */
048:         char publisher_id               [ISODCL (319, 446)]; /* achars */
049:         char preparer_id                [ISODCL (447, 574)]; /* achars */
050:         char application_id             [ISODCL (575, 702)]; /* achars */
051:         char copyright_file_id          [ISODCL (703, 739)]; /* 7.5 dchars */
052:         char abstract_file_id           [ISODCL (740, 776)]; /* 7.5 dchars */
053:         char bibliographic_file_id      [ISODCL (777, 813)]; /* 7.5 dchars */
054:         char creation_date              [ISODCL (814, 830)]; /* 8.4.26.1 */
055:         char modification_date          [ISODCL (831, 847)]; /* 8.4.26.1 */
056:         char expiration_date            [ISODCL (848, 864)]; /* 8.4.26.1 */
057:         char effective_date             [ISODCL (865, 881)]; /* 8.4.26.1 */
058:         char file_structure_version     [ISODCL (882, 882)]; /* 711 */
059:         char unused4                    [ISODCL (883, 883)];
060:         char application_data           [ISODCL (884, 1395)];
061:         char unused5                    [ISODCL (1396, 2048)];
062: };
063: 
064: /* Almost the same as the primary descriptor but two fields are specified */
065: struct iso_supplementary_descriptor {
066:         char type                       [ISODCL (  1,   1)]; /* 711 */
067:         char id                         [ISODCL (  2,   6)];
068:         char version                    [ISODCL (  7,   7)]; /* 711 */
069:         char flags                      [ISODCL (  8,   8)]; /* 853 */
070:         char system_id                  [ISODCL (  9,  40)]; /* achars */
071:         char volume_id                  [ISODCL ( 41,  72)]; /* dchars */
072:         char unused2                    [ISODCL ( 73,  80)];
073:         char volume_space_size          [ISODCL ( 81,  88)]; /* 733 */
074:         char escape                     [ISODCL ( 89, 120)]; /* 856 */
075:         char volume_set_size            [ISODCL (121, 124)]; /* 723 */
076:         char volume_sequence_number     [ISODCL (125, 128)]; /* 723 */
077:         char logical_block_size         [ISODCL (129, 132)]; /* 723 */
078:         char path_table_size            [ISODCL (133, 140)]; /* 733 */
079:         char type_l_path_table          [ISODCL (141, 144)]; /* 731 */
080:         char opt_type_l_path_table      [ISODCL (145, 148)]; /* 731 */
081:         char type_m_path_table          [ISODCL (149, 152)]; /* 732 */
082:         char opt_type_m_path_table      [ISODCL (153, 156)]; /* 732 */
083:         char root_directory_record      [ISODCL (157, 190)]; /* 9.1 */
084:         char volume_set_id              [ISODCL (191, 318)]; /* dchars */
085:         char publisher_id               [ISODCL (319, 446)]; /* achars */
086:         char preparer_id                [ISODCL (447, 574)]; /* achars */
087:         char application_id             [ISODCL (575, 702)]; /* achars */
088:         char copyright_file_id          [ISODCL (703, 739)]; /* 7.5 dchars */
089:         char abstract_file_id           [ISODCL (740, 776)]; /* 7.5 dchars */
090:         char bibliographic_file_id      [ISODCL (777, 813)]; /* 7.5 dchars */
091:         char creation_date              [ISODCL (814, 830)]; /* 8.4.26.1 */
092:         char modification_date          [ISODCL (831, 847)]; /* 8.4.26.1 */
093:         char expiration_date            [ISODCL (848, 864)]; /* 8.4.26.1 */
094:         char effective_date             [ISODCL (865, 881)]; /* 8.4.26.1 */
095:         char file_structure_version     [ISODCL (882, 882)]; /* 711 */
096:         char unused4                    [ISODCL (883, 883)];
097:         char application_data           [ISODCL (884, 1395)];
098:         char unused5                    [ISODCL (1396, 2048)];
099: };
100: 
101: 
102: #define HS_STANDARD_ID "CDROM"
103: 
104: struct  hs_volume_descriptor {
105:         char foo                        [ISODCL (  1,   8)]; /* 733 */
106:         char type                       [ISODCL (  9,   9)]; /* 711 */
107:         char id                         [ISODCL ( 10,  14)];
108:         char version                    [ISODCL ( 15,  15)]; /* 711 */
109:         char data[ISODCL(16,2048)];
110: };
111: 
112: 
113: struct hs_primary_descriptor {
114:         char foo                        [ISODCL (  1,   8)]; /* 733 */
115:         char type                       [ISODCL (  9,   9)]; /* 711 */
116:         char id                         [ISODCL ( 10,  14)];
117:         char version                    [ISODCL ( 15,  15)]; /* 711 */
118:         char unused1                    [ISODCL ( 16,  16)]; /* 711 */
119:         char system_id                  [ISODCL ( 17,  48)]; /* achars */
120:         char volume_id                  [ISODCL ( 49,  80)]; /* dchars */
121:         char unused2                    [ISODCL ( 81,  88)]; /* 733 */
122:         char volume_space_size          [ISODCL ( 89,  96)]; /* 733 */
123:         char unused3                    [ISODCL ( 97, 128)]; /* 733 */
124:         char volume_set_size            [ISODCL (129, 132)]; /* 723 */
125:         char volume_sequence_number     [ISODCL (133, 136)]; /* 723 */
126:         char logical_block_size         [ISODCL (137, 140)]; /* 723 */
127:         char path_table_size            [ISODCL (141, 148)]; /* 733 */
128:         char type_l_path_table          [ISODCL (149, 152)]; /* 731 */
129:         char unused4                    [ISODCL (153, 180)]; /* 733 */
130:         char root_directory_record      [ISODCL (181, 214)]; /* 9.1 */
131: };
132: 
133: /* We use this to help us look up the parent inode numbers. */
134: 
135: struct iso_path_table{
136:         unsigned char  name_len[2];     /* 721 */
137:         char extent[4];         /* 731 */
138:         char  parent[2];        /* 721 */
139:         char name[0];
140: } __attribute__((packed));
141: 
142: /* high sierra is identical to iso, except that the date is only 6 bytes, and
143:    there is an extra reserved byte after the flags */
144: 
145: struct iso_directory_record {
146:         char length                     [ISODCL (1, 1)]; /* 711 */
147:         char ext_attr_length            [ISODCL (2, 2)]; /* 711 */
148:         char extent                     [ISODCL (3, 10)]; /* 733 */
149:         char size                       [ISODCL (11, 18)]; /* 733 */
150:         char date                       [ISODCL (19, 25)]; /* 7 by 711 */
151:         char flags                      [ISODCL (26, 26)];
152:         char file_unit_size             [ISODCL (27, 27)]; /* 711 */
153:         char interleave                 [ISODCL (28, 28)]; /* 711 */
154:         char volume_sequence_number     [ISODCL (29, 32)]; /* 723 */
155:         unsigned char name_len          [ISODCL (33, 33)]; /* 711 */
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 /* _ISOFS_FS_H */
166: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/