aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/user
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-12 20:19:24 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-12 20:19:24 +0100
commit862b93742237ed959e9b8dc12a536880ea45d0cf (patch)
tree188360ae20f8524b36fad6941523c4fada5f0d70 /src/kernel/user
parent109b57ea2a8a3dfd88c37a9c00ad301602108efa (diff)
downloadkogata-862b93742237ed959e9b8dc12a536880ea45d0cf.tar.gz
kogata-862b93742237ed959e9b8dc12a536880ea45d0cf.zip
Adjust nullfs header
Diffstat (limited to 'src/kernel/user')
-rw-r--r--src/kernel/user/vfs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/kernel/user/vfs.c b/src/kernel/user/vfs.c
index 687e7f1..38b88d7 100644
--- a/src/kernel/user/vfs.c
+++ b/src/kernel/user/vfs.c
@@ -86,7 +86,7 @@ void unref_fs_node(fs_node_t *n) {
ASSERT(n != &n->fs->root);
ASSERT(n->parent != 0);
- n->ops->dispose(n->data);
+ if (n->ops->dispose) n->ops->dispose(n->data);
unref_fs_node(n->parent);
unref_fs(n->fs);
free(n);
@@ -293,6 +293,10 @@ void unref_file(fs_handle_t *file) {
}
}
+int file_get_mode(fs_handle_t *f) {
+ return f->mode;
+}
+
size_t file_read(fs_handle_t *f, size_t offset, size_t len, char* buf) {
if (!(f->mode && FM_READ)) return 0;
@@ -307,8 +311,12 @@ size_t file_write(fs_handle_t *f, size_t offset, size_t len, const char* buf) {
return f->ops->write(f->data, offset, len, buf);
}
-int file_get_mode(fs_handle_t *f) {
- return f->mode;
+bool file_stat(fs_handle_t *f, stat_t *st) {
+ return f->ops->stat && f->ops->stat(f->data, st);
+}
+
+bool file_readdir(fs_handle_t *f, dirent_t *d) {
+ return f->ops->readdir && f->ops->readdir(f->data, d);
}
/* vim: set ts=4 sw=4 tw=0 noet :*/