root/include/linux/iso_fs.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 
   2 #ifndef _ISOFS_FS_H
   3 #define _ISOFS_FS_H
   4 
   5 #include <linux/types.h>
   6 /*
   7  * The isofs filesystem constants/structures
   8  */
   9 
  10 /* This part borrowed from the bsd386 isofs */
  11 #define ISODCL(from, to) (to - from + 1)
  12 
  13 struct iso_volume_descriptor {
  14         char type[ISODCL(1,1)]; /* 711 */
  15         char id[ISODCL(2,6)];
  16         char version[ISODCL(7,7)];
  17         char data[ISODCL(8,2048)];
  18 };
  19 
  20 /* volume descriptor types */
  21 #define ISO_VD_PRIMARY 1
  22 #define ISO_VD_END 255
  23 
  24 #define ISO_STANDARD_ID "CD001"
  25 
  26 struct iso_primary_descriptor {
  27         char type                       [ISODCL (  1,   1)]; /* 711 */
  28         char id                         [ISODCL (  2,   6)];
  29         char version                    [ISODCL (  7,   7)]; /* 711 */
  30         char unused1                    [ISODCL (  8,   8)];
  31         char system_id                  [ISODCL (  9,  40)]; /* achars */
  32         char volume_id                  [ISODCL ( 41,  72)]; /* dchars */
  33         char unused2                    [ISODCL ( 73,  80)];
  34         char volume_space_size          [ISODCL ( 81,  88)]; /* 733 */
  35         char unused3                    [ISODCL ( 89, 120)];
  36         char volume_set_size            [ISODCL (121, 124)]; /* 723 */
  37         char volume_sequence_number     [ISODCL (125, 128)]; /* 723 */
  38         char logical_block_size         [ISODCL (129, 132)]; /* 723 */
  39         char path_table_size            [ISODCL (133, 140)]; /* 733 */
  40         char type_l_path_table          [ISODCL (141, 144)]; /* 731 */
  41         char opt_type_l_path_table      [ISODCL (145, 148)]; /* 731 */
  42         char type_m_path_table          [ISODCL (149, 152)]; /* 732 */
  43         char opt_type_m_path_table      [ISODCL (153, 156)]; /* 732 */
  44         char root_directory_record      [ISODCL (157, 190)]; /* 9.1 */
  45         char volume_set_id              [ISODCL (191, 318)]; /* dchars */
  46         char publisher_id               [ISODCL (319, 446)]; /* achars */
  47         char preparer_id                [ISODCL (447, 574)]; /* achars */
  48         char application_id             [ISODCL (575, 702)]; /* achars */
  49         char copyright_file_id          [ISODCL (703, 739)]; /* 7.5 dchars */
  50         char abstract_file_id           [ISODCL (740, 776)]; /* 7.5 dchars */
  51         char bibliographic_file_id      [ISODCL (777, 813)]; /* 7.5 dchars */
  52         char creation_date              [ISODCL (814, 830)]; /* 8.4.26.1 */
  53         char modification_date          [ISODCL (831, 847)]; /* 8.4.26.1 */
  54         char expiration_date            [ISODCL (848, 864)]; /* 8.4.26.1 */
  55         char effective_date             [ISODCL (865, 881)]; /* 8.4.26.1 */
  56         char file_structure_version     [ISODCL (882, 882)]; /* 711 */
  57         char unused4                    [ISODCL (883, 883)];
  58         char application_data           [ISODCL (884, 1395)];
  59         char unused5                    [ISODCL (1396, 2048)];
  60 };
  61 
  62 
  63 #define HS_STANDARD_ID "CDROM"
  64 
  65 struct  hs_volume_descriptor {
  66         char foo                        [ISODCL (  1,   8)]; /* 733 */
  67         char type                       [ISODCL (  9,   9)]; /* 711 */
  68         char id                         [ISODCL ( 10,  14)];
  69         char version                    [ISODCL ( 15,  15)]; /* 711 */
  70         char data[ISODCL(16,2048)];
  71 };
  72 
  73 
  74 struct hs_primary_descriptor {
  75         char foo                        [ISODCL (  1,   8)]; /* 733 */
  76         char type                       [ISODCL (  9,   9)]; /* 711 */
  77         char id                         [ISODCL ( 10,  14)];
  78         char version                    [ISODCL ( 15,  15)]; /* 711 */
  79         char unused1                    [ISODCL ( 16,  16)]; /* 711 */
  80         char system_id                  [ISODCL ( 17,  48)]; /* achars */
  81         char volume_id                  [ISODCL ( 49,  80)]; /* dchars */
  82         char unused2                    [ISODCL ( 81,  88)]; /* 733 */
  83         char volume_space_size          [ISODCL ( 89,  96)]; /* 733 */
  84         char unused3                    [ISODCL ( 97, 128)]; /* 733 */
  85         char volume_set_size            [ISODCL (129, 132)]; /* 723 */
  86         char volume_sequence_number     [ISODCL (133, 136)]; /* 723 */
  87         char logical_block_size         [ISODCL (137, 140)]; /* 723 */
  88         char path_table_size            [ISODCL (141, 148)]; /* 733 */
  89         char type_l_path_table          [ISODCL (149, 152)]; /* 731 */
  90         char unused4                    [ISODCL (153, 180)]; /* 733 */
  91         char root_directory_record      [ISODCL (181, 214)]; /* 9.1 */
  92 };
  93 
  94 /* We use this to help us look up the parent inode numbers. */
  95 
  96 struct iso_path_table{
  97         char  name_len[2];      /* 721 */
  98         char extent[4];         /* 731 */
  99         char  parent[2];        /* 721 */
 100         char name[0];
 101 };
 102 
 103 /* high sierra is identical to iso, except that the date is only 6 bytes, and
 104    there is an extra reserved byte after the flags */
 105 
 106 struct iso_directory_record {
 107         char length                     [ISODCL (1, 1)]; /* 711 */
 108         char ext_attr_length            [ISODCL (2, 2)]; /* 711 */
 109         char extent                     [ISODCL (3, 10)]; /* 733 */
 110         char size                       [ISODCL (11, 18)]; /* 733 */
 111         char date                       [ISODCL (19, 25)]; /* 7 by 711 */
 112         char flags                      [ISODCL (26, 26)];
 113         char file_unit_size             [ISODCL (27, 27)]; /* 711 */
 114         char interleave                 [ISODCL (28, 28)]; /* 711 */
 115         char volume_sequence_number     [ISODCL (29, 32)]; /* 723 */
 116         char name_len                   [ISODCL (33, 33)]; /* 711 */
 117         char name                       [0];
 118 };
 119 
 120 extern int isonum_711(char *);
 121 extern int isonum_712(char *);
 122 extern int isonum_721(char *);
 123 extern int isonum_722(char *);
 124 extern int isonum_723(char *);
 125 extern int isonum_731(char *);
 126 extern int isonum_732(char *);
 127 extern int isonum_733(char *);
 128 extern int iso_date(char *, int);
 129 
 130 extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *);
 131 extern int get_rock_ridge_filename(struct iso_directory_record *, char ** name, int * len, struct inode *);
 132 
 133 extern char * get_rock_ridge_symlink(struct inode *);
 134 extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *);
 135 
 136 #define ISOFS_BLOCK_BITS 11
 137 #define ISOFS_BLOCK_SIZE 2048
 138 
 139 /* We use these until the buffer cache supports 2048 */
 140 #define ISOFS_BUFFER_BITS 10
 141 #define ISOFS_BUFFER_SIZE 1024
 142 
 143 #define ISOFS_BLOCK_NUMBER(X) (X<<1)
 144 
 145 
 146 #define ISOFS_SUPER_MAGIC 0x9660
 147 #define ISOFS_FILE_UNKNOWN 0
 148 #define ISOFS_FILE_TEXT 1
 149 #define ISOFS_FILE_BINARY 2
 150 #define ISOFS_FILE_TEXT_M 3
 151 
 152 
 153 /* The stuff that follows may be totally unneeded. I have not checked to see 
 154  which prototypes we are still using.  */
 155 
 156 extern int isofs_open(struct inode * inode, struct file * filp);
 157 extern void isofs_release(struct inode * inode, struct file * filp);
 158 extern int isofs_lookup(struct inode * dir,const char * name, int len,
 159         struct inode ** result);
 160 extern unsigned long isofs_count_free_inodes(struct super_block *sb);
 161 extern int isofs_new_block(int dev);
 162 extern int isofs_free_block(int dev, int block);
 163 extern int isofs_bmap(struct inode *,int);
 164 
 165 extern void isofs_put_super(struct super_block *);
 166 extern struct super_block *isofs_read_super(struct super_block *,void *);
 167 extern void isofs_read_inode(struct inode *);
 168 extern void isofs_put_inode(struct inode *);
 169 extern void isofs_statfs(struct super_block *, struct statfs *);
 170 
 171 extern int isofs_lseek(struct inode *, struct file *, off_t, int);
 172 extern int isofs_read(struct inode *, struct file *, char *, int);
 173 extern int isofs_lookup_grandparent(struct inode *, int);
 174 
 175 extern struct inode_operations isofs_file_inode_operations;
 176 extern struct inode_operations isofs_dir_inode_operations;
 177 extern struct inode_operations isofs_symlink_inode_operations;
 178 extern struct inode_operations isofs_chrdev_inode_operations;
 179 extern struct inode_operations isofs_blkdev_inode_operations;
 180 extern struct inode_operations isofs_fifo_inode_operations;
 181 
 182 extern struct file_operations isofs_file_operations;
 183 extern struct file_operations isofs_dir_operations;
 184 
 185 struct lookup_cache{
 186   char lock;
 187   unsigned long dir; /* If this matches... */
 188   dev_t dev;  /* And this matches */
 189   unsigned short dlen; /* and this matches... */
 190   char filename[256]; /* and this matches... */
 191   unsigned long ino; /* Then this is the file we are looking for */
 192 };
 193 
 194 extern struct lookup_cache cache;
 195 
 196 /* The following macros are used to check for memory leaks. */
 197 #ifdef LEAK_CHECK
 198 #define free_s leak_check_free_s
 199 #define malloc leak_check_malloc
 200 #define bread leak_check_bread
 201 #define brelse leak_check_brelse
 202 extern void * leak_check_malloc(unsigned int size);
 203 extern void leak_check_free_s(void * obj, int size);
 204 extern struct buffer_head * leak_check_bread(int dev, int block, int size);
 205 extern void leak_check_brelse(struct buffer_head * bh);
 206 #endif /* LEAK_CHECK */
 207 
 208 #endif
 209 
 210 
 211 

/* [previous][next][first][last][top][bottom][index][help] */