Re: Storage Interface for squid

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 2 Jun 2002 14:12:21 +0200

In the "ufs" family of cache stores:

  D1 = (N / L2 / L2) % L1
  D2 = (N / L2) % L2

  path = sprintf("%2X/%2X/%8X", D1, D2, N);

L1 and L2 is the parameters from the cache_dir ufs/aufs/diskd line.

But I stronly advice you to ditch this scheme if considering
implementing a filesystem properly designed for caching. This scheme
is only a bandaid to at all be able to run the cache ontop of a
generic UNIX UFS like filesystem..

Regards
Henrik

On Friday 31 May 2002 19:14, Meghna Dhar wrote:
> Thanks Henrik for the prompt help. I did go through the Programmers
> Guide for the Storage Interface. I can now understand how
> directories are assigned. But I still cant understand how file
> numbers are mapped to the path. Like the way you said file number 0
> maps to 00/00/00000000. Could you please elaborate this conversion?
> Thanks once again,
> Meghna
>
> -----Original Message-----
> From: Henrik Nordstrom [mailto:hno@marasystems.com]
> Sent: Friday, May 31, 2002 1:06 PM
> To: mdhar@ECECS.UC.EDU
> Cc: Squid Developers
> Subject: Re: Storage Interface for squid
>
> Actually Squid is using an integer assigned by the storage layer to
> identify
> the object.. (currently 24 bits in size).
>
> for the "ufs" type of storage layers (ufs, diskd, aufs) this
> integer is directly mapped to files in directories. File number 0
> is
> 00/00/00000000, 1
> is 00/00/00000001 etc..
>
> for the "coss" storage layer, it is mapped to a block offset within
> the coss
> area (one large file).
>
> and a number of other possibilities are possible, basically up to
> the storage
> layer how it uses this integer.
>
> See the programmers guide on what is required to write a storage
> layer for
> Squid.
>
> Which cache_dir to use for a given file is assigned based on a
> combination of
> the amount of free space reported by the storage layer and
> round-robin.
>
> Regards
> Henrik
>
> Meghna Dhar wrote:
> > Hi Henrik,
> >
> > I am writing a proxy server file system. I need to know what
> > naming convention does squid use for its directories and files ?
> >
> > What I know is that there is a top level directory and then L1
> > with 16 dirs and L2 with 256 dirs. I also know that files are put
> > either according to the Least Load on directory or using a Round
> > Robin. Could you please help me on this one ??
> >
> > Thanks,
> >
> > Meghna
Received on Sun Jun 02 2002 - 06:12:50 MDT

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