Changeset 498ced1 in mainline for uspace/srv/bd/vbd/disk.c


Ignore:
Timestamp:
2018-08-11T02:43:32Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
05882233
Parents:
b13d80b
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-11 02:29:02)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-11 02:43:32)
Message:

Unify reference counting and remove some unnecessary instances of <atomic.h>

File:
1 edited

Legend:

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

    rb13d80b r498ced1  
    244244{
    245245        log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_part_add_ref");
    246         atomic_inc(&part->refcnt);
     246        refcount_up(&part->refcnt);
    247247}
    248248
     
    250250{
    251251        log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_part_del_ref");
    252         if (atomic_predec(&part->refcnt) == 0) {
     252        if (refcount_down(&part->refcnt)) {
    253253                log_msg(LOG_DEFAULT, LVL_DEBUG2, " - free part");
    254254                free(part);
     
    328328        part->block0 = lpinfo.block0;
    329329        part->nblocks = lpinfo.nblocks;
    330         atomic_set(&part->refcnt, 1);
     330        refcount_init(&part->refcnt);
    331331
    332332        bd_srvs_init(&part->bds);
Note: See TracChangeset for help on using the changeset viewer.