vfs: add new ext2 ops
This commit is contained in:
parent
d1ea8f617e
commit
aee65e1dd2
2 changed files with 8 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue