Changes in uspace/lib/block/block.c [b7fd2a0:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/block/block.c
rb7fd2a0 rcde999a 88 88 } devcon_t; 89 89 90 static errno_t read_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);91 static errno_t write_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);90 static int read_blocks(devcon_t *, aoff64_t, size_t, void *, size_t); 91 static int write_blocks(devcon_t *, aoff64_t, size_t, void *, size_t); 92 92 static aoff64_t ba_ltop(devcon_t *, aoff64_t); 93 93 … … 107 107 } 108 108 109 static errno_t devcon_add(service_id_t service_id, async_sess_t *sess,109 static int devcon_add(service_id_t service_id, async_sess_t *sess, 110 110 size_t bsize, aoff64_t dev_size, bd_t *bd) 111 111 { … … 146 146 } 147 147 148 errno_t block_init(service_id_t service_id, size_t comm_size)148 int block_init(service_id_t service_id, size_t comm_size) 149 149 { 150 150 bd_t *bd; … … 156 156 } 157 157 158 errno_t rc = bd_open(sess, &bd);158 int rc = bd_open(sess, &bd); 159 159 if (rc != EOK) { 160 160 async_hangup(sess); … … 209 209 } 210 210 211 errno_t block_bb_read(service_id_t service_id, aoff64_t ba)211 int block_bb_read(service_id_t service_id, aoff64_t ba) 212 212 { 213 213 void *bb_buf; 214 errno_t rc;214 int rc; 215 215 216 216 devcon_t *devcon = devcon_search(service_id); … … 270 270 }; 271 271 272 errno_t block_cache_init(service_id_t service_id, size_t size, unsigned blocks,272 int block_cache_init(service_id_t service_id, size_t size, unsigned blocks, 273 273 enum cache_mode mode) 274 274 { … … 307 307 } 308 308 309 errno_t block_cache_fini(service_id_t service_id)309 int block_cache_fini(service_id_t service_id) 310 310 { 311 311 devcon_t *devcon = devcon_search(service_id); 312 312 cache_t *cache; 313 errno_t rc;313 int rc; 314 314 315 315 if (!devcon) … … 383 383 * @return EOK on success or an error code. 384 384 */ 385 errno_t block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags)385 int block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags) 386 386 { 387 387 devcon_t *devcon; … … 390 390 link_t *link; 391 391 aoff64_t p_ba; 392 errno_t rc;392 int rc; 393 393 394 394 devcon = devcon_search(service_id); … … 580 580 * @return EOK on success or an error code. 581 581 */ 582 errno_t block_put(block_t *block)582 int block_put(block_t *block) 583 583 { 584 584 devcon_t *devcon = devcon_search(block->service_id); … … 586 586 unsigned blocks_cached; 587 587 enum cache_mode mode; 588 errno_t rc = EOK;588 int rc = EOK; 589 589 590 590 assert(devcon); … … 701 701 * @return EOK on success or an error code on failure. 702 702 */ 703 errno_t block_seqread(service_id_t service_id, void *buf, size_t *bufpos,703 int block_seqread(service_id_t service_id, void *buf, size_t *bufpos, 704 704 size_t *buflen, aoff64_t *pos, void *dst, size_t size) 705 705 { … … 735 735 if (*bufpos == *buflen) { 736 736 /* Refill the communication buffer with a new block. */ 737 errno_t rc;737 int rc; 738 738 739 739 rc = read_blocks(devcon, *pos / block_size, 1, buf, … … 760 760 * @return EOK on success or an error code on failure. 761 761 */ 762 errno_t block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf)762 int block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf) 763 763 { 764 764 devcon_t *devcon; … … 779 779 * @return EOK on success or an error code on failure. 780 780 */ 781 errno_t block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt,781 int block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt, 782 782 const void *data) 783 783 { … … 798 798 * @return EOK on success or an error code on failure. 799 799 */ 800 errno_t block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)800 int block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt) 801 801 { 802 802 devcon_t *devcon; … … 815 815 * @return EOK on success or an error code on failure. 816 816 */ 817 errno_t block_get_bsize(service_id_t service_id, size_t *bsize)817 int block_get_bsize(service_id_t service_id, size_t *bsize) 818 818 { 819 819 devcon_t *devcon; … … 832 832 * @return EOK on success or an error code on failure. 833 833 */ 834 errno_t block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)834 int block_get_nblocks(service_id_t service_id, aoff64_t *nblocks) 835 835 { 836 836 devcon_t *devcon = devcon_search(service_id); … … 849 849 * @return EOK on success or an error code on failure. 850 850 */ 851 errno_t block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset,851 int block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset, 852 852 size_t bytes, void *data) 853 853 { 854 errno_t rc;854 int rc; 855 855 size_t phys_block_size; 856 856 size_t buf_size; … … 901 901 * 902 902 */ 903 errno_t block_read_toc(service_id_t service_id, uint8_t session, void *buf,903 int block_read_toc(service_id_t service_id, uint8_t session, void *buf, 904 904 size_t bufsize) 905 905 { … … 919 919 * @return EOK on success or an error code on failure. 920 920 */ 921 static errno_t read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf,921 static int read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf, 922 922 size_t size) 923 923 { 924 924 assert(devcon); 925 925 926 errno_t rc = bd_read_blocks(devcon->bd, ba, cnt, buf, size);926 int rc = bd_read_blocks(devcon->bd, ba, cnt, buf, size); 927 927 if (rc != EOK) { 928 928 printf("Error %s reading %zu blocks starting at block %" PRIuOFF64 … … 946 946 * @return EOK on success or an error code on failure. 947 947 */ 948 static errno_t write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data,948 static int write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data, 949 949 size_t size) 950 950 { 951 951 assert(devcon); 952 952 953 errno_t rc = bd_write_blocks(devcon->bd, ba, cnt, data, size);953 int rc = bd_write_blocks(devcon->bd, ba, cnt, data, size); 954 954 if (rc != EOK) { 955 955 printf("Error %s writing %zu blocks starting at block %" PRIuOFF64
Note:
See TracChangeset
for help on using the changeset viewer.