Re: swap file number

From: Chengdu Huang <chuang@dont-contact.us>
Date: Sun, 30 Mar 2003 00:23:38 -0500 (EST)

> > > Squid knows if there is clients currently reading the (possibly old)
> > > object, and it won't be deleted in such case until those clients are
> > > done.
> >
> > Is that tracked by entry->mem_obj->clients?
>
> No, by storeLock/UnlockObject.
>
storeUnlockObject may trigger storeRelease. Below is from
storeRelease:

    if (e->swap_file_number > -1) {
        storeUnlink(e->swap_file_number);
        storeDirMapBitReset(e->swap_file_number);
        if (e->swap_status == SWAPOUT_DONE)
            if (EBIT_TEST(e->flags, ENTRY_VALIDATED))
                storeDirUpdateSwapSize(e->swap_file_number,
                                       e->swap_file_sz, -1);
        if (!EBIT_TEST(e->flags, KEY_PRIVATE))
            storeDirSwapLog(e, SWAP_LOG_DEL);
    }

This only remove the file with file number e->swap_file_number. How
about the old swap files? They have no StoreEntries associated with
them and therefore will not be deleted here. So when/where will they
be deleted? Thanks.

--
Chengdu
Received on Sun Mar 30 2003 - 02:19:16 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:35 MST