Changes in uspace/lib/libblock/libblock.c [08232ee:0da4e41] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libblock/libblock.c
r08232ee r0da4e41 47 47 #include <as.h> 48 48 #include <assert.h> 49 #include <fibril_sync h.h>49 #include <fibril_sync.h> 50 50 #include <adt/list.h> 51 51 #include <adt/hash_table.h> … … 87 87 static int write_blocks(devcon_t *devcon, bn_t ba, size_t cnt); 88 88 static int get_block_size(int dev_phone, size_t *bsize); 89 static int get_num_blocks(int dev_phone, bn_t *nblocks);90 89 91 90 static devcon_t *devcon_search(dev_handle_t dev_handle) … … 715 714 716 715 memcpy(devcon->comm_area, data, devcon->pblock_size * cnt); 717 rc = write_blocks(devcon, ba, cnt);716 rc = read_blocks(devcon, ba, cnt); 718 717 719 718 fibril_mutex_unlock(&devcon->comm_area_lock); … … 737 736 738 737 return get_block_size(devcon->dev_phone, bsize); 739 }740 741 /** Get number of blocks on device.742 *743 * @param dev_handle Device handle of the block device.744 * @param nblocks Output number of blocks.745 *746 * @return EOK on success or negative error code on failure.747 */748 int block_get_nblocks(dev_handle_t dev_handle, bn_t *nblocks)749 {750 devcon_t *devcon;751 752 devcon = devcon_search(dev_handle);753 assert(devcon);754 755 return get_num_blocks(devcon->dev_phone, nblocks);756 738 } 757 739 … … 807 789 } 808 790 809 /** Get total number of blocks on block device. */810 static int get_num_blocks(int dev_phone, bn_t *nblocks)811 {812 ipcarg_t nb_l, nb_h;813 int rc;814 815 rc = async_req_0_2(dev_phone, BD_GET_NUM_BLOCKS, &nb_l, &nb_h);816 if (rc == EOK) {817 *nblocks = (bn_t) MERGE_LOUP32(nb_l, nb_h);818 }819 820 return rc;821 }822 823 791 /** @} 824 792 */
Note:
See TracChangeset
for help on using the changeset viewer.