Changeset a6ba0c9 in mainline
- Timestamp:
- 2010-11-27T17:46:58Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d70d80ed
- Parents:
- f092718
- Location:
- uspace/lib/block
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/block/libblock.c
rf092718 ra6ba0c9 261 261 { 262 262 block_t *b = hash_table_get_instance(item, block_t, hash_link); 263 return b-> boff== *key;263 return b->lba == *key; 264 264 } 265 265 … … 339 339 } 340 340 341 unsigned long key = b-> boff;341 unsigned long key = b->lba; 342 342 hash_table_remove(&cache->block_hash, &key, 1); 343 343 … … 380 380 * block pointer on success. 381 381 * @param devmap_handle Device handle of the block device. 382 * @param b off Block offset.382 * @param ba Block address (logical). 383 383 * @param flags If BLOCK_FLAGS_NOREAD is specified, block_get() 384 384 * will not read the contents of the block from the … … 387 387 * @return EOK on success or a negative error code. 388 388 */ 389 int block_get(block_t **block, devmap_handle_t devmap_handle, aoff64_t b off, int flags)389 int block_get(block_t **block, devmap_handle_t devmap_handle, aoff64_t ba, int flags) 390 390 { 391 391 devcon_t *devcon; … … 393 393 block_t *b; 394 394 link_t *l; 395 unsigned long key = b off;395 unsigned long key = ba; 396 396 int rc; 397 397 … … 501 501 */ 502 502 list_remove(&b->free_link); 503 temp_key = b-> boff;503 temp_key = b->lba; 504 504 hash_table_remove(&cache->block_hash, &temp_key, 1); 505 505 } … … 508 508 b->devmap_handle = devmap_handle; 509 509 b->size = cache->lblock_size; 510 b-> boff = boff;511 b->pba = ba_ltop(devcon, b-> boff);510 b->lba = ba; 511 b->pba = ba_ltop(devcon, b->lba); 512 512 hash_table_insert(&cache->block_hash, &key, &b->hash_link); 513 513 … … 621 621 * Take the block out of the cache and free it. 622 622 */ 623 unsigned long key = block-> boff;623 unsigned long key = block->lba; 624 624 hash_table_remove(&cache->block_hash, &key, 1); 625 625 free(block); … … 719 719 * 720 720 * @param devmap_handle Device handle of the block device. 721 * @param ba Address of first block .721 * @param ba Address of first block (physical). 722 722 * @param cnt Number of blocks. 723 723 * @param src Buffer for storing the data. … … 747 747 * 748 748 * @param devmap_handle Device handle of the block device. 749 * @param ba Address of first block .749 * @param ba Address of first block (physical). 750 750 * @param cnt Number of blocks. 751 751 * @param src The data to be written. -
uspace/lib/block/libblock.h
rf092718 ra6ba0c9 74 74 devmap_handle_t devmap_handle; 75 75 /** Logical block address */ 76 aoff64_t boff;76 aoff64_t lba; 77 77 /** Physical block address */ 78 78 aoff64_t pba;
Note:
See TracChangeset
for help on using the changeset viewer.