Changeset 53e3950 in mainline for uspace/srv/bd/vbd/disk.c


Ignore:
Timestamp:
2016-02-18T17:01:49Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9e53406
Parents:
e11c527
Message:

libfdisk should not depend on libblock nor should it access the block devices directly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/vbd/disk.c

    re11c527 r53e3950  
    452452        bool block_inited = false;
    453453        size_t block_size;
     454        aoff64_t nblocks;
    454455        int rc;
    455456
     
    489490        }
    490491
     492        rc = block_get_nblocks(sid, &nblocks);
     493        if (rc != EOK) {
     494                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed getting number of "
     495                    "blocks of %s.", disk->svc_name);
     496                rc = EIO;
     497                goto error;
     498        }
     499
    491500        block_inited = true;
    492501
     
    502511        disk->label = label;
    503512        disk->block_size = block_size;
     513        disk->nblocks = nblocks;
    504514        disk->present = true;
    505515
     
    598608        info->anblocks = linfo.anblocks;
    599609        info->block_size = disk->block_size;
     610        info->nblocks = disk->nblocks;
    600611        log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_disk_info - block_size=%zu",
    601612            info->block_size);
Note: See TracChangeset for help on using the changeset viewer.