Changeset 743ce51 in mainline for uspace/app/bithenge/block.c
- Timestamp:
- 2012-05-25T03:49:21Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1923501
- Parents:
- a54bd98
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/block.c
ra54bd98 r743ce51 36 36 */ 37 37 38 #include <assert.h> 38 39 #include <errno.h> 39 40 #include <libblock.h> … … 50 51 } block_blob_t; 51 52 52 static int block_size(bithenge_blob_t *base, aoff64_t *size) { 53 static int block_size(bithenge_blob_t *base, aoff64_t *size) 54 { 53 55 block_blob_t *blob = (block_blob_t *)base; 54 56 *size = blob->size; … … 56 58 } 57 59 58 static int block_read(bithenge_blob_t *base, aoff64_t offset, char *buffer, aoff64_t *size) { 60 static int block_read(bithenge_blob_t *base, aoff64_t offset, char *buffer, 61 aoff64_t *size) 62 { 59 63 block_blob_t *blob = (block_blob_t *)base; 60 64 if (offset > blob->size) … … 64 68 } 65 69 66 static int block_destroy(bithenge_blob_t *base) { 70 static int block_destroy(bithenge_blob_t *base) 71 { 67 72 block_blob_t *blob = (block_blob_t *)base; 68 73 block_fini(blob->service_id); … … 82 87 * @param service_id The service ID of the block device. 83 88 * @return EOK on success or an error code from errno.h. */ 84 int bithenge_new_block_blob(bithenge_blob_t **out, service_id_t service_id) { 89 int bithenge_new_block_blob(bithenge_blob_t **out, service_id_t service_id) 90 { 91 assert(out); 92 85 93 // Initialize libblock 86 94 int rc; … … 104 112 block_blob_t *blob = malloc(sizeof(*blob)); 105 113 if (!blob) 106 return errno;114 return ENOMEM; 107 115 rc = bithenge_new_random_access_blob(&blob->base, &block_ops); 108 116 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.