aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/user/vfs.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-20 15:47:51 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-20 15:47:51 +0100
commit9ba449a6e5f9db20923fb9802eefe0f090ba5fff (patch)
treef0f58bfa44a30e61e30caf08af1cdf03bef822f0 /src/kernel/user/vfs.c
parent2d4d64189501c253ed6a5b5ff5e27da1cb34407a (diff)
downloadkogata-9ba449a6e5f9db20923fb9802eefe0f090ba5fff.tar.gz
kogata-9ba449a6e5f9db20923fb9802eefe0f090ba5fff.zip
Change mode of operation for mmap_file (see readme)
Diffstat (limited to 'src/kernel/user/vfs.c')
-rw-r--r--src/kernel/user/vfs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/kernel/user/vfs.c b/src/kernel/user/vfs.c
index a5f03ca..c20caa0 100644
--- a/src/kernel/user/vfs.c
+++ b/src/kernel/user/vfs.c
@@ -445,4 +445,16 @@ bool file_readdir(fs_handle_t *f, dirent_t *d) {
return f->ops->readdir && f->ops->readdir(f->data, d);
}
+uint32_t file_get_page(fs_handle_t *f, size_t offset) {
+ if (!(f->mode & FM_MMAP)) return 0;
+ ASSERT(f->ops->get_page != 0);
+ return f->ops->get_page(f->data, offset);
+}
+
+void file_commit_page(fs_handle_t *f, size_t offset, uint64_t time) {
+ if (!(f->mode & FM_MMAP)) return;
+ ASSERT(f->ops->commit_page != 0);
+ f->ops->commit_page(f->data, offset, time);
+}
+
/* vim: set ts=4 sw=4 tw=0 noet :*/