aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/user/vfs.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-03-08 13:57:35 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-03-08 13:57:35 +0100
commit845fff4dad1159d3d5b94efaf8e547af8d280a5e (patch)
tree3b962216b7167d7be723e0b2dfbcea0e4312db53 /src/kernel/user/vfs.c
parent93af9a589980403f9887936963a6ce4f189dc020 (diff)
downloadkogata-845fff4dad1159d3d5b94efaf8e547af8d280a5e.tar.gz
kogata-845fff4dad1159d3d5b94efaf8e547af8d280a5e.zip
Change prototypes for read, write, readdir, close ; implement blocking IPC.
Diffstat (limited to 'src/kernel/user/vfs.c')
-rw-r--r--src/kernel/user/vfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/user/vfs.c b/src/kernel/user/vfs.c
index 2af8cf0..4e8cf53 100644
--- a/src/kernel/user/vfs.c
+++ b/src/kernel/user/vfs.c
@@ -449,7 +449,7 @@ void ref_file(fs_handle_t *file) {
void unref_file(fs_handle_t *file) {
file->refs--;
if (file->refs == 0) {
- file->ops->close(file->data);
+ file->ops->close(file);
if (file->node) unref_fs_node(file->node);
if (file->fs) unref_fs(file->fs);
free(file);
@@ -465,7 +465,7 @@ size_t file_read(fs_handle_t *f, size_t offset, size_t len, char* buf) {
if (f->ops->read == 0) return 0;
- return f->ops->read(f->data, offset, len, buf);
+ return f->ops->read(f, offset, len, buf);
}
size_t file_write(fs_handle_t *f, size_t offset, size_t len, const char* buf) {
@@ -473,7 +473,7 @@ size_t file_write(fs_handle_t *f, size_t offset, size_t len, const char* buf) {
if (f->ops->write == 0) return 0;
- return f->ops->write(f->data, offset, len, buf);
+ return f->ops->write(f, offset, len, buf);
}
bool file_stat(fs_handle_t *f, stat_t *st) {
@@ -491,7 +491,7 @@ int file_ioctl(fs_handle_t *f, int command, void* data) {
bool file_readdir(fs_handle_t *f, size_t ent_no, dirent_t *d) {
if (!(f->mode & FM_READDIR)) return 0;
- return f->ops->readdir && f->ops->readdir(f->data, ent_no, d);
+ return f->ops->readdir && f->ops->readdir(f, ent_no, d);
}
/* vim: set ts=4 sw=4 tw=0 noet :*/