summaryrefslogtreecommitdiff
path: root/util-linux/mkfs_minix.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-07-10 22:46:55 +0000
committerEric Andersen <andersen@codepoet.org>2000-07-10 22:46:55 +0000
commit85c552035e4c5199d1cbef6058eb365c6150f33d (patch)
tree584b12b4e895373b7635f49b2f5e51fb2f47c4f2 /util-linux/mkfs_minix.c
parent9b2297a34e35be143155769a470331af2f2b9330 (diff)
downloadbusybox-w32-85c552035e4c5199d1cbef6058eb365c6150f33d.tar.gz
busybox-w32-85c552035e4c5199d1cbef6058eb365c6150f33d.tar.bz2
busybox-w32-85c552035e4c5199d1cbef6058eb365c6150f33d.zip
More linux kernel header file removal.
-Erik
Diffstat (limited to 'util-linux/mkfs_minix.c')
-rw-r--r--util-linux/mkfs_minix.c99
1 files changed, 97 insertions, 2 deletions
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 9493f2b2b..c8c91123b 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -77,8 +77,103 @@
77#include <sys/param.h> 77#include <sys/param.h>
78#include <mntent.h> 78#include <mntent.h>
79 79
80#include <linux/fs.h> 80
81#include <linux/minix_fs.h> 81typedef unsigned char u8;
82typedef unsigned short u16;
83typedef unsigned int u32;
84
85
86#define MINIX_ROOT_INO 1
87#define MINIX_LINK_MAX 250
88#define MINIX2_LINK_MAX 65530
89
90#define MINIX_I_MAP_SLOTS 8
91#define MINIX_Z_MAP_SLOTS 64
92#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
93#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
94#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
95#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
96#define MINIX_VALID_FS 0x0001 /* Clean fs. */
97#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
98
99#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
100#define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
101
102#define MINIX_V1 0x0001 /* original minix fs */
103#define MINIX_V2 0x0002 /* minix V2 fs */
104
105#define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version
106
107/*
108 * This is the original minix inode layout on disk.
109 * Note the 8-bit gid and atime and ctime.
110 */
111struct minix_inode {
112 u16 i_mode;
113 u16 i_uid;
114 u32 i_size;
115 u32 i_time;
116 u8 i_gid;
117 u8 i_nlinks;
118 u16 i_zone[9];
119};
120
121/*
122 * The new minix inode has all the time entries, as well as
123 * long block numbers and a third indirect block (7+1+1+1
124 * instead of 7+1+1). Also, some previously 8-bit values are
125 * now 16-bit. The inode is now 64 bytes instead of 32.
126 */
127struct minix2_inode {
128 u16 i_mode;
129 u16 i_nlinks;
130 u16 i_uid;
131 u16 i_gid;
132 u32 i_size;
133 u32 i_atime;
134 u32 i_mtime;
135 u32 i_ctime;
136 u32 i_zone[10];
137};
138
139/*
140 * minix super-block data on disk
141 */
142struct minix_super_block {
143 u16 s_ninodes;
144 u16 s_nzones;
145 u16 s_imap_blocks;
146 u16 s_zmap_blocks;
147 u16 s_firstdatazone;
148 u16 s_log_zone_size;
149 u32 s_max_size;
150 u16 s_magic;
151 u16 s_state;
152 u32 s_zones;
153};
154
155struct minix_dir_entry {
156 u16 inode;
157 char name[0];
158};
159
160#define BLOCK_SIZE_BITS 10
161#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
162
163#define NAME_MAX 255 /* # chars in a file name */
164
165#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
166
167#define MINIX_VALID_FS 0x0001 /* Clean fs. */
168#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
169
170#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
171#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
172
173#ifndef BLKGETSIZE
174#define BLKGETSIZE _IO(0x12,96) /* return device size */
175#endif
176
82 177
83#ifdef MINIX2_SUPER_MAGIC2 178#ifdef MINIX2_SUPER_MAGIC2
84#define HAVE_MINIX2 1 179#define HAVE_MINIX2 1