PageRenderTime 17ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/filesystems/unixfs/common/linux/kernel/include/linux/minix_fs.h

http://macfuse.googlecode.com/
C++ Header | 105 lines | 67 code | 13 blank | 25 comment | 0 complexity | 70e88e23fbe01da4f23976feb6388162 MD5 | raw file
  1#ifndef _LINUX_MINIX_FS_H
  2#define _LINUX_MINIX_FS_H
  3
  4#include <linux/magic.h>
  5
  6/*
  7 * The minix filesystem constants/structures
  8 */
  9
 10/*
 11 * Thanks to Kees J Bot for sending me the definitions of the new
 12 * minix filesystem (aka V2) with bigger inodes and 32-bit block
 13 * pointers.
 14 */
 15
 16#define MINIX_ROOT_INO 1
 17
 18/* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
 19#define MINIX_LINK_MAX	250
 20#define MINIX2_LINK_MAX	65530
 21
 22#define MINIX_I_MAP_SLOTS	8
 23#define MINIX_Z_MAP_SLOTS	64
 24#define MINIX_VALID_FS		0x0001		/* Clean fs. */
 25#define MINIX_ERROR_FS		0x0002		/* fs has errors. */
 26
 27#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
 28
 29/*
 30 * This is the original minix inode layout on disk.
 31 * Note the 8-bit gid and atime and ctime.
 32 */
 33struct minix_inode {
 34	__u16 di_mode;
 35	__u16 di_uid;
 36	__u32 di_size;
 37	__u32 di_time;
 38	__u8  di_gid;
 39	__u8  di_nlinks;
 40	__u16 di_zone[9];
 41};
 42
 43/*
 44 * The new minix inode has all the time entries, as well as
 45 * long block numbers and a third indirect block (7+1+1+1
 46 * instead of 7+1+1). Also, some previously 8-bit values are
 47 * now 16-bit. The inode is now 64 bytes instead of 32.
 48 */
 49struct minix2_inode {
 50	__u16 di_mode;
 51	__u16 di_nlinks;
 52	__u16 di_uid;
 53	__u16 di_gid;
 54	__u32 di_size;
 55	__u32 di_atime;
 56	__u32 di_mtime;
 57	__u32 di_ctime;
 58	__u32 di_zone[10];
 59};
 60
 61/*
 62 * minix super-block data on disk
 63 */
 64struct minix_super_block {
 65	__u16 s_ninodes;
 66	__u16 s_nzones;
 67	__u16 s_imap_blocks;
 68	__u16 s_zmap_blocks;
 69	__u16 s_firstdatazone;
 70	__u16 s_log_zone_size;
 71	__u32 s_max_size;
 72	__u16 s_magic;
 73	__u16 s_state;
 74	__u32 s_zones;
 75};
 76
 77/*
 78 * V3 minix super-block data on disk
 79 */
 80struct minix3_super_block {
 81	__u32 s_ninodes;
 82	__u16 s_pad0;
 83	__u16 s_imap_blocks;
 84	__u16 s_zmap_blocks;
 85	__u16 s_firstdatazone;
 86	__u16 s_log_zone_size;
 87	__u16 s_pad1;
 88	__u32 s_max_size;
 89	__u32 s_zones;
 90	__u16 s_magic;
 91	__u16 s_pad2;
 92	__u16 s_blocksize;
 93	__u8  s_disk_version;
 94};
 95
 96struct minix_dir_entry {
 97	__u16 inode;
 98	char name[0];
 99};
100
101struct minix3_dir_entry {
102	__u32 inode;
103	char name[0];
104};
105#endif