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. It's not actually implemented yet, but I'll look into
  12  * it.
  13  */
  14 
  15 #define MINIX_ROOT_INO 1
  16 
  17 /* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
  18 #define MINIX_LINK_MAX  250
  19 
  20 #define MINIX_I_MAP_SLOTS       8
  21 #define MINIX_Z_MAP_SLOTS       8
  22 #define MINIX_SUPER_MAGIC       0x137F          /* original minix fs */
  23 #define MINIX_SUPER_MAGIC2      0x138F          /* minix fs, 30 char names */
  24 #define NEW_MINIX_SUPER_MAGIC   0x2468          /* minix V2 - not implemented */
  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 
  30 struct minix_inode {
  31         unsigned short i_mode;
  32         unsigned short i_uid;
  33         unsigned long i_size;
  34         unsigned long i_time;
  35         unsigned char i_gid;
  36         unsigned char i_nlinks;
  37         unsigned short i_zone[9];
  38 };
  39 
  40 /*
  41  * The new minix inode has all the time entries, as well as
  42  * long block numbers and a third indirect block (7+1+1+1
  43  * instead of 7+1+1). Also, some previously 8-bit values are
  44  * now 16-bit. The inode is now 64 bytes instead of 32.
  45  */
  46 struct new_minix_inode {
  47         unsigned short i_mode;
  48         unsigned short i_nlinks;
  49         unsigned short i_uid;
  50         unsigned short i_gid;
  51         unsigned long i_size;
  52         unsigned long i_atime;
  53         unsigned long i_mtime;
  54         unsigned long i_ctime;
  55         unsigned long i_zone[10];
  56 };
  57 
  58 /*
  59  * minix super-block data on disk
  60  */
  61 struct minix_super_block {
  62         unsigned short s_ninodes;
  63         unsigned short s_nzones;
  64         unsigned short s_imap_blocks;
  65         unsigned short s_zmap_blocks;
  66         unsigned short s_firstdatazone;
  67         unsigned short s_log_zone_size;
  68         unsigned long s_max_size;
  69         unsigned short s_magic;
  70         unsigned short s_state;
  71 };
  72 
  73 struct minix_dir_entry {
  74         unsigned short inode;
  75         char name[0];
  76 };
  77 
  78 #ifdef __KERNEL__
  79 
  80 extern int minix_lookup(struct inode * dir,const char * name, int len,
  81         struct inode ** result);
  82 extern int minix_create(struct inode * dir,const char * name, int len, int mode,
  83         struct inode ** result);
  84 extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode);
  85 extern int minix_rmdir(struct inode * dir, const char * name, int len);
  86 extern int minix_unlink(struct inode * dir, const char * name, int len);
  87 extern int minix_symlink(struct inode * inode, const char * name, int len,
  88         const char * symname);
  89 extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
  90 extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
  91 extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len,
  92         struct inode * new_dir, const char * new_name, int new_len);
  93 extern struct inode * minix_new_inode(const struct inode * dir);
  94 extern void minix_free_inode(struct inode * inode);
  95 extern unsigned long minix_count_free_inodes(struct super_block *sb);
  96 extern int minix_new_block(struct super_block * sb);
  97 extern void minix_free_block(struct super_block * sb, int block);
  98 extern unsigned long minix_count_free_blocks(struct super_block *sb);
  99 
 100 extern int minix_bmap(struct inode *,int);
 101 
 102 extern struct buffer_head * minix_getblk(struct inode *, int, int);
 103 extern struct buffer_head * minix_bread(struct inode *, int, int);
 104 
 105 extern void minix_truncate(struct inode *);
 106 extern void minix_put_super(struct super_block *);
 107 extern struct super_block *minix_read_super(struct super_block *,void *,int);
 108 extern void minix_write_super(struct super_block *);
 109 extern int minix_remount (struct super_block * sb, int * flags, char * data);
 110 extern void minix_read_inode(struct inode *);
 111 extern void minix_write_inode(struct inode *);
 112 extern void minix_put_inode(struct inode *);
 113 extern void minix_statfs(struct super_block *, struct statfs *);
 114 extern int minix_sync_inode(struct inode *);
 115 extern int minix_sync_file(struct inode *, struct file *);
 116 
 117 extern struct inode_operations minix_file_inode_operations;
 118 extern struct inode_operations minix_dir_inode_operations;
 119 extern struct inode_operations minix_symlink_inode_operations;
 120 
 121 #endif /* __KERNEL__ */
 122 
 123 #endif

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