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

    rb13d80b r498ced1  
    8383        }
    8484
    85         atomic_set(&volume->refcnt, 1);
     85        refcount_init(&volume->refcnt);
    8686        link_initialize(&volume->lvolumes);
    8787        volume->volumes = NULL;
     
    245245                    str_size(label) > 0) {
    246246                        /* Add reference */
    247                         atomic_inc(&volume->refcnt);
     247                        refcount_up(&volume->refcnt);
    248248                        *rvolume = volume;
    249249                        return EOK;
     
    309309void vol_volume_del_ref(vol_volume_t *volume)
    310310{
    311         if (atomic_predec(&volume->refcnt) == 0) {
     311        if (refcount_down(&volume->refcnt)) {
    312312                /* No more references. Check if volume is persistent. */
    313313                if (!vol_volume_is_persist(volume)) {
Note: See TracChangeset for help on using the changeset viewer.