PKUOS - Pintos
Pintos source browser for PKU Operating System 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
8struct bitmap;
9
10void inode_init (void);
13struct inode *inode_reopen (struct inode *);
15void inode_close (struct inode *);
16void inode_remove (struct inode *);
17off_t inode_read_at (struct inode *, void *, off_t size, off_t offset);
18off_t inode_write_at (struct inode *, const void *, off_t size, off_t offset);
19void inode_deny_write (struct inode *);
20void inode_allow_write (struct inode *);
21off_t inode_length (const struct inode *);
22
23#endif /**< filesys/inode.h */
uint32_t block_sector_t
Index of a block device sector.
Definition: block.h:15
void inode_close(struct inode *)
Closes INODE and writes it to disk.
Definition: inode.c:164
struct inode * inode_open(block_sector_t)
Reads an inode from SECTOR and returns a ‘struct inode’ that contains it.
Definition: inode.c:112
void inode_deny_write(struct inode *)
Disables writes to INODE.
Definition: inode.c:323
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
off_t inode_length(const struct inode *)
filesys/inode.h
Definition: inode.c:342
void inode_allow_write(struct inode *)
Re-enables writes to INODE.
Definition: inode.c:333
block_sector_t inode_get_inumber(const struct inode *)
Returns INODE's inode number.
Definition: inode.c:155
struct inode * inode_reopen(struct inode *)
Reopens and returns INODE.
Definition: inode.c:146
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
void inode_init(void)
Initializes the inode module.
Definition: inode.c:62
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
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
int32_t off_t
An offset within a file.
Definition: off_t.h:9
From the outside, a bitmap is an array of bits.
Definition: bitmap.c:28
In-memory inode.
Definition: inode.c:33