CS318 - Pintos
Pintos source browser for JHU CS318 course
inode.h
Go to the documentation of this file.
1 #ifndef FILESYS_INODE_H
2 #define FILESYS_INODE_H
3 
4 #include <stdbool.h>
5 #include "filesys/off_t.h"
6 #include "devices/block.h"
7 
8 struct bitmap;
9 
10 void inode_init (void);
13 struct inode *inode_reopen (struct inode *);
14 block_sector_t inode_get_inumber (const struct inode *);
15 void inode_close (struct inode *);
16 void inode_remove (struct inode *);
17 off_t inode_read_at (struct inode *, void *, off_t size, off_t offset);
18 off_t inode_write_at (struct inode *, const void *, off_t size, off_t offset);
19 void inode_deny_write (struct inode *);
20 void inode_allow_write (struct inode *);
21 off_t inode_length (const struct inode *);
22 
23 #endif /**< filesys/inode.h */
block.h
inode_allow_write
void inode_allow_write(struct inode *)
Re-enables writes to INODE.
Definition: inode.c:333
off_t.h
off_t
int32_t off_t
An offset within a file.
Definition: off_t.h:9
stdbool.h
block_sector_t
uint32_t block_sector_t
Index of a block device sector.
Definition: block.h:15
inode_read_at
off_t inode_read_at(struct inode *, void *, off_t size, off_t offset)
Reads SIZE bytes from INODE into BUFFER, starting at position OFFSET.
Definition: inode.c:201
inode
In-memory inode.
Definition: inode.c:32
inode_write_at
off_t inode_write_at(struct inode *, const void *, off_t size, off_t offset)
Writes SIZE bytes from BUFFER into INODE, starting at OFFSET.
Definition: inode.c:258
inode_open
struct inode * inode_open(block_sector_t)
Reads an inode from SECTOR and returns a ‘struct inode’ that contains it.
Definition: inode.c:112
inode_get_inumber
block_sector_t inode_get_inumber(const struct inode *)
Returns INODE's inode number.
Definition: inode.c:155
inode_deny_write
void inode_deny_write(struct inode *)
Disables writes to INODE.
Definition: inode.c:323
bitmap
From the outside, a bitmap is an array of bits.
Definition: bitmap.c:27
inode_init
void inode_init(void)
Initializes the inode module.
Definition: inode.c:62
inode_create
bool inode_create(block_sector_t, off_t)
Initializes an inode with LENGTH bytes of data and writes the new inode to sector SECTOR on the file ...
Definition: inode.c:73
inode_close
void inode_close(struct inode *)
Closes INODE and writes it to disk.
Definition: inode.c:164
inode_length
off_t inode_length(const struct inode *)
filesys/inode.h
Definition: inode.c:342
inode_reopen
struct inode * inode_reopen(struct inode *)
Reopens and returns INODE.
Definition: inode.c:146
inode_remove
void inode_remove(struct inode *)
Marks INODE to be deleted when it is closed by the last caller who has it open.
Definition: inode.c:191