Changeset 46577995 in mainline for uspace/srv/bd/file_bd/file_bd.c
- Timestamp:
- 2018-01-04T20:50:52Z (6 years ago)
- Children:
- e211ea04
- Parents:
- facacc71
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/file_bd/file_bd.c
rfacacc71 r46577995 67 67 68 68 static void print_usage(void); 69 static int file_bd_init(const char *fname);69 static errno_t file_bd_init(const char *fname); 70 70 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *); 71 71 72 static int file_bd_open(bd_srvs_t *, bd_srv_t *);73 static int file_bd_close(bd_srv_t *);74 static int file_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);75 static int file_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);76 static int file_bd_get_block_size(bd_srv_t *, size_t *);77 static int file_bd_get_num_blocks(bd_srv_t *, aoff64_t *);72 static errno_t file_bd_open(bd_srvs_t *, bd_srv_t *); 73 static errno_t file_bd_close(bd_srv_t *); 74 static errno_t file_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); 75 static errno_t file_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t); 76 static errno_t file_bd_get_block_size(bd_srv_t *, size_t *); 77 static errno_t file_bd_get_num_blocks(bd_srv_t *, aoff64_t *); 78 78 79 79 static bd_ops_t file_bd_ops = { … … 88 88 int main(int argc, char **argv) 89 89 { 90 int rc;90 errno_t rc; 91 91 char *image_name; 92 92 char *device_name; … … 167 167 } 168 168 169 static int file_bd_init(const char *fname)169 static errno_t file_bd_init(const char *fname) 170 170 { 171 171 bd_srvs_init(&bd_srvs); … … 173 173 174 174 async_set_fallback_port_handler(file_bd_connection, NULL); 175 int rc = loc_server_register(NAME);175 errno_t rc = loc_server_register(NAME); 176 176 if (rc != EOK) { 177 177 printf("%s: Unable to register driver.\n", NAME); … … 207 207 208 208 /** Open device. */ 209 static int file_bd_open(bd_srvs_t *bds, bd_srv_t *bd)209 static errno_t file_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 210 210 { 211 211 return EOK; … … 213 213 214 214 /** Close device. */ 215 static int file_bd_close(bd_srv_t *bd)215 static errno_t file_bd_close(bd_srv_t *bd) 216 216 { 217 217 return EOK; … … 219 219 220 220 /** Read blocks from the device. */ 221 static int file_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf,221 static errno_t file_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf, 222 222 size_t size) 223 223 { … … 259 259 260 260 /** Write blocks to the device. */ 261 static int file_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt,261 static errno_t file_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, 262 262 const void *buf, size_t size) 263 263 { … … 301 301 302 302 /** Get device block size. */ 303 static int file_bd_get_block_size(bd_srv_t *bd, size_t *rsize)303 static errno_t file_bd_get_block_size(bd_srv_t *bd, size_t *rsize) 304 304 { 305 305 *rsize = block_size; … … 308 308 309 309 /** Get number of blocks on device. */ 310 static int file_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)310 static errno_t file_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb) 311 311 { 312 312 *rnb = num_blocks;
Note:
See TracChangeset
for help on using the changeset viewer.