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