X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Ffilesys%2Ffile.h;h=dc05332f8b3b007d49b99214f20cfa819c3a0d20;hp=c28201d9b8b82022faf1e80671b5d366b01ec219;hb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;hpb=5780c9f434cca090f88463b7f0199d49b4ded288 diff --git a/src/filesys/file.h b/src/filesys/file.h index c28201d..dc05332 100644 --- a/src/filesys/file.h +++ b/src/filesys/file.h @@ -1,19 +1,28 @@ #ifndef FILESYS_FILE_H #define FILESYS_FILE_H -#include -#include "devices/disk.h" #include "filesys/off_t.h" -struct file *file_open (disk_sector_t); +struct inode; + +/* Opening and closing files. */ +struct file *file_open (struct inode *); +struct file *file_reopen (struct file *); void file_close (struct file *); + +/* Reading and writing. */ off_t file_read (struct file *, void *, off_t); off_t file_read_at (struct file *, void *, off_t size, off_t start); off_t file_write (struct file *, const void *, off_t); off_t file_write_at (struct file *, const void *, off_t size, off_t start); -off_t file_length (struct file *); + +/* Preventing writes. */ +void file_deny_write (struct file *); +void file_allow_write (struct file *); + +/* File position. */ void file_seek (struct file *, off_t); off_t file_tell (struct file *); -void file_remove (struct file *); +off_t file_length (struct file *); #endif /* filesys/file.h */