Fork me on GitHub

root/include/fiwix/filesystems.h

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

INCLUDED FROM


   1 /*
   2  * fiwix/include/fiwix/filesystems.h
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #ifndef _FIWIX_FILESYSTEMS_H
   9 #define _FIWIX_FILESYSTEMS_H
  10 
  11 #include <fiwix/types.h>
  12 #include <fiwix/limits.h>
  13 
  14 #define NR_FILESYSTEMS          5       /* supported filesystems */
  15 
  16 /* value to be determined during system startup */
  17 extern unsigned int mount_table_size;   /* size in bytes */
  18 
  19 struct filesystems {
  20         const char *name;               /* filesystem name */
  21         struct fs_operations *fsop;     /* filesystem operations */
  22         struct mount *mt;               /* mount-table entry (only for nodev) */
  23 };
  24 struct filesystems filesystems_table[NR_FILESYSTEMS];
  25 
  26 struct mount {
  27         __dev_t dev;                    /* device number */
  28         char devname[DEVNAME_MAX + 1];  /* device name */
  29         char dirname[NAME_MAX + 1];     /* mount point directory name */
  30         unsigned char used;             /* 1=busy, 0=free */
  31         struct superblock sb;           /* superblock */
  32         struct filesystems *fs;         /* pointer to filesystem structure */
  33 };
  34 extern struct mount *mount_table;
  35 
  36 int register_filesystem(const char *, struct fs_operations *);
  37 struct filesystems * get_filesystem(const char *);
  38 void fs_init(void);
  39 
  40 struct superblock * get_superblock(__dev_t);
  41 void sync_superblocks(__dev_t);
  42 int kern_mount(__dev_t, struct filesystems *);
  43 int mount_root(void);
  44 void mount_init(void);
  45 
  46 
  47 /* minix prototypes */
  48 int minix_file_open(struct inode *, struct fd *);
  49 int minix_file_close(struct inode *, struct fd *);
  50 int minix_file_write(struct inode *, struct fd *, const char *, __size_t);
  51 int minix_file_lseek(struct inode *, __off_t);
  52 int minix_dir_open(struct inode *, struct fd *);
  53 int minix_dir_close(struct inode *, struct fd *);
  54 int minix_dir_read(struct inode *, struct fd *, char *, __size_t);
  55 int minix_dir_write(struct inode *, struct fd *, const char *, __size_t);
  56 int minix_dir_readdir(struct inode *, struct fd *, struct dirent *, unsigned int);
  57 int minix_readlink(struct inode *, char *, __size_t);
  58 int minix_followlink(struct inode *, struct inode *, struct inode **);
  59 int minix_bmap(struct inode *, __off_t, int);
  60 int minix_lookup(const char *, struct inode *, struct inode **);
  61 int minix_rmdir(struct inode *, struct inode *);
  62 int minix_link(struct inode *, struct inode *, char *);
  63 int minix_unlink(struct inode *, struct inode *, char *);
  64 int minix_symlink(struct inode *, char *, char *);
  65 int minix_mkdir(struct inode *, char *, __mode_t);
  66 int minix_mknod(struct inode *, char *, __mode_t, __dev_t);
  67 int minix_truncate(struct inode *, __off_t);
  68 int minix_create(struct inode *, char *, __mode_t, struct inode **);
  69 int minix_rename(struct inode *, struct inode *, struct inode *, struct inode *, char *, char *);
  70 int minix_read_inode(struct inode *);
  71 int minix_write_inode(struct inode *);
  72 int minix_ialloc(struct inode *, int);
  73 void minix_ifree(struct inode *);
  74 void minix_statfs(struct superblock *, struct statfs *);
  75 int minix_read_superblock(__dev_t, struct superblock *);
  76 int minix_remount_fs(struct superblock *, int);
  77 int minix_write_superblock(struct superblock *);
  78 void minix_release_superblock(struct superblock *);
  79 int minix_init(void);
  80 
  81 
  82 /* ext2 prototypes */
  83 int ext2_file_open(struct inode *, struct fd *);
  84 int ext2_file_close(struct inode *, struct fd *);
  85 int ext2_file_write(struct inode *, struct fd *, const char *, __size_t);
  86 int ext2_file_lseek(struct inode *, __off_t);
  87 int ext2_dir_open(struct inode *, struct fd *);
  88 int ext2_dir_close(struct inode *, struct fd *);
  89 int ext2_dir_read(struct inode *, struct fd *, char *, __size_t);
  90 int ext2_dir_write(struct inode *, struct fd *, const char *, __size_t);
  91 int ext2_dir_readdir(struct inode *, struct fd *, struct dirent *, unsigned int);
  92 int ext2_readlink(struct inode *, char *, __size_t);
  93 int ext2_followlink(struct inode *, struct inode *, struct inode **);
  94 int ext2_bmap(struct inode *, __off_t, int);
  95 int ext2_lookup(const char *, struct inode *, struct inode **);
  96 int ext2_rmdir(struct inode *, struct inode *);
  97 int ext2_link(struct inode *, struct inode *, char *);
  98 int ext2_unlink(struct inode *, struct inode *, char *);
  99 int ext2_symlink(struct inode *, char *, char *);
 100 int ext2_mkdir(struct inode *, char *, __mode_t);
 101 int ext2_mknod(struct inode *, char *, __mode_t, __dev_t);
 102 int ext2_truncate(struct inode *, __off_t);
 103 int ext2_create(struct inode *, char *, __mode_t, struct inode **);
 104 int ext2_rename(struct inode *, struct inode *, struct inode *, struct inode *, char *, char *);
 105 int ext2_read_inode(struct inode *);
 106 int ext2_write_inode(struct inode *);
 107 int ext2_ialloc(struct inode *, int);
 108 void ext2_ifree(struct inode *);
 109 void ext2_statfs(struct superblock *, struct statfs *);
 110 int ext2_read_superblock(__dev_t, struct superblock *);
 111 int ext2_remount_fs(struct superblock *, int);
 112 int ext2_write_superblock(struct superblock *);
 113 void ext2_release_superblock(struct superblock *);
 114 int ext2_init(void);
 115 
 116 
 117 /* pipefs prototypes */
 118 int fifo_open(struct inode *, struct fd *);
 119 int pipefs_close(struct inode *, struct fd *);
 120 int pipefs_read(struct inode *, struct fd *, char *, __size_t);
 121 int pipefs_write(struct inode *, struct fd *, const char *, __size_t);
 122 int pipefs_ioctl(struct inode *, int, unsigned long int);
 123 int pipefs_lseek(struct inode *, __off_t);
 124 int pipefs_select(struct inode *, int);
 125 int pipefs_ialloc(struct inode *, int);
 126 void pipefs_ifree(struct inode *);
 127 int pipefs_read_superblock(__dev_t, struct superblock *);
 128 int pipefs_init(void);
 129 
 130 
 131 /* iso9660 prototypes */
 132 int iso9660_file_open(struct inode *, struct fd *);
 133 int iso9660_file_close(struct inode *, struct fd *);
 134 int iso9660_file_lseek(struct inode *, __off_t);
 135 int iso9660_dir_open(struct inode *, struct fd *);
 136 int iso9660_dir_close(struct inode *, struct fd *);
 137 int iso9660_dir_read(struct inode *, struct fd *, char *, __size_t);
 138 int iso9660_dir_readdir(struct inode *, struct fd *, struct dirent *, unsigned int);
 139 int iso9660_readlink(struct inode *, char *, __size_t);
 140 int iso9660_followlink(struct inode *, struct inode *, struct inode **);
 141 int iso9660_bmap(struct inode *, __off_t, int);
 142 int iso9660_lookup(const char *, struct inode *, struct inode **);
 143 int iso9660_read_inode(struct inode *);
 144 void iso9660_statfs(struct superblock *, struct statfs *);
 145 int iso9660_read_superblock(__dev_t, struct superblock *);
 146 void iso9660_release_superblock(struct superblock *);
 147 int iso9660_init(void);
 148 
 149 
 150 /* procfs prototypes */
 151 int procfs_file_open(struct inode *, struct fd *);
 152 int procfs_file_close(struct inode *, struct fd *);
 153 int procfs_file_read(struct inode *, struct fd *, char *, __size_t);
 154 int procfs_file_lseek(struct inode *, __off_t);
 155 int procfs_dir_open(struct inode *, struct fd *);
 156 int procfs_dir_close(struct inode *, struct fd *);
 157 int procfs_dir_read(struct inode *, struct fd *, char *, __size_t);
 158 int procfs_dir_readdir(struct inode *, struct fd *, struct dirent *, unsigned int);
 159 int procfs_readlink(struct inode *, char *, __size_t);
 160 int procfs_followlink(struct inode *, struct inode *, struct inode **);
 161 int procfs_bmap(struct inode *, __off_t, int);
 162 int procfs_lookup(const char *, struct inode *, struct inode **);
 163 int procfs_read_inode(struct inode *);
 164 void procfs_statfs(struct superblock *, struct statfs *);
 165 int procfs_read_superblock(__dev_t, struct superblock *);
 166 int procfs_init(void);
 167 
 168 #endif /* _FIWIX_FILESYSTEMS_H */

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