#include "types.h"#include "defs.h"#include "param.h"#include "fs.h"#include "file.h"#include "spinlock.h"Go to the source code of this file.
Functions | |
| void | fileinit (void) |
| struct file * | filealloc (void) |
| struct file * | filedup (struct file *f) |
| void | fileclose (struct file *f) |
| int | filestat (struct file *f, struct stat *st) |
| int | fileread (struct file *f, char *addr, int n) |
| int | filewrite (struct file *f, char *addr, int n) |
Variables | |
| struct devsw | devsw [NDEV] |
| struct { | |
| struct spinlock lock | |
| struct file file [NFILE] | |
| } | ftable |
| struct file* filealloc | ( | void | ) | [read] |
Definition at line 22 of file file.c.
References acquire(), ftable, NFILE, file::ref, and release().
Referenced by pipealloc(), and sys_open().
| void fileclose | ( | struct file * | f | ) |
Definition at line 52 of file file.c.
References acquire(), file::FD_INODE, file::FD_NONE, file::FD_PIPE, ftable, file::ip, iput(), panic(), file::pipe, pipeclose(), file::ref, release(), file::type, and file::writable.
Referenced by exit(), pipealloc(), sys_close(), sys_open(), and sys_pipe().
| void fileinit | ( | void | ) |
| int fileread | ( | struct file * | f, | |
| char * | addr, | |||
| int | n | |||
| ) |
Definition at line 89 of file file.c.
References file::FD_INODE, file::FD_PIPE, ilock(), file::ip, iunlock(), file::off, panic(), file::pipe, piperead(), r, file::readable, readi(), and file::type.
Referenced by sys_read().
Definition at line 76 of file file.c.
References file::FD_INODE, ilock(), file::ip, iunlock(), stati(), and file::type.
Referenced by sys_fstat().
| int filewrite | ( | struct file * | f, | |
| char * | addr, | |||
| int | n | |||
| ) |
Definition at line 109 of file file.c.
References file::FD_INODE, file::FD_PIPE, ilock(), file::ip, iunlock(), file::off, panic(), file::pipe, pipewrite(), r, file::type, file::writable, and writei().
Referenced by sys_write().
| struct { ... } ftable |
Referenced by filealloc(), fileclose(), filedup(), and fileinit().
1.5.6