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_NAME_LEN 14
  16 #define MINIX_ROOT_INO 1
  17 
  18 #define MINIX_I_MAP_SLOTS       8
  19 #define MINIX_Z_MAP_SLOTS       8
  20 #define MINIX_SUPER_MAGIC       0x137F
  21 #define NEW_MINIX_SUPER_MAGIC   0x2468
  22 
  23 #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
  24 #define MINIX_DIR_ENTRIES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_dir_entry)))
  25 
  26 struct minix_inode {
  27         unsigned short i_mode;
  28         unsigned short i_uid;
  29         unsigned long i_size;
  30         unsigned long i_time;
  31         unsigned char i_gid;
  32         unsigned char i_nlinks;
  33         unsigned short i_zone[9];
  34 };
  35 
  36 /*
  37  * The new minix inode has all the time entries, as well as
  38  * long block numbers and a third indirect block (7+1+1+1
  39  * instead of 7+1+1). Also, some previously 8-bit values are
  40  * now 16-bit. The inode is now 64 bytes instead of 32.
  41  */
  42 struct new_minix_inode {
  43         unsigned short i_mode;
  44         unsigned short i_nlinks;
  45         unsigned short i_uid;
  46         unsigned short i_gid;
  47         unsigned long i_size;
  48         unsigned long i_atime;
  49         unsigned long i_mtime;
  50         unsigned long i_ctime;
  51         unsigned long i_zone[10];
  52 };
  53 
  54 /*
  55  * minix super-block data on disk
  56  */
  57 struct minix_super_block {
  58         unsigned short s_ninodes;
  59         unsigned short s_nzones;
  60         unsigned short s_imap_blocks;
  61         unsigned short s_zmap_blocks;
  62         unsigned short s_firstdatazone;
  63         unsigned short s_log_zone_size;
  64         unsigned long s_max_size;
  65         unsigned short s_magic;
  66 };
  67 
  68 struct minix_dir_entry {
  69         unsigned short inode;
  70         char name[MINIX_NAME_LEN];
  71 };
  72 
  73 extern int minix_lookup(struct inode * dir,const char * name, int len,
  74         struct inode ** result);
  75 extern int minix_create(struct inode * dir,const char * name, int len, int mode,
  76         struct inode ** result);
  77 extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode);
  78 extern int minix_rmdir(struct inode * dir, const char * name, int len);
  79 extern int minix_unlink(struct inode * dir, const char * name, int len);
  80 extern int minix_symlink(struct inode * inode, const char * name, int len,
  81         const char * symname);
  82 extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
  83 extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
  84 extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len,
  85         struct inode * new_dir, const char * new_name, int new_len);
  86 extern struct inode * minix_new_inode(const struct inode * dir);
  87 extern void minix_free_inode(struct inode * inode);
  88 extern unsigned long minix_count_free_inodes(struct super_block *sb);
  89 extern int minix_new_block(struct super_block * sb);
  90 extern void minix_free_block(struct super_block * sb, int block);
  91 extern unsigned long minix_count_free_blocks(struct super_block *sb);
  92 
  93 extern int minix_bmap(struct inode *,int);
  94 
  95 extern struct buffer_head * minix_getblk(struct inode *, int, int);
  96 extern struct buffer_head * minix_bread(struct inode *, int, int);
  97 
  98 extern void minix_truncate(struct inode *);
  99 extern void minix_put_super(struct super_block *);
 100 extern struct super_block *minix_read_super(struct super_block *,void *);
 101 extern void minix_read_inode(struct inode *);
 102 extern void minix_write_inode(struct inode *);
 103 extern void minix_put_inode(struct inode *);
 104 extern void minix_statfs(struct super_block *, struct statfs *);
 105 
 106 extern struct inode_operations minix_file_inode_operations;
 107 extern struct inode_operations minix_dir_inode_operations;
 108 extern struct inode_operations minix_symlink_inode_operations;
 109 extern struct inode_operations minix_chrdev_inode_operations;
 110 extern struct inode_operations minix_blkdev_inode_operations;
 111 extern struct inode_operations minix_fifo_inode_operations;
 112 
 113 extern struct file_operations minix_file_operations;
 114 extern struct file_operations minix_dir_operations;
 115 
 116 #endif

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