mirror of
https://github.com/drasko/codezero.git
synced 2026-03-08 21:33:15 +01:00
Finished adding untested bare functionality vfs
Finished adding untested shm syscalls. Finished adding untested l4 send/recv helpers Everything compiles. Now going to fix lots of bugs ;-)
This commit is contained in:
28
tasks/fs0/src/file.c
Normal file
28
tasks/fs0/src/file.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* File content tracking.
|
||||
*
|
||||
* Copyright (C) 2008 Bahadir Balban
|
||||
*/
|
||||
#include <fs.h>
|
||||
#include <file.h>
|
||||
#include <l4/lib/list.h>
|
||||
#include <l4/macros.h>
|
||||
#include INC_GLUE(memory.h)
|
||||
#include <stdio.h>
|
||||
|
||||
/* List of all in-memory files. */
|
||||
struct list_head vm_file_list;
|
||||
|
||||
/*
|
||||
* This reads contents of a file in pages, calling the fs-specific file read function to read-in
|
||||
* those pages' contents.
|
||||
*
|
||||
* Normally this is ought to be called by mm0 when a file's pages cannot be found in the page
|
||||
* cache.
|
||||
*/
|
||||
int generic_file_read(struct vnode *v, unsigned long pfn, unsigned long npages, void *page_buf)
|
||||
{
|
||||
BUG_ON(!is_page_aligned(page_buf));
|
||||
|
||||
return v->fops.read(v, pfn, npages, page_buf);
|
||||
}
|
||||
Reference in New Issue
Block a user