2010-06-01 14:35:33 +02:00
|
|
|
#ifndef __MFS_PROTO_H__
|
|
|
|
#define __MFS_PROTO_H__
|
|
|
|
|
2012-10-16 17:40:39 +02:00
|
|
|
/* Some shortcuts to functions in -lminixfs */
|
|
|
|
#define get_block(d, b, t) lmfs_get_block(d, b, t)
|
|
|
|
#define put_block(b, t) lmfs_put_block(b, t)
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* Function prototypes. */
|
|
|
|
|
|
|
|
/* Structs used in prototypes must be declared as such first. */
|
|
|
|
struct buf;
|
|
|
|
struct filp;
|
|
|
|
struct inode;
|
|
|
|
struct super_block;
|
|
|
|
|
2006-10-25 15:40:36 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* cache.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
zone_t alloc_zone(dev_t dev, zone_t z);
|
|
|
|
void free_zone(dev_t dev, zone_t numb);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* inode.c */
|
2014-05-01 16:19:28 +02:00
|
|
|
struct inode *alloc_inode(dev_t dev, mode_t bits);
|
2012-03-24 16:16:34 +01:00
|
|
|
void dup_inode(struct inode *ip);
|
2014-05-01 16:19:28 +02:00
|
|
|
struct inode *find_inode(dev_t dev, ino_t numb);
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_putnode(void);
|
|
|
|
void init_inode_cache(void);
|
2014-05-01 16:19:28 +02:00
|
|
|
struct inode *get_inode(dev_t dev, ino_t numb);
|
2012-03-24 16:16:34 +01:00
|
|
|
void put_inode(struct inode *rip);
|
|
|
|
void update_times(struct inode *rip);
|
|
|
|
void rw_inode(struct inode *rip, int rw_flag);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* link.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_ftrunc(void);
|
|
|
|
int fs_link(void);
|
|
|
|
int fs_rdlink(void);
|
|
|
|
int fs_rename(void);
|
|
|
|
int fs_unlink(void);
|
|
|
|
int truncate_inode(struct inode *rip, off_t len);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
/* misc.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_flush(void);
|
|
|
|
int fs_sync(void);
|
|
|
|
int fs_new_driver(void);
|
2013-03-16 05:09:36 +01:00
|
|
|
int fs_bpeek(void);
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* mount.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_mountpoint(void);
|
|
|
|
int fs_readsuper(void);
|
|
|
|
int fs_unmount(void);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* open.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_create(void);
|
|
|
|
int fs_inhibread(void);
|
|
|
|
int fs_mkdir(void);
|
|
|
|
int fs_mknod(void);
|
|
|
|
int fs_slink(void);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* path.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_lookup(void);
|
|
|
|
struct inode *advance(struct inode *dirp, char string[MFS_NAME_MAX], int
|
|
|
|
chk_perm);
|
2014-05-01 16:19:28 +02:00
|
|
|
int search_dir(struct inode *ldir_ptr, char string [MFS_NAME_MAX], ino_t
|
2012-03-24 16:16:34 +01:00
|
|
|
*numb, int flag, int check_permissions);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* protect.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_chmod(void);
|
|
|
|
int fs_chown(void);
|
|
|
|
int fs_getdents(void);
|
2014-05-01 16:19:28 +02:00
|
|
|
int forbidden(struct inode *rip, mode_t access_desired);
|
2012-03-24 16:16:34 +01:00
|
|
|
int read_only(struct inode *ip);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* read.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_breadwrite(void);
|
|
|
|
int fs_readwrite(void);
|
|
|
|
void read_ahead(void);
|
2013-03-16 03:29:32 +01:00
|
|
|
block_t read_map(struct inode *rip, off_t pos, int opportunistic);
|
|
|
|
struct buf *get_block_map(register struct inode *rip, u64_t position);
|
2012-03-24 16:16:34 +01:00
|
|
|
zone_t rd_indir(struct buf *bp, int index);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
/* stadir.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_stat(void);
|
|
|
|
int fs_statvfs(void);
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* super.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
bit_t alloc_bit(struct super_block *sp, int map, bit_t origin);
|
|
|
|
void free_bit(struct super_block *sp, int map, bit_t bit_returned);
|
|
|
|
unsigned int get_block_size(dev_t dev);
|
|
|
|
struct super_block *get_super(dev_t dev);
|
|
|
|
int read_super(struct super_block *sp);
|
|
|
|
int write_super(struct super_block *sp);
|
2013-04-26 11:54:33 +02:00
|
|
|
u32_t get_used_blocks(struct super_block *sp);
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
|
2010-06-24 01:58:16 +02:00
|
|
|
/* stats.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
bit_t count_free_bits(struct super_block *sp, int map);
|
2010-06-24 01:58:16 +02:00
|
|
|
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
/* time.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_utime(void);
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* utility.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
time_t clock_time(void);
|
|
|
|
unsigned conv2(int norm, int w);
|
|
|
|
long conv4(int norm, long x);
|
|
|
|
void mfs_nul_f(char *file, int line, char *str, unsigned int len,
|
|
|
|
unsigned int maxlen);
|
|
|
|
int min(unsigned int l, unsigned int r);
|
|
|
|
int no_sys(void);
|
|
|
|
void sanitycheck(char *file, int line);
|
2008-11-19 13:26:10 +01:00
|
|
|
#define SANITYCHECK sanitycheck(__FILE__, __LINE__)
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* write.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
void clear_zone(struct inode *rip, off_t pos, int flag);
|
|
|
|
struct buf *new_block(struct inode *rip, off_t position);
|
|
|
|
void zero_block(struct buf *bp);
|
|
|
|
int write_map(struct inode *, off_t, zone_t, int);
|
2005-06-06 13:40:32 +02:00
|
|
|
|
2010-06-01 14:35:33 +02:00
|
|
|
#endif
|
|
|
|
|