Esempio n. 1
0
static void ntfs_restore_rl(ntfs_attr *na, runlist_element *oldrl)
{
	runlist_element *brl; /* Pointer to bad runlist */
	runlist_element *grl; /* Pointer to good runlist */
	ntfs_volume *vol;

	vol = na->ni->vol;
		/* Examine allocated entries from the bad runlist */
	for (brl=na->rl; brl->length; brl++) {
		if (brl->lcn != LCN_HOLE) {
// TODO improve by examining both list in parallel
		/* Find the holes in the good runlist which overlap */
			for (grl=oldrl; grl->length
			   && (grl->vcn<=(brl->vcn+brl->length)); grl++) {
				if (grl->lcn == LCN_HOLE) {
					free_common(vol, brl, brl->length, grl,
						grl->length);
				}
			}
			/* Free allocations beyond the end of good runlist */
			if (grl && !grl->length
			    && ((brl->vcn + brl->length) > grl->vcn)) {
				free_common(vol, brl, brl->length, grl,
					brl->vcn + brl->length - grl->vcn);
			}
		}
	}
	free(na->rl);
	na->rl = oldrl;
	if (ntfs_attr_update_mapping_pairs(na, 0)) {
		ntfs_log_error("Failed to restore the original runlist\n");
	}
}
Esempio n. 2
0
void iTCOWatchdog::systemWillShutdown(IOOptionBits spec)
{
    DbgPrint(drvid, "%s: spec = %#x\n", __FUNCTION__, spec);
    
    switch (spec) {
        case kIOMessageSystemWillRestart:
        case kIOMessageSystemWillPowerOff:
            free_common();
        break;
    }
    
    super::systemWillShutdown(spec);
}
Esempio n. 3
0
    void
    GCache::free (void* ptr)
    {
        if (gu_likely(0 != ptr))
        {
            BufferHeader* const bh(ptr2BH(ptr));
            gu::Lock      lock(mtx);

            free_common (bh);
        }
        else {
            log_warn << "Attempt to free a null pointer";
            assert(0);
        }
    }
Esempio n. 4
0
void iTCOWatchdog::free(void)
{    
    DbgPrint(drvid, "free\n");
    
    free_common();
    
    if (GCSMem.map) GCSMem.map->release();
    if (GCSMem.range) GCSMem.range->release();
    
    LPCNub->close(this);
    LPCNub->release();
    
    PMstop();
    
    IOSimpleLockFree(lock);

    super::free();
}