1 #ifndefLINUX_UMSDOS_FS_H 2 #defineLINUX_UMSDOS_FS_H 3
4 #defineUMSDOS_VERSION 0
5 #defineUMSDOS_RELEASE 4
6
7 /* This is the file acting as a directory extension */ 8 #defineUMSDOS_EMD_FILE "--linux-.---"
9 #defineUMSDOS_EMD_NAMELEN 12
10 #defineUMSDOS_PSDROOT_NAME "linux"
11 #defineUMSDOS_PSDROOT_LEN 5
12
13 #ifndef_LINUX_TYPES_H 14 #include <linux/types.h>
15 #endif 16 #ifndef_LINUX_DIRENT_H 17 #include <linux/dirent.h>
18 #endif 19 #ifndef_LINUX_IOCTL_H 20 #include <linux/ioctl.h>
21 #endif 22
23 structumsdos_fake_info{ 24 charfname[13];
25 intlen;
26 };
27
28 #defineUMSDOS_MAXNAME 220
29 /* This structure is 256 bytes large, depending on the name, only part */ 30 /* of it is written to disk */ 31 structumsdos_dirent{ 32 unsignedcharname_len; /* if == 0, then this entry is not used */ 33 unsignedcharflags; /* UMSDOS_xxxx */ 34 unsignedshortnlink; /* How many hard links point to this entry */ 35 uid_tuid; /* Owner user id */ 36 gid_tgid; /* Group id */ 37 time_tatime; /* Access time */ 38 time_tmtime; /* Last modification time */ 39 time_tctime; /* Creation time */ 40 dev_trdev; /* major and minor number of a device */ 41 /* special file */ 42 umode_tmode; /* Standard UNIX permissions bits + type of */ 43 charspare[12]; /* unused bytes for future extensions */ 44 /* file, see linux/stat.h */ 45 charname[UMSDOS_MAXNAME]; /* Not '\0' terminated */ 46 /* but '\0' padded, so it will allow */ 47 /* for adding news fields in this record */ 48 /* by reducing the size of name[] */ 49 };
50 #defineUMSDOS_HIDDEN 1 /* Never show this entry in directory search */ 51 #defineUMSDOS_HLINK 2 /* It is a (pseudo) hard link */ 52
53 /* #Specification: EMD file / record size 54 Entry are 64 bytes wide in the EMD file. It allows for a 30 characters 55 name. If a name is longer, contiguous entries are allocated. So a 56 umsdos_dirent may span multiple records. 57 */ 58 #defineUMSDOS_REC_SIZE 64
59
60 /* Translation between MSDOS name and UMSDOS name */ 61 structumsdos_info{ 62 intmsdos_reject; /* Tell if the file name is invalid for MSDOS */ 63 /* See umsdos_parse */ 64 structumsdos_fake_infofake;
65 structumsdos_dirententry;
66 off_tf_pos; /* offset of the entry in the EMD file */ 67 /* or offset where the entry may be store */ 68 /* if it is a new entry */ 69 intrecsize; /* Record size needed to store entry */ 70 };
71
72 /* Definitions for ioctl (number randomly chosen) */ 73 /* The next ioctl commands operate only on the DOS directory */ 74 /* The file umsdos_progs/umsdosio.c contain a string table */ 75 /* based on the order of those definition. Keep it in sync */ 76 #defineUMSDOS_READDIR_DOS_IO(0x04,210) /* Do a readdir of the DOS directory */ 77 #defineUMSDOS_UNLINK_DOS_IO(0x04,211) /* Erase in the DOS directory only */ 78 #defineUMSDOS_RMDIR_DOS_IO(0x04,212) /* rmdir in the DOS directory only */ 79 #defineUMSDOS_STAT_DOS_IO(0x04,213) /* Get info about a file */ 80 /* The next ioctl commands operate only on the EMD file */ 81 #defineUMSDOS_CREAT_EMD_IO(0x04,214) /* Create a file */ 82 #defineUMSDOS_UNLINK_EMD_IO(0x04,215) /* unlink (rmdir) a file */ 83 #defineUMSDOS_READDIR_EMD_IO(0x04,216) /* read the EMD file only. */ 84 #defineUMSDOS_GETVERSION_IO(0x04,217) /* Get the release number of UMSDOS */ 85 #defineUMSDOS_INIT_EMD_IO(0x04,218) /* Create the EMD file if not there */ 86 #defineUMSDOS_DOS_SETUP_IO(0x04,219) /* Set the defaults of the MsDOS driver */ 87
88 #defineUMSDOS_RENAME_DOS_IO(0x04,220) /* rename a file/directory in the DOS */ 89 /* directory only */ 90 structumsdos_ioctl{ 91 structdirentdos_dirent;
92 structumsdos_direntumsdos_dirent;
93 /* The following structure is used to exchange some data */ 94 /* with utilities (umsdos_progs/util/umsdosio.c). The first */ 95 /* releases were using struct stat from "sys/stat.h". This was */ 96 /* causing some problem for cross compilation of the kernel */ 97 /* Since I am not really using the structure stat, but only some field */ 98 /* of it, I have decided to replicate the structure here */ 99 /* for compatibility with the binaries out there */ 100 struct{ 101 dev_tst_dev;
102 unsignedshort__pad1;
103 ino_tst_ino;
104 umode_tst_mode;
105 nlink_tst_nlink;
106 uid_tst_uid;
107 gid_tst_gid;
108 dev_tst_rdev;
109 unsignedshort__pad2;
110 off_tst_size;
111 unsignedlongst_blksize;
112 unsignedlongst_blocks;
113 time_tst_atime;
114 unsignedlong__unused1;
115 time_tst_mtime;
116 unsignedlong__unused2;
117 time_tst_ctime;
118 unsignedlong__unused3;
119 unsignedlong__unused4;
120 unsignedlong__unused5;
121 }stat;
122 charversion,release;
123 };
124
125 /* Different macros to access struct umsdos_dirent */ 126 #define EDM_ENTRY_ISUSED(e) ((e)->name_len!=0)
127
128 #ifdef__KERNEL__ 129
130 #ifndef LINUX_FS_H
131 #include <linux/fs.h>
132 #endif 133
134 externstructinode_operationsumsdos_dir_inode_operations;
135 externstructfile_operationsumsdos_file_operations;
136 externstructinode_operationsumsdos_file_inode_operations;
137 externstructinode_operationsumsdos_file_inode_operations_no_bmap;
138 externstructinode_operationsumsdos_symlink_inode_operations;
139 externintinit_umsdos_fs(void);
140
141 #include <linux/umsdos_fs.p>
142
143 #endif/* __KERNEL__ */ 144
145 #endif