Changeset 978ccaf1 in mainline for uspace/app/bithenge/file.c
- Timestamp:
- 2012-06-27T03:35:43Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 600f5d1
- Parents:
- 04a7435f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/file.c
r04a7435f r978ccaf1 55 55 } file_blob_t; 56 56 57 static inline file_blob_t * file_from_blob(bithenge_blob_t *base)57 static inline file_blob_t *blob_as_file(bithenge_blob_t *base) 58 58 { 59 59 return (file_blob_t *)base; 60 60 } 61 61 62 static inline bithenge_blob_t * blob_from_file(file_blob_t *blob)62 static inline bithenge_blob_t *file_as_blob(file_blob_t *blob) 63 63 { 64 64 return &blob->base; … … 67 67 static int file_size(bithenge_blob_t *base, aoff64_t *size) 68 68 { 69 file_blob_t *blob = file_from_blob(base);69 file_blob_t *blob = blob_as_file(base); 70 70 *size = blob->size; 71 71 return EOK; … … 75 75 aoff64_t *size) 76 76 { 77 file_blob_t *blob = file_from_blob(base);77 file_blob_t *blob = blob_as_file(base); 78 78 if (offset > blob->size) 79 79 return ELIMIT; … … 95 95 } 96 96 97 static intfile_destroy(bithenge_blob_t *base)97 static void file_destroy(bithenge_blob_t *base) 98 98 { 99 file_blob_t *blob = file_from_blob(base);99 file_blob_t *blob = blob_as_file(base); 100 100 close(blob->fd); 101 101 free(blob); 102 return EOK;103 102 } 104 103 … … 128 127 return ENOMEM; 129 128 } 130 rc = bithenge_new_random_access_blob(blob_from_file(blob), 131 &file_ops); 129 rc = bithenge_init_random_access_blob(file_as_blob(blob), &file_ops); 132 130 if (rc != EOK) { 133 131 free(blob); … … 143 141 #endif 144 142 blob->needs_close = needs_close; 145 *out = bithenge_blob_as_node( blob_from_file(blob));143 *out = bithenge_blob_as_node(file_as_blob(blob)); 146 144 147 145 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.