Changes in uspace/srv/bd/rd/rd.c [b7fd2a0:1558d85] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/rd/rd.c

    rb7fd2a0 r1558d85  
    4848#include <stdbool.h>
    4949#include <errno.h>
    50 #include <str_error.h>
    5150#include <async.h>
    5251#include <fibril_synch.h>
     
    6766static const size_t block_size = 512;
    6867
    69 static errno_t rd_open(bd_srvs_t *, bd_srv_t *);
    70 static errno_t rd_close(bd_srv_t *);
    71 static errno_t rd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
    72 static errno_t rd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);
    73 static errno_t rd_get_block_size(bd_srv_t *, size_t *);
    74 static errno_t rd_get_num_blocks(bd_srv_t *, aoff64_t *);
     68static int rd_open(bd_srvs_t *, bd_srv_t *);
     69static int rd_close(bd_srv_t *);
     70static int rd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     71static int rd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);
     72static int rd_get_block_size(bd_srv_t *, size_t *);
     73static int rd_get_num_blocks(bd_srv_t *, aoff64_t *);
    7574
    7675/** This rwlock protects the ramdisk's data.
     
    10099
    101100/** Open device. */
    102 static errno_t rd_open(bd_srvs_t *bds, bd_srv_t *bd)
     101static int rd_open(bd_srvs_t *bds, bd_srv_t *bd)
    103102{
    104103        return EOK;
     
    106105
    107106/** Close device. */
    108 static errno_t rd_close(bd_srv_t *bd)
     107static int rd_close(bd_srv_t *bd)
    109108{
    110109        return EOK;
     
    112111
    113112/** Read blocks from the device. */
    114 static errno_t rd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf,
     113static int rd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt, void *buf,
    115114    size_t size)
    116115{
     
    128127
    129128/** Write blocks to the device. */
    130 static errno_t rd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt,
     129static int rd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt,
    131130    const void *buf, size_t size)
    132131{
     
    147146{
    148147        sysarg_t size;
    149         errno_t ret = sysinfo_get_value("rd.size", &size);
     148        int ret = sysinfo_get_value("rd.size", &size);
    150149        if ((ret != EOK) || (size == 0)) {
    151150                printf("%s: No RAM disk found\n", NAME);
     
    180179        ret = loc_server_register(NAME);
    181180        if (ret != EOK) {
    182                 printf("%s: Unable to register driver: %s\n", NAME, str_error(ret));
     181                printf("%s: Unable to register driver (%d)\n", NAME, ret);
    183182                return false;
    184183        }
     
    197196
    198197/** Get device block size. */
    199 static errno_t rd_get_block_size(bd_srv_t *bd, size_t *rsize)
     198static int rd_get_block_size(bd_srv_t *bd, size_t *rsize)
    200199{
    201200        *rsize = block_size;
     
    204203
    205204/** Get number of blocks on device. */
    206 static errno_t rd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)
     205static int rd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)
    207206{
    208207        *rnb = rd_size / block_size;
Note: See TracChangeset for help on using the changeset viewer.