Changeset 498ced1 in mainline for uspace/srv/volsrv/part.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/volsrv/part.c

    rb13d80b r498ced1  
    179179        }
    180180
    181         atomic_set(&part->refcnt, 1);
     181        refcount_init(&part->refcnt);
    182182        link_initialize(&part->lparts);
    183183        part->parts = NULL;
     
    524524                if (part->svc_id == sid) {
    525525                        /* Add reference */
    526                         atomic_inc(&part->refcnt);
     526                        refcount_up(&part->refcnt);
    527527                        *rpart = part;
    528528                        return EOK;
     
    547547void vol_part_del_ref(vol_part_t *part)
    548548{
    549         if (atomic_predec(&part->refcnt) == 0)
     549        if (refcount_down(&part->refcnt))
    550550                vol_part_delete(part);
    551551}
Note: See TracChangeset for help on using the changeset viewer.