Exemple #1
0
/**
 * delete an entry from the volume group cache.
 *
 * If partition is scanning, actually puts the entry on a list of entries
 * to delete when the scan is done.
 *
 * @param[in] dp       disk partition object
 * @param[in] parent   parent volume id
 * @param[in] child    child volume id
 *
 * @pre VOL_LOCK held
 *
 * @return operation status
 *    @retval 0 success
 */
int
VVGCache_entry_del_r(struct DiskPartition64 * dp,
		     VolumeId parent, VolumeId child)
{
    if (VVGCache.part[dp->index].state == VVGC_PART_STATE_UPDATING) {
	int code;
	code = _VVGC_dlist_add_r(dp, parent, child);
	if (code) {
	    return code;
	}
    }
    return _VVGC_entry_purge_r(dp, parent, child);
}
Exemple #2
0
/**
 * delete all of the entries in the dlist from the VGC.
 *
 * Traverses the to-delete list for the specified partition, and deletes
 * the specified entries from the global VGC. Also deletes the entries from
 * the dlist itself as it goes along.
 *
 * @param[in] dp  the partition whose dlist we are flushing
 */
static void
_VVGC_flush_dlist(struct DiskPartition64 *dp)
{
    int i;
    VVGCache_dlist_entry_t *ent, *nent;

    for (i = 0; i < VolumeHashTable.Size; i++) {
	for (queue_Scan(&VVGCache.part[dp->index].dlist_hash_buckets[i],
	                ent, nent,
	                VVGCache_dlist_entry)) {

	    _VVGC_entry_purge_r(dp, ent->parent, ent->child);
	    queue_Remove(ent);
	    free(ent);
	}
    }
}