|
AquilaOS documentation
How it works, and its code
|
minix: allocating and freeing data blocks (zones), and reading and writing them, through the block cache for the ones read often. More...
Go to the source code of this file.
Functions | |
| blk_t | minix_block_alloc (struct minix *desc) |
| Allocates a free zone: its bit is set in the zone bitmap, which is written back to the disk at once. | |
| void | minix_block_free (struct minix *desc, blk_t blk) |
| Frees a zone: its bit is cleared in the zone bitmap, which is written back at once, and its copy in the block cache goes. | |
| ssize_t | minix_block_read (struct minix *desc, blk_t blk, void *buf) |
| Reads a block from the disk. | |
| ssize_t | minix_block_write (struct minix *desc, blk_t blk, void *buf) |
| Writes a block to the disk. | |
| int | minix_bcache_get (struct minix *desc, blk_t blk, void **data) |
| Gets a block from the block cache, reading it from the disk into the cache if it isn't there. | |
minix: allocating and freeing data blocks (zones), and reading and writing them, through the block cache for the ones read often.
Definition in file block.c.
Gets a block from the block cache, reading it from the disk into the cache if it isn't there.
The cache keeps the block's memory.
| desc | the mounted filesystem |
| blk | the block number |
| data | set to the cached block |
Definition at line 97 of file block.c.
References minix::bcache, bcache_find(), bcache_insert(), minix::bs, kmalloc(), minix_bcache_get(), minix_block_read(), and NULL.
Referenced by free_tree(), minix_bcache_get(), minix_inode_block_read(), and minix_inode_block_write().
Allocates a free zone: its bit is set in the zone bitmap, which is written back to the disk at once.
| desc | the mounted filesystem |
Definition at line 16 of file block.c.
References minix::bs, minix_superblock::firstdatazone, bitmap::map, bitmap::max_idx, minix_block_alloc(), minix::superblock, minix::supernode, vfs_write(), minix::zmap, minix_superblock::zmap_blocks, and minix::zmap_off.
Referenced by minix_block_alloc(), minix_inode_block_write(), and table_alloc().
Frees a zone: its bit is cleared in the zone bitmap, which is written back at once, and its copy in the block cache goes.
| desc | the mounted filesystem |
| blk | the zone's block number |
Definition at line 42 of file block.c.
References minix::bcache, bcache_remove(), minix::bs, minix_superblock::firstdatazone, bitmap::map, bitmap::max_idx, minix_block_free(), minix::superblock, minix::supernode, vfs_write(), minix::zmap, minix_superblock::zmap_blocks, and minix::zmap_off.
Referenced by free_tree(), and minix_block_free().
Reads a block from the disk.
| desc | the mounted filesystem |
| blk | the block number |
| buf | where it goes, a block's size |
Definition at line 70 of file block.c.
References minix::bs, minix_block_read(), minix::supernode, and vfs_read().
Referenced by minix_bcache_get(), minix_block_read(), and minix_inode_block_read().
Writes a block to the disk.
| desc | the mounted filesystem |
| blk | the block number |
| buf | the block's new contents |
Definition at line 83 of file block.c.
References minix::bs, minix_block_write(), minix::supernode, and vfs_write().
Referenced by free_tree(), minix_block_write(), minix_inode_block_write(), and table_alloc().