1 #ifndef _SFFS_PROTO_H 2 #define _SFFS_PROTO_H 3 4 /* dentry.c */ 5 void init_dentry(void); 6 struct inode *lookup_dentry(struct inode *parent, char *name); 7 void add_dentry(struct inode *parent, char *name, struct inode *ino); 8 void del_dentry(struct inode *ino); 9 10 /* handle.c */ 11 int get_handle(struct inode *ino); 12 void put_handle(struct inode *ino); 13 14 /* inode.c */ 15 struct inode *init_inode(void); 16 struct inode *find_inode(ino_t ino_nr); 17 void get_inode(struct inode *ino); 18 void put_inode(struct inode *ino); 19 void link_inode(struct inode *parent, struct inode *ino); 20 void unlink_inode(struct inode *ino); 21 struct inode *get_free_inode(void); 22 int have_free_inode(void); 23 int have_used_inode(void); 24 int do_putnode(ino_t ino_nr, unsigned int count); 25 26 /* link.c */ 27 int do_create(ino_t dir_nr, char *name, mode_t mode, uid_t uid, gid_t gid, 28 struct fsdriver_node *node); 29 int do_mkdir(ino_t dir_nr, char *name, mode_t mode, uid_t uid, gid_t gid); 30 int do_unlink(ino_t dir_nr, char *name, int call); 31 int do_rmdir(ino_t dir_nr, char *name, int call); 32 int do_rename(ino_t old_dir_nr, char *old_name, ino_t new_dir_nr, 33 char *new_name); 34 35 /* lookup.c */ 36 int do_lookup(ino_t dir_nr, char *name, struct fsdriver_node *node, 37 int *is_mountpt); 38 39 /* main.c */ 40 int main(int argc, char *argv[]); 41 42 /* misc.c */ 43 int do_statvfs(struct statvfs *statvfs); 44 45 /* mount.c */ 46 int do_mount(dev_t dev, unsigned int flags, struct fsdriver_node *root_node, 47 unsigned int *res_flags); 48 void do_unmount(void); 49 50 /* name.c */ 51 void normalize_name(char dst[NAME_MAX+1], char *src); 52 int compare_name(char *name1, char *name2); 53 54 /* path.c */ 55 int make_path(char path[PATH_MAX], struct inode *ino); 56 int push_path(char path[PATH_MAX], char *name); 57 void pop_path(char path[PATH_MAX]); 58 59 /* read.c */ 60 ssize_t do_read(ino_t ino_nr, struct fsdriver_data *data, size_t count, 61 off_t pos, int call); 62 ssize_t do_getdents(ino_t ino_nr, struct fsdriver_data *data, size_t bytes, 63 off_t *pos); 64 65 /* stat.c */ 66 mode_t get_mode(struct inode *ino, int mode); 67 int do_stat(ino_t ino_nr, struct stat *stat); 68 int do_chmod(ino_t ino_nr, mode_t *mode); 69 int do_utime(ino_t ino_nr, struct timespec *atime, struct timespec *mtime); 70 71 /* verify.c */ 72 int verify_path(char *path, struct inode *ino, struct sffs_attr *attr, 73 int *stale); 74 int verify_inode(struct inode *ino, char path[PATH_MAX], 75 struct sffs_attr *attr); 76 int verify_dentry(struct inode *parent, char name[NAME_MAX+1], 77 char path[PATH_MAX], struct inode **res_ino); 78 79 /* write.c */ 80 ssize_t do_write(ino_t ino_nr, struct fsdriver_data *data, size_t count, 81 off_t pos, int call); 82 int do_trunc(ino_t ino_nr, off_t start, off_t end); 83 84 #endif /* _SFFS_PROTO_H */ 85