Changeset 498ced1 in mainline for uspace/srv/bd
- Timestamp:
- 2018-08-11T02:43:32Z (7 years ago)
- 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)
- Location:
- uspace/srv/bd/vbd
- Files:
-
- 2 edited
-
disk.c (modified) (3 diffs)
-
types/vbd.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/vbd/disk.c
rb13d80b r498ced1 244 244 { 245 245 log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_part_add_ref"); 246 atomic_inc(&part->refcnt);246 refcount_up(&part->refcnt); 247 247 } 248 248 … … 250 250 { 251 251 log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_part_del_ref"); 252 if ( atomic_predec(&part->refcnt) == 0) {252 if (refcount_down(&part->refcnt)) { 253 253 log_msg(LOG_DEFAULT, LVL_DEBUG2, " - free part"); 254 254 free(part); … … 328 328 part->block0 = lpinfo.block0; 329 329 part->nblocks = lpinfo.nblocks; 330 atomic_set(&part->refcnt, 1);330 refcount_init(&part->refcnt); 331 331 332 332 bd_srvs_init(&part->bds); -
uspace/srv/bd/vbd/types/vbd.h
rb13d80b r498ced1 39 39 40 40 #include <adt/list.h> 41 #include <atomic.h>42 41 #include <bd_srv.h> 43 42 #include <label/label.h> 44 43 #include <loc.h> 44 #include <refcount.h> 45 45 #include <stdbool.h> 46 46 #include <stddef.h> … … 83 83 aoff64_t nblocks; 84 84 /** Reference count */ 85 atomic_ t refcnt;85 atomic_refcount_t refcnt; 86 86 } vbds_part_t; 87 87
Note:
See TracChangeset
for help on using the changeset viewer.
