Changeset 3abf70c7 in mainline for uspace/lib/block/block.c


Ignore:
Timestamp:
2014-08-16T22:33:41Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
da79df42
Parents:
35b8bfe
Message:

libblock is not the best place to define SCSI structures.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/block/block.c

    r35b8bfe r3abf70c7  
    877877 *
    878878 * @return Allocated TOC structure.
    879  * @return NULL on failure.
    880  *
    881  */
    882 toc_block_t *block_get_toc(service_id_t service_id, uint8_t session)
     879 * @return EOK on success or negative error code.
     880 *
     881 */
     882int block_read_toc(service_id_t service_id, uint8_t session, void *buf,
     883    size_t bufsize)
    883884{
    884885        devcon_t *devcon = devcon_search(service_id);
    885         toc_block_t *toc = NULL;
    886         int rc;
    887        
    888         assert(devcon);
    889        
    890         toc = (toc_block_t *) malloc(sizeof(toc_block_t));
    891         if (toc == NULL)
    892                 return NULL;
    893        
    894         rc = bd_read_toc(devcon->bd, session, toc, sizeof(toc_block_t));
    895         if (rc != EOK) {
    896                 free(toc);
    897                 return NULL;
    898         }
    899        
    900         return toc;
     886       
     887        assert(devcon);
     888        return bd_read_toc(devcon->bd, session, buf, bufsize);
    901889}
    902890
Note: See TracChangeset for help on using the changeset viewer.