Changeset 498ced1 in mainline for uspace/srv/volsrv
- 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/volsrv
- Files:
-
- 4 edited
-
part.c (modified) (3 diffs)
-
types/part.h (modified) (2 diffs)
-
types/volume.h (modified) (2 diffs)
-
volume.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/part.c
rb13d80b r498ced1 179 179 } 180 180 181 atomic_set(&part->refcnt, 1);181 refcount_init(&part->refcnt); 182 182 link_initialize(&part->lparts); 183 183 part->parts = NULL; … … 524 524 if (part->svc_id == sid) { 525 525 /* Add reference */ 526 atomic_inc(&part->refcnt);526 refcount_up(&part->refcnt); 527 527 *rpart = part; 528 528 return EOK; … … 547 547 void vol_part_del_ref(vol_part_t *part) 548 548 { 549 if ( atomic_predec(&part->refcnt) == 0)549 if (refcount_down(&part->refcnt)) 550 550 vol_part_delete(part); 551 551 } -
uspace/srv/volsrv/types/part.h
rb13d80b r498ced1 39 39 40 40 #include <adt/list.h> 41 #include < atomic.h>41 #include <refcount.h> 42 42 #include <fibril_synch.h> 43 43 #include <stdbool.h> … … 51 51 link_t lparts; 52 52 /** Reference count */ 53 atomic_ t refcnt;53 atomic_refcount_t refcnt; 54 54 /** Service ID */ 55 55 service_id_t svc_id; -
uspace/srv/volsrv/types/volume.h
rb13d80b r498ced1 39 39 40 40 #include <adt/list.h> 41 #include < atomic.h>41 #include <refcount.h> 42 42 #include <fibril_synch.h> 43 43 #include <sif.h> … … 50 50 link_t lvolumes; 51 51 /** Reference count */ 52 atomic_ t refcnt;52 atomic_refcount_t refcnt; 53 53 /** Volume label */ 54 54 char *label; -
uspace/srv/volsrv/volume.c
rb13d80b r498ced1 83 83 } 84 84 85 atomic_set(&volume->refcnt, 1);85 refcount_init(&volume->refcnt); 86 86 link_initialize(&volume->lvolumes); 87 87 volume->volumes = NULL; … … 245 245 str_size(label) > 0) { 246 246 /* Add reference */ 247 atomic_inc(&volume->refcnt);247 refcount_up(&volume->refcnt); 248 248 *rvolume = volume; 249 249 return EOK; … … 309 309 void vol_volume_del_ref(vol_volume_t *volume) 310 310 { 311 if ( atomic_predec(&volume->refcnt) == 0) {311 if (refcount_down(&volume->refcnt)) { 312 312 /* No more references. Check if volume is persistent. */ 313 313 if (!vol_volume_is_persist(volume)) {
Note:
See TracChangeset
for help on using the changeset viewer.
