Changeset 978ccaf1 in mainline for uspace/app/bithenge/file.c


Ignore:
Timestamp:
2012-06-27T03:35:43Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
600f5d1
Parents:
04a7435f
Message:

Bithenge: various cleanup and tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bithenge/file.c

    r04a7435f r978ccaf1  
    5555} file_blob_t;
    5656
    57 static inline file_blob_t *file_from_blob(bithenge_blob_t *base)
     57static inline file_blob_t *blob_as_file(bithenge_blob_t *base)
    5858{
    5959        return (file_blob_t *)base;
    6060}
    6161
    62 static inline bithenge_blob_t *blob_from_file(file_blob_t *blob)
     62static inline bithenge_blob_t *file_as_blob(file_blob_t *blob)
    6363{
    6464        return &blob->base;
     
    6767static int file_size(bithenge_blob_t *base, aoff64_t *size)
    6868{
    69         file_blob_t *blob = file_from_blob(base);
     69        file_blob_t *blob = blob_as_file(base);
    7070        *size = blob->size;
    7171        return EOK;
     
    7575    aoff64_t *size)
    7676{
    77         file_blob_t *blob = file_from_blob(base);
     77        file_blob_t *blob = blob_as_file(base);
    7878        if (offset > blob->size)
    7979                return ELIMIT;
     
    9595}
    9696
    97 static int file_destroy(bithenge_blob_t *base)
     97static void file_destroy(bithenge_blob_t *base)
    9898{
    99         file_blob_t *blob = file_from_blob(base);
     99        file_blob_t *blob = blob_as_file(base);
    100100        close(blob->fd);
    101101        free(blob);
    102         return EOK;
    103102}
    104103
     
    128127                return ENOMEM;
    129128        }
    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);
    132130        if (rc != EOK) {
    133131                free(blob);
     
    143141#endif
    144142        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));
    146144
    147145        return EOK;
Note: See TracChangeset for help on using the changeset viewer.