Changes in uspace/srv/volsrv/volume.c [9e45a41:63c1dd5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/volume.c
r9e45a41 r63c1dd5 96 96 static void vol_volume_delete(vol_volume_t *volume) 97 97 { 98 log_msg(LOG_DEFAULT, LVL_ DEBUG, "Freeing volume %p", volume);98 log_msg(LOG_DEFAULT, LVL_NOTE, "Freeing volume %p", volume); 99 99 100 100 free(volume->label); … … 219 219 { 220 220 assert(fibril_mutex_is_locked(&volumes->lock)); 221 log_msg(LOG_DEFAULT, LVL_ DEBUG, "vol_volume_add_locked(%p)", volume);221 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_volume_add_locked(%p)", volume); 222 222 223 223 volume->volumes = volumes; … … 367 367 if (refcount_down(&volume->refcnt)) { 368 368 /* No more references. Check if volume is persistent. */ 369 list_remove(&volume->lvolumes); 370 vol_volume_delete(volume); 369 if (!vol_volume_is_persist(volume)) { 370 list_remove(&volume->lvolumes); 371 vol_volume_delete(volume); 372 } 371 373 } 372 374 } … … 397 399 /* Volume is now persistent */ 398 400 if (volume->nvolume == NULL) { 399 /* Prevent volume from being freed */400 refcount_up(&volume->refcnt);401 402 401 /* Create volume node */ 403 402 rc = sif_trans_begin(volume->volumes->repo, &trans); … … 427 426 volume->nvolume = nvolume; 428 427 } else { 429 /* Allow volume to be freed */430 vol_volume_del_ref(volume);431 432 428 /* Update volume node */ 433 429 rc = sif_trans_begin(volume->volumes->repo, &trans);
Note:
See TracChangeset
for help on using the changeset viewer.