Re: post modio

From: Duane Wessels <wessels@dont-contact.us>
Date: Mon, 15 May 2000 17:33:14 -0600

On Sun, 14 May 2000, Adrian Chadd wrote:
 
> Hrm. Thats what I had initially for callback and sync due to AUFS. If
> people think that having sync and callback per-fs type rather than per-fs
> instance then I'll go through and change the API back. If we do this then
> it'll be up to the fs code to maintain a list of swapdirs of their type,
> or they have to walk the swapDir array and strcmp("type", SD->type) to
> figure out whether is a swapdir of theirs.

I think maybe all you have to do is change storeDirCallback,
and the return value of STCALLBACK:

/*
 * handle callbacks all avaliable fs'es ..
 */
void
storeDirCallback(void)
{
    int i;
    SwapDir *SD;
    static int ndir = 0;
    do {
        j = 0;
        for (i = 0; i < Config.cacheSwap.n_configured; i++) {
            if (ndir >= Config.cacheSwap.n_configured)
                ndir = ndir % Config.cacheSwap.n_configured;
            SD = &Config.cacheSwap.swapDirs[ndir++];
            if (NULL == SD->callback)
                continue;
            j += SD->callback(SD);
        }
    } while (j > 0);
    ndir++;
}

- SD->callback returns 1 if it did some work (processed
  an I/O event).
- SD->callback also returns 1 if its "queue" is full.
  Thus, we stay in the do loop if any one of the dirs
  needs to be "drained."
- The 'ndir' weirdness cycles the starting dir, so it
  doesn't always start with #0.
  
Received on Mon May 15 2000 - 17:33:21 MDT

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