diff --git a/fs/ext2.c b/fs/ext2.c index f445d0c..bb6125a 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -1264,7 +1264,7 @@ static int ext2_open_dir(struct fs *vfs, struct vnode *vnode) return 0; } -static int ext2_read_vno(struct fs *vfs, struct vnode *vnode, size_t blockno, void *buf) +static int ext2_read_vno(struct fs *vfs, struct vnode *vnode, void *buf, size_t blockno) { struct ext2fs *fs = (struct ext2fs *)vfs->fs; struct ext2_inode inode; @@ -1334,6 +1334,9 @@ struct fs *ext2_init_fs(struct block_device *bdev) ext2_ops->readdir = ext2_readdir; ext2_ops->mkdir = ext2_mkdir; ext2_ops->unlink = ext2_unlink; + ext2_ops->open_vno = ext2_open_vno; + ext2_ops->open_dir = ext2_open_dir; + ext2_ops->read_vno = ext2_read_vno; ret->ops = ext2_ops; diff --git a/include/fs/vfs.h b/include/fs/vfs.h index 21870dc..dc6ba14 100644 --- a/include/fs/vfs.h +++ b/include/fs/vfs.h @@ -114,7 +114,10 @@ struct fs_ops { int (*open)(struct fs *fs, struct vnode *vnode, const char *path); int (*readdir)(struct vnode *vnode, struct dirent **dir); int (*mkdir)(struct fs *fs, const char *path); /* to be removed */ - int (*unlink)(struct fs *fs, const char *path); + int (*unlink)(struct fs *fs, const char *path); /* change to vno, not path) */ + int (*open_vno)(struct fs *vfs, struct vnode *out, ino_t ino_num); + int (*read_vno)(struct fs *vfs, struct vnode *vnode, void *buf, size_t blockno); + int (*open_dir)(struct fs *vfs, struct vnode *out); }; struct fs {