root/include/linux/minix_fs.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_MINIX_FS_H
   2 #define _LINUX_MINIX_FS_H
   3 
   4 /*
   5  * The minix filesystem constants/structures
   6  */
   7 
   8 /*
   9  * Thanks to Kees J Bot for sending me the definitions of the new
  10  * minix filesystem (aka V2) with bigger inodes and 32-bit block
  11  * pointers.
  12  */
  13 
  14 #define MINIX_ROOT_INO 1
  15 
  16 /* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
  17 #define MINIX_LINK_MAX  250
  18 
  19 #define MINIX_I_MAP_SLOTS       8
  20 #define MINIX_Z_MAP_SLOTS       64
  21 #define MINIX_SUPER_MAGIC       0x137F          /* original minix fs */
  22 #define MINIX_SUPER_MAGIC2      0x138F          /* minix fs, 30 char names */
  23 #define MINIX2_SUPER_MAGIC      0x2468          /* minix V2 fs */
  24 #define MINIX2_SUPER_MAGIC2     0x2478          /* minix V2 fs, 30 char names */
  25 #define MINIX_VALID_FS          0x0001          /* Clean fs. */
  26 #define MINIX_ERROR_FS          0x0002          /* fs has errors. */
  27 
  28 #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
  29 #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
  30 
  31 #define MINIX_V1                0x0001          /* original minix fs */
  32 #define MINIX_V2                0x0002          /* minix V2 fs */
  33 
  34 #define INODE_VERSION(inode)    inode->i_sb->u.minix_sb.s_version
  35 
  36 /*
  37  * This is the original minix inode layout on disk.
  38  * Note the 8-bit gid and atime and ctime.
  39  */
  40 struct minix_inode {
  41         __u16 i_mode;
  42         __u16 i_uid;
  43         __u32 i_size;
  44         __u32 i_time;
  45         __u8  i_gid;
  46         __u8  i_nlinks;
  47         __u16 i_zone[9];
  48 };
  49 
  50 /*
  51  * The new minix inode has all the time entries, as well as
  52  * long block numbers and a third indirect block (7+1+1+1
  53  * instead of 7+1+1). Also, some previously 8-bit values are
  54  * now 16-bit. The inode is now 64 bytes instead of 32.
  55  */
  56 struct minix2_inode {
  57         __u16 i_mode;
  58         __u16 i_nlinks;
  59         __u16 i_uid;
  60         __u16 i_gid;
  61         __u32 i_size;
  62         __u32 i_atime;
  63         __u32 i_mtime;
  64         __u32 i_ctime;
  65         __u32 i_zone[10];
  66 };
  67 
  68 /*
  69  * minix super-block data on disk
  70  */
  71 struct minix_super_block {
  72         __u16 s_ninodes;
  73         __u16 s_nzones;
  74         __u16 s_imap_blocks;
  75         __u16 s_zmap_blocks;
  76         __u16 s_firstdatazone;
  77         __u16 s_log_zone_size;
  78         __u32 s_max_size;
  79         __u16 s_magic;
  80         __u16 s_state;
  81         __u32 s_zones;
  82 };
  83 
  84 struct minix_dir_entry {
  85         __u16 inode;
  86         char name[0];
  87 };
  88 
  89 #ifdef __KERNEL__
  90 
  91 extern int minix_lookup(struct inode * dir,const char * name, int len,
  92                         struct inode ** result);
  93 extern int minix_create(struct inode * dir,const char * name, int len, int mode,
  94         struct inode ** result);
  95 extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode);
  96 extern int minix_rmdir(struct inode * dir, const char * name, int len);
  97 extern int minix_unlink(struct inode * dir, const char * name, int len);
  98 extern int minix_symlink(struct inode * inode, const char * name, int len,
  99         const char * symname);
 100 extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
 101 extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
 102 extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len,
 103         struct inode * new_dir, const char * new_name, int new_len);
 104 extern struct inode * minix_new_inode(const struct inode * dir);
 105 extern void minix_free_inode(struct inode * inode);
 106 extern unsigned long minix_count_free_inodes(struct super_block *sb);
 107 extern int minix_new_block(struct super_block * sb);
 108 extern void minix_free_block(struct super_block * sb, int block);
 109 extern unsigned long minix_count_free_blocks(struct super_block *sb);
 110 
 111 extern int minix_bmap(struct inode *,int);
 112 
 113 extern struct buffer_head * minix_getblk(struct inode *, int, int);
 114 extern struct buffer_head * minix_bread(struct inode *, int, int);
 115 
 116 extern void minix_truncate(struct inode *);
 117 extern void minix_put_super(struct super_block *);
 118 extern struct super_block *minix_read_super(struct super_block *,void *,int);
 119 extern int init_minix_fs(void);
 120 extern void minix_write_super(struct super_block *);
 121 extern int minix_remount (struct super_block * sb, int * flags, char * data);
 122 extern void minix_read_inode(struct inode *);
 123 extern void minix_write_inode(struct inode *);
 124 extern void minix_put_inode(struct inode *);
 125 extern void minix_statfs(struct super_block *, struct statfs *, int);
 126 extern int minix_sync_inode(struct inode *);
 127 extern int minix_sync_file(struct inode *, struct file *);
 128 
 129 extern struct inode_operations minix_file_inode_operations;
 130 extern struct inode_operations minix_dir_inode_operations;
 131 extern struct inode_operations minix_symlink_inode_operations;
 132 
 133 #endif /* __KERNEL__ */
 134 
 135 #endif

/* [previous][next][first][last][top][bottom][index][help] */