Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ext2 filesystem #1147

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions include/sys/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef struct vfsconf vfsconf_t;
typedef struct statvfs statvfs_t;

/* VFS operations */
typedef int vfs_mount_t(mount_t *m);
typedef int vfs_mount_t(mount_t *m, vnode_t *vsrc);
typedef int vfs_root_t(mount_t *m, vnode_t **vp);
typedef int vfs_statvfs_t(mount_t *m, statvfs_t *sb);
typedef int vfs_vget_t(mount_t *m, ino_t ino, vnode_t **vp);
Expand Down Expand Up @@ -78,8 +78,8 @@ typedef struct mount {
void *mnt_data; /* Filesystem-specific arbitrary data */
} mount_t;

static inline int VFS_MOUNT(mount_t *m) {
return m->mnt_vfsops->vfs_mount(m);
static inline int VFS_MOUNT(mount_t *m, vnode_t *vsrc) {
return m->mnt_vfsops->vfs_mount(m, vsrc);
}

static inline int VFS_ROOT(mount_t *m, vnode_t **vp) {
Expand All @@ -105,9 +105,10 @@ vfsconf_t *vfs_get_by_name(const char *name);
* list. */
mount_t *vfs_mount_alloc(vnode_t *v, vfsconf_t *vfc);

/* Mount a new instance of the filesystem vfc at the vnode v. Does not support
* remounting. TODO: Additional filesystem-specific arguments. */
int vfs_domount(vfsconf_t *vfc, vnode_t *v);
/* Mount a new instance of the filesystem vfc at the vnode vdst. Does not
* support remounting. Use vsrc as a source for fs data if not NULL.
*TODO: Additional filesystem-specific arguments. */
int vfs_domount(vfsconf_t *vfc, vnode_t *vdst, vnode_t *vsrc);

#else /* !_KERNEL */
#include <sys/cdefs.h>
Expand Down
1 change: 1 addition & 0 deletions include/sys/syscallargs.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ typedef struct {
} mmap_args_t;

typedef struct {
SYSCALLARG(const char *) source;
SYSCALLARG(const char *) type;
SYSCALLARG(const char *) path;
} mount_args_t;
Expand Down
2 changes: 1 addition & 1 deletion include/sys/vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int do_futimens(proc_t *p, int fd, timespec_t *times);
int do_utimensat(proc_t *p, int fd, char *path, timespec_t *times, int flag);

/* Mount a new instance of the filesystem named fs at the requested path. */
int do_mount(proc_t *p, const char *fs, const char *path);
int do_mount(proc_t *p, const char *source, const char *fs, const char *path);
int do_getdents(proc_t *p, int fd, uio_t *uio);
int do_statvfs(proc_t *p, char *path, statvfs_t *buf);
int do_fstatvfs(proc_t *p, int fd, statvfs_t *buf);
Expand Down
2 changes: 1 addition & 1 deletion sys/kern/devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static vnodeops_t devfs_dir_vnodeops = {

/* We are using a single vnode for each devfs_node
* instead of allocating a new one each time, to simplify things. */
static int devfs_mount(mount_t *m) {
static int devfs_mount(mount_t *m, vnode_t *vsrc) {
devfs.root->dn_vnode->v_mount = m;
m->mnt_data = &devfs;
return 0;
Expand Down
Loading