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