#include <stddef.h>
#include <inttypes.h>
Go to the source code of this file.
#define BLOCK_SECTOR_SIZE 512 |
Definition at line 12 of file block.h.
Referenced by block_register(), byte_to_sector(), bytes_to_sectors(), fsutil_append(), fsutil_extract(), identify_ata_device(), inode_create(), inode_read_at(), inode_write_at(), input_sector(), output_sector(), and read_partition_table().
#define PRDSNu PRIu32 |
Definition at line 20 of file block.h.
Referenced by block_register(), check_sector(), found_partition(), fsutil_extract(), ide_read(), ide_write(), and read_partition_table().
typedef uint32_t block_sector_t |
enum block_type |
struct block* block_first | ( | void | ) | [read] |
struct block* block_get_by_name | ( | const char * | name | ) | [read] |
Definition at line 90 of file block.c.
References list_begin(), list_end(), list_entry, list_next(), block::name, NULL, and strcmp().
struct block* block_get_role | ( | enum | block_type | ) | [read] |
Definition at line 57 of file block.c.
References ASSERT, and BLOCK_ROLE_CNT.
Referenced by filesys_init(), fsutil_append(), and fsutil_extract().
const char* block_name | ( | struct block * | ) |
Definition at line 158 of file block.c.
References block::name.
Referenced by check_sector(), found_partition(), fsutil_extract(), partition_scan(), and read_partition_table().
Definition at line 82 of file block.c.
References block::list_elem, list_elem_to_block(), and list_next().
void block_print_stats | ( | void | ) |
Definition at line 172 of file block.c.
References BLOCK_CNT, block_type_name(), block::lock, lock_acquire(), lock_release(), block::name, NULL, printf(), block::read_cnt, block::type, and block::write_cnt.
Referenced by print_stats().
void block_read | ( | struct block * | , | |
block_sector_t | , | |||
void * | ||||
) |
Definition at line 124 of file block.c.
References block::aux, check_sector(), block::lock, lock_acquire(), lock_release(), block::ops, block_operations::read, and block::read_cnt.
Referenced by fsutil_extract(), inode_open(), inode_read_at(), inode_write_at(), partition_read(), and read_partition_table().
struct block* block_register | ( | const char * | name, | |
enum | block_type, | |||
const char * | extra_info, | |||
block_sector_t | size, | |||
const struct block_operations * | , | |||
void * | aux | |||
) | [read] |
Definition at line 196 of file block.c.
References block::aux, BLOCK_SECTOR_SIZE, block::list_elem, list_push_back(), block::lock, lock_init(), malloc(), block::name, NULL, block::ops, PANIC, PRDSNu, print_human_readable_size(), printf(), block::read_cnt, block::size, strlcpy(), block::type, and block::write_cnt.
Referenced by found_partition(), identify_ata_device(), and msc_attached().
void block_set_role | ( | enum | block_type, | |
struct block * | ||||
) |
block_sector_t block_size | ( | struct block * | ) |
Definition at line 151 of file block.c.
References block::size.
Referenced by bitmap_create_in_buf(), check_file_handle(), found_partition(), free_map_init(), fsutil_append(), malloc_init(), read_partition_table(), realloc(), seq_test(), and write_some_bytes().
enum block_type block_type | ( | struct block * | ) |
const char* block_type_name | ( | enum | block_type | ) |
Definition at line 38 of file block.c.
References ASSERT, and BLOCK_CNT.
Referenced by block_print_stats().
void block_write | ( | struct block * | , | |
block_sector_t | , | |||
const void * | ||||
) |
Definition at line 139 of file block.c.
References ASSERT, block::aux, BLOCK_FOREIGN, check_sector(), block::lock, lock_acquire(), lock_release(), block::ops, block::type, block_operations::write, and block::write_cnt.
Referenced by fsutil_append(), fsutil_extract(), inode_create(), inode_write_at(), and partition_write().