pintos/src/devices/block.h File Reference

#include <stddef.h>
#include <inttypes.h>

Go to the source code of this file.

Data Structures

struct  block_operations

Defines

#define BLOCK_SECTOR_SIZE   512
#define PRDSNu   PRIu32

Typedefs

typedef uint32_t block_sector_t

Enumerations

enum  block_type {
  BLOCK_KERNEL, BLOCK_FILESYS, BLOCK_SCRATCH, BLOCK_SWAP,
  BLOCK_ROLE_CNT, BLOCK_RAW = BLOCK_ROLE_CNT, BLOCK_FOREIGN, BLOCK_CNT
}

Functions

const char * block_type_name (enum block_type)
struct blockblock_get_role (enum block_type)
void block_set_role (enum block_type, struct block *)
struct blockblock_get_by_name (const char *name)
struct blockblock_first (void)
struct blockblock_next (struct block *)
block_sector_t block_size (struct block *)
void block_read (struct block *, block_sector_t, void *)
void block_write (struct block *, block_sector_t, const void *)
const char * block_name (struct block *)
enum block_type block_type (struct block *)
void block_print_stats (void)
struct blockblock_register (const char *name, enum block_type, const char *extra_info, block_sector_t size, const struct block_operations *, void *aux)


Define Documentation

#define BLOCK_SECTOR_SIZE   512

#define PRDSNu   PRIu32


Typedef Documentation

Definition at line 16 of file block.h.


Enumeration Type Documentation

enum block_type

Enumerator:
BLOCK_KERNEL 
BLOCK_FILESYS 
BLOCK_SCRATCH 
BLOCK_SWAP 
BLOCK_ROLE_CNT 
BLOCK_RAW 
BLOCK_FOREIGN 
BLOCK_CNT 

Definition at line 27 of file block.h.


Function Documentation

struct block* block_first ( void   )  [read]

Definition at line 74 of file block.c.

References list_begin(), and list_elem_to_block().

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().

struct block* block_next ( struct block  )  [read]

Definition at line 82 of file block.c.

References block::list_elem, list_elem_to_block(), and list_next().

void block_print_stats ( void   ) 

void block_read ( struct block ,
block_sector_t  ,
void *   
)

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]

void block_set_role ( enum  block_type,
struct block  
)

Definition at line 65 of file block.c.

References ASSERT, and BLOCK_ROLE_CNT.

block_sector_t block_size ( struct block  ) 

enum block_type block_type ( struct block  ) 

Definition at line 165 of file block.c.

References block::type.

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 *   
)


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6