CS318 - Pintos
Pintos source browser for JHU CS318 course
filesys.h
Go to the documentation of this file.
1 #ifndef FILESYS_FILESYS_H
2 #define FILESYS_FILESYS_H
3 
4 #include <stdbool.h>
5 #include "filesys/off_t.h"
6 
7 /** Sectors of system file inodes. */
8 #define FREE_MAP_SECTOR 0 /**< Free map file inode sector. */
9 #define ROOT_DIR_SECTOR 1 /**< Root directory file inode sector. */
10 
11 /** Block device that contains the file system. */
12 struct block *fs_device;
13 
14 void filesys_init (bool format);
15 void filesys_done (void);
16 bool filesys_create (const char *name, off_t initial_size);
17 struct file *filesys_open (const char *name);
18 bool filesys_remove (const char *name);
19 
20 #endif /**< filesys/filesys.h */
name
char * name[]
Definition: insult.c:47
off_t.h
file
An open file.
Definition: file.c:7
off_t
int32_t off_t
An offset within a file.
Definition: off_t.h:9
stdbool.h
block
A block device.
Definition: block.c:9
filesys_done
void filesys_done(void)
Shuts down the file system module, writing any unwritten data to disk.
Definition: filesys.c:36
fs_device
struct block * fs_device
Block device that contains the file system.
Definition: filesys.h:12
filesys_create
bool filesys_create(const char *name, off_t initial_size)
Creates a file named NAME with the given INITIAL_SIZE.
Definition: filesys.c:46
filesys_init
void filesys_init(bool format)
Initializes the file system module.
Definition: filesys.c:18
filesys_open
struct file * filesys_open(const char *name)
Opens the file with the given NAME.
Definition: filesys.c:67
filesys_remove
bool filesys_remove(const char *name)
filesys/filesys.h
Definition: filesys.c:84