Ignore:
File:
1 edited

Legend:

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

    rc1f26834 rdd8b6a8  
    194194        if (devcon->cache)
    195195                (void) block_cache_fini(service_id);
     196       
     197        (void)bd_sync_cache(devcon->bd, 0, 0);
    196198       
    197199        devcon_remove(devcon);
     
    877879 *
    878880 * @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)
     881 * @return EOK on success or negative error code.
     882 *
     883 */
     884int block_read_toc(service_id_t service_id, uint8_t session, void *buf,
     885    size_t bufsize)
    883886{
    884887        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;
     888       
     889        assert(devcon);
     890        return bd_read_toc(devcon->bd, session, buf, bufsize);
    901891}
    902892
Note: See TracChangeset for help on using the changeset viewer.