Changeset b7fd2a0 in mainline for uspace/srv/bd/file_bd/file_bd.c
- Timestamp:
- 2018-01-13T03:10:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/file_bd/file_bd.c
r36f0738 rb7fd2a0 66 66 67 67 static void print_usage(void); 68 static int file_bd_init(const char *fname);68 static errno_t file_bd_init(const char *fname); 69 69 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *); 70 70 71 static int file_bd_open(bd_srvs_t *, bd_srv_t *);72 static int file_bd_close(bd_srv_t *);73 static int file_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);74 static int file_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);75 static int file_bd_get_block_size(bd_srv_t *, size_t *);76 static int file_bd_get_num_blocks(bd_srv_t *, aoff64_t *);71 static errno_t file_bd_open(bd_srvs_t *, bd_srv_t *); 72 static errno_t file_bd_close(bd_srv_t *); 73 static errno_t file_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); 74 static errno_t file_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t); 75 static errno_t file_bd_get_block_size(bd_srv_t *, size_t *); 76 static errno_t file_bd_get_num_blocks(bd_srv_t *, aoff64_t *); 77 77 78 78 static bd_ops_t file_bd_ops = { … … 87 87 int main(int argc, char **argv) 88 88 { 89 int rc;89 errno_t rc; 90 90 char *image_name; 91 91 char *device_name; … … 166 166 } 167 167 168 static int file_bd_init(const char *fname)168 static errno_t file_bd_init(const char *fname) 169 169 { 170 170 bd_srvs_init(&bd_srvs); … … 172 172 173 173 async_set_fallback_port_handler(file_bd_connection, NULL); 174 int rc = loc_server_register(NAME);174 errno_t rc = loc_server_register(NAME); 175 175 if (rc != EOK) { 176 176 printf("%s: Unable to register driver.\n", NAME); … … 206 206 207 207 /** Open device. */ 208 static int file_bd_open(bd_srvs_t *bds, bd_srv_t *bd)208 static errno_t file_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 209 209 { 210 210 return EOK; … … 212 212 213 213 /** Close device. */ 214 static int file_bd_close(bd_srv_t *bd)214 static errno_t file_bd_close(bd_srv_t *bd) 215 215 { 216 216 return EOK; … … 218 218 219 219 /** Read blocks from the device. */ 220 static int file_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf,220 static errno_t file_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf, 221 221 size_t size) 222 222 { … … 258 258 259 259 /** Write blocks to the device. */ 260 static int file_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt,260 static errno_t file_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, 261 261 const void *buf, size_t size) 262 262 { … … 300 300 301 301 /** Get device block size. */ 302 static int file_bd_get_block_size(bd_srv_t *bd, size_t *rsize)302 static errno_t file_bd_get_block_size(bd_srv_t *bd, size_t *rsize) 303 303 { 304 304 *rsize = block_size; … … 307 307 308 308 /** Get number of blocks on device. */ 309 static int file_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)309 static errno_t file_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb) 310 310 { 311 311 *rnb = num_blocks;
Note:
See TracChangeset
for help on using the changeset viewer.