2010-08-02 13:44:45 +02:00
|
|
|
#ifndef EXT2_PROTO_H
|
|
|
|
#define EXT2_PROTO_H
|
|
|
|
|
|
|
|
/* Function prototypes. */
|
|
|
|
|
|
|
|
/* Structs used in prototypes must be declared as such first. */
|
|
|
|
struct buf;
|
|
|
|
struct filp;
|
|
|
|
struct inode;
|
|
|
|
struct super_block;
|
|
|
|
|
|
|
|
|
|
|
|
/* balloc.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
void discard_preallocated_blocks(struct inode *rip);
|
|
|
|
block_t alloc_block(struct inode *rip, block_t goal);
|
|
|
|
void free_block(struct super_block *sp, bit_t bit);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* cache.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
void buf_pool(int bufs);
|
|
|
|
void flushall(dev_t dev);
|
|
|
|
struct buf *get_block(dev_t dev, block_t block,int only_search);
|
|
|
|
void invalidate(dev_t device);
|
|
|
|
void put_block(struct buf *bp, int block_type);
|
2012-07-26 17:20:16 +02:00
|
|
|
void set_blocksize(struct super_block *sp);
|
2012-03-24 16:16:34 +01:00
|
|
|
void rw_scattered(dev_t dev, struct buf **bufq, int bufqsize, int
|
|
|
|
rw_flag);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* ialloc.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
struct inode *alloc_inode(struct inode *parent, mode_t bits);
|
|
|
|
void free_inode(struct inode *rip);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* inode.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
void dup_inode(struct inode *ip);
|
|
|
|
struct inode *find_inode(dev_t dev, ino_t numb);
|
|
|
|
int fs_putnode(void);
|
|
|
|
void init_inode_cache(void);
|
|
|
|
struct inode *get_inode(dev_t dev, ino_t numb);
|
|
|
|
void put_inode(struct inode *rip);
|
|
|
|
void update_times(struct inode *rip);
|
|
|
|
void rw_inode(struct inode *rip, int rw_flag);
|
2010-08-02 13:44:45 +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);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* misc.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_flush(void);
|
|
|
|
int fs_sync(void);
|
|
|
|
int fs_new_driver(void);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* mount.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_mountpoint(void);
|
|
|
|
int fs_readsuper(void);
|
|
|
|
int fs_unmount(void);
|
2010-08-02 13:44:45 +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);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* path.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_lookup(void);
|
|
|
|
struct inode *advance(struct inode *dirp, char string[NAME_MAX + 1], int
|
|
|
|
chk_perm);
|
|
|
|
int search_dir(struct inode *ldir_ptr, char string [NAME_MAX + 1], ino_t
|
|
|
|
*numb, int flag, int check_permissions, int ftype);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* protect.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_chmod(void);
|
|
|
|
int fs_chown(void);
|
|
|
|
int fs_getdents(void);
|
|
|
|
int forbidden(struct inode *rip, mode_t access_desired);
|
|
|
|
int read_only(struct inode *ip);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* read.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_breadwrite(void);
|
|
|
|
int fs_readwrite(void);
|
|
|
|
void read_ahead(void);
|
|
|
|
block_t read_map(struct inode *rip, off_t pos);
|
|
|
|
block_t rd_indir(struct buf *bp, int index);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* stadir.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_fstatfs(void);
|
|
|
|
int fs_stat(void);
|
|
|
|
int fs_statvfs(void);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* super.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
unsigned int get_block_size(dev_t dev);
|
|
|
|
struct super_block *get_super(dev_t dev);
|
|
|
|
int read_super(struct super_block *sp);
|
|
|
|
void write_super(struct super_block *sp);
|
|
|
|
struct group_desc* get_group_desc(unsigned int bnum);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* time.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
int fs_utime(void);
|
2010-08-02 13:44:45 +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);
|
2010-08-02 13:44:45 +02:00
|
|
|
#define SANITYCHECK sanitycheck(__FILE__, __LINE__)
|
2012-03-24 16:16:34 +01:00
|
|
|
int ansi_strcmp(register const char* ansi_s, register const char *s2,
|
|
|
|
register size_t ansi_s_length);
|
|
|
|
bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word);
|
2012-07-26 17:19:08 +02:00
|
|
|
bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits);
|
2012-03-24 16:16:34 +01:00
|
|
|
int unsetbit(bitchunk_t *bitmap, bit_t bit);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
/* write.c */
|
2012-03-24 16:16:34 +01:00
|
|
|
struct buf *new_block(struct inode *rip, off_t position);
|
|
|
|
void zero_block(struct buf *bp);
|
|
|
|
int write_map(struct inode *, off_t, block_t, int);
|
2010-08-02 13:44:45 +02:00
|
|
|
|
|
|
|
#endif /* EXT2_PROTO_H */
|