Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/block/block.c

    rb7fd2a0 rcde999a  
    8888} devcon_t;
    8989
    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);
     90static int read_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);
     91static int write_blocks(devcon_t *, aoff64_t, size_t, void *, size_t);
    9292static aoff64_t ba_ltop(devcon_t *, aoff64_t);
    9393
     
    107107}
    108108
    109 static errno_t devcon_add(service_id_t service_id, async_sess_t *sess,
     109static int devcon_add(service_id_t service_id, async_sess_t *sess,
    110110    size_t bsize, aoff64_t dev_size, bd_t *bd)
    111111{
     
    146146}
    147147
    148 errno_t block_init(service_id_t service_id, size_t comm_size)
     148int block_init(service_id_t service_id, size_t comm_size)
    149149{
    150150        bd_t *bd;
     
    156156        }
    157157       
    158         errno_t rc = bd_open(sess, &bd);
     158        int rc = bd_open(sess, &bd);
    159159        if (rc != EOK) {
    160160                async_hangup(sess);
     
    209209}
    210210
    211 errno_t block_bb_read(service_id_t service_id, aoff64_t ba)
     211int block_bb_read(service_id_t service_id, aoff64_t ba)
    212212{
    213213        void *bb_buf;
    214         errno_t rc;
     214        int rc;
    215215
    216216        devcon_t *devcon = devcon_search(service_id);
     
    270270};
    271271
    272 errno_t block_cache_init(service_id_t service_id, size_t size, unsigned blocks,
     272int block_cache_init(service_id_t service_id, size_t size, unsigned blocks,
    273273    enum cache_mode mode)
    274274{
     
    307307}
    308308
    309 errno_t block_cache_fini(service_id_t service_id)
     309int block_cache_fini(service_id_t service_id)
    310310{
    311311        devcon_t *devcon = devcon_search(service_id);
    312312        cache_t *cache;
    313         errno_t rc;
     313        int rc;
    314314
    315315        if (!devcon)
     
    383383 * @return                      EOK on success or an error code.
    384384 */
    385 errno_t block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags)
     385int block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags)
    386386{
    387387        devcon_t *devcon;
     
    390390        link_t *link;
    391391        aoff64_t p_ba;
    392         errno_t rc;
     392        int rc;
    393393       
    394394        devcon = devcon_search(service_id);
     
    580580 * @return              EOK on success or an error code.
    581581 */
    582 errno_t block_put(block_t *block)
     582int block_put(block_t *block)
    583583{
    584584        devcon_t *devcon = devcon_search(block->service_id);
     
    586586        unsigned blocks_cached;
    587587        enum cache_mode mode;
    588         errno_t rc = EOK;
     588        int rc = EOK;
    589589
    590590        assert(devcon);
     
    701701 * @return              EOK on success or an error code on failure.
    702702 */
    703 errno_t block_seqread(service_id_t service_id, void *buf, size_t *bufpos,
     703int block_seqread(service_id_t service_id, void *buf, size_t *bufpos,
    704704    size_t *buflen, aoff64_t *pos, void *dst, size_t size)
    705705{
     
    735735                if (*bufpos == *buflen) {
    736736                        /* Refill the communication buffer with a new block. */
    737                         errno_t rc;
     737                        int rc;
    738738
    739739                        rc = read_blocks(devcon, *pos / block_size, 1, buf,
     
    760760 * @return              EOK on success or an error code on failure.
    761761 */
    762 errno_t block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf)
     762int block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf)
    763763{
    764764        devcon_t *devcon;
     
    779779 * @return              EOK on success or an error code on failure.
    780780 */
    781 errno_t block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt,
     781int block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt,
    782782    const void *data)
    783783{
     
    798798 * @return              EOK on success or an error code on failure.
    799799 */
    800 errno_t block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)
     800int block_sync_cache(service_id_t service_id, aoff64_t ba, size_t cnt)
    801801{
    802802        devcon_t *devcon;
     
    815815 * @return              EOK on success or an error code on failure.
    816816 */
    817 errno_t block_get_bsize(service_id_t service_id, size_t *bsize)
     817int block_get_bsize(service_id_t service_id, size_t *bsize)
    818818{
    819819        devcon_t *devcon;
     
    832832 * @return              EOK on success or an error code on failure.
    833833 */
    834 errno_t block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)
     834int block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)
    835835{
    836836        devcon_t *devcon = devcon_search(service_id);
     
    849849 * @return              EOK on success or an error code on failure.
    850850 */
    851 errno_t block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset,
     851int block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset,
    852852    size_t bytes, void *data)
    853853{
    854         errno_t rc;
     854        int rc;
    855855        size_t phys_block_size;
    856856        size_t buf_size;
     
    901901 *
    902902 */
    903 errno_t block_read_toc(service_id_t service_id, uint8_t session, void *buf,
     903int block_read_toc(service_id_t service_id, uint8_t session, void *buf,
    904904    size_t bufsize)
    905905{
     
    919919 * @return              EOK on success or an error code on failure.
    920920 */
    921 static errno_t read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf,
     921static int read_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *buf,
    922922    size_t size)
    923923{
    924924        assert(devcon);
    925925       
    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);
    927927        if (rc != EOK) {
    928928                printf("Error %s reading %zu blocks starting at block %" PRIuOFF64
     
    946946 * @return              EOK on success or an error code on failure.
    947947 */
    948 static errno_t write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data,
     948static int write_blocks(devcon_t *devcon, aoff64_t ba, size_t cnt, void *data,
    949949    size_t size)
    950950{
    951951        assert(devcon);
    952952       
    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);
    954954        if (rc != EOK) {
    955955                printf("Error %s writing %zu blocks starting at block %" PRIuOFF64
Note: See TracChangeset for help on using the changeset viewer.