diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-24 16:58:33 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-24 16:58:33 +0100 |
commit | 150dd5f860a5f22a8c3bcc1bf3a1f2e36dcf6fd8 (patch) | |
tree | e92a633a780104617483fd9fd379238299affabd /src/kernel/user/nullfs.c | |
parent | fa8a840c6dfc9eb737ef5d777f066b05eb8d9544 (diff) | |
download | kogata-150dd5f860a5f22a8c3bcc1bf3a1f2e36dcf6fd8.tar.gz kogata-150dd5f860a5f22a8c3bcc1bf3a1f2e36dcf6fd8.zip |
Change VFS a bit : the root directory of a fs is now a pointer. Fix tests.
Diffstat (limited to 'src/kernel/user/nullfs.c')
-rw-r--r-- | src/kernel/user/nullfs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/user/nullfs.c b/src/kernel/user/nullfs.c index a925ab5..a44e4b3 100644 --- a/src/kernel/user/nullfs.c +++ b/src/kernel/user/nullfs.c @@ -37,7 +37,6 @@ static void nullfs_fh_close(fs_handle_ptr f); // VTables that go with it static fs_driver_ops_t nullfs_driver_ops = { .make = nullfs_fs_make, - .detect = 0, }; static fs_ops_t nullfs_ops = { @@ -134,6 +133,8 @@ void register_nullfs_driver() { } bool nullfs_fs_make(fs_handle_t *source, const char* opts, fs_t *fs_s) { + if (source != 0) return false; + nullfs_t *fs = (nullfs_t*)malloc(sizeof(nullfs_t)); if (fs == 0) return false; @@ -159,8 +160,8 @@ bool nullfs_fs_make(fs_handle_t *source, const char* opts, fs_t *fs_s) { fs_s->ops = &nullfs_ops; fs_s->data = fs; - fs_s->root.ops = &nullfs_d_ops; - fs_s->root.data = root; + fs_s->root->ops = &nullfs_d_ops; + fs_s->root->data = root; return true; } @@ -173,7 +174,7 @@ void nullfs_fs_shutdown(fs_ptr fs) { bool nullfs_add_node(fs_t *fs, const char* name, fs_node_ptr data, fs_node_ops_t *ops) { char file_name[DIR_MAX]; - fs_node_t *n = fs_walk_path_except_last(&fs->root, name, file_name); + fs_node_t *n = fs_walk_path_except_last(fs->root, name, file_name); if (n == 0) return false; if (n->ops != &nullfs_d_ops) return false; |