diff options
author | Eric Andersen | 2000-07-10 22:46:55 +0000 |
---|---|---|
committer | Eric Andersen | 2000-07-10 22:46:55 +0000 |
commit | 85c552035e4c5199d1cbef6058eb365c6150f33d (patch) | |
tree | 584b12b4e895373b7635f49b2f5e51fb2f47c4f2 /fsck_minix.c | |
parent | 9b2297a34e35be143155769a470331af2f2b9330 (diff) | |
download | busybox-85c552035e4c5199d1cbef6058eb365c6150f33d.zip busybox-85c552035e4c5199d1cbef6058eb365c6150f33d.tar.gz |
More linux kernel header file removal.
-Erik
Diffstat (limited to 'fsck_minix.c')
-rw-r--r-- | fsck_minix.c | 99 |
1 files changed, 97 insertions, 2 deletions
diff --git a/fsck_minix.c b/fsck_minix.c index 2119bae..9533f40 100644 --- a/fsck_minix.c +++ b/fsck_minix.c @@ -98,8 +98,103 @@ #include <mntent.h> #include <sys/stat.h> #include <sys/param.h> -#include <linux/fs.h> -#include <linux/minix_fs.h> + + + typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; + + +#define MINIX_ROOT_INO 1 +#define MINIX_LINK_MAX 250 +#define MINIX2_LINK_MAX 65530 + +#define MINIX_I_MAP_SLOTS 8 +#define MINIX_Z_MAP_SLOTS 64 +#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ +#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ +#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ +#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ +#define MINIX_VALID_FS 0x0001 /* Clean fs. */ +#define MINIX_ERROR_FS 0x0002 /* fs has errors. */ + +#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) +#define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) + +#define MINIX_V1 0x0001 /* original minix fs */ +#define MINIX_V2 0x0002 /* minix V2 fs */ + +#define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version + +/* + * This is the original minix inode layout on disk. + * Note the 8-bit gid and atime and ctime. + */ +struct minix_inode { + u16 i_mode; + u16 i_uid; + u32 i_size; + u32 i_time; + u8 i_gid; + u8 i_nlinks; + u16 i_zone[9]; +}; + +/* + * The new minix inode has all the time entries, as well as + * long block numbers and a third indirect block (7+1+1+1 + * instead of 7+1+1). Also, some previously 8-bit values are + * now 16-bit. The inode is now 64 bytes instead of 32. + */ +struct minix2_inode { + u16 i_mode; + u16 i_nlinks; + u16 i_uid; + u16 i_gid; + u32 i_size; + u32 i_atime; + u32 i_mtime; + u32 i_ctime; + u32 i_zone[10]; +}; + +/* + * minix super-block data on disk + */ +struct minix_super_block { + u16 s_ninodes; + u16 s_nzones; + u16 s_imap_blocks; + u16 s_zmap_blocks; + u16 s_firstdatazone; + u16 s_log_zone_size; + u32 s_max_size; + u16 s_magic; + u16 s_state; + u32 s_zones; +}; + +struct minix_dir_entry { + u16 inode; + char name[0]; +}; + +#define BLOCK_SIZE_BITS 10 +#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) + +#define NAME_MAX 255 /* # chars in a file name */ + +#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) + +#define MINIX_VALID_FS 0x0001 /* Clean fs. */ +#define MINIX_ERROR_FS 0x0002 /* fs has errors. */ + +#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ +#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ + +#ifndef BLKGETSIZE +#define BLKGETSIZE _IO(0x12,96) /* return device size */ +#endif #ifdef MINIX2_SUPER_MAGIC2 #define HAVE_MINIX2 1 |