Re: Re: Swap Compression

From: Jörn Engel (joern@wohnheim.fh-wedel.de)
Date: Sun Apr 27 2003 - 04:04:18 EST


On Sat, 26 April 2003 22:24:04 -0400, rmoser wrote:
>
> So what's the best way to do this? I was originally thinking like this:
>
> Grab some swap data
> Stuff it into fcomp_push()
> When you have 100k of data, seal it up
> Write that 100k block

I would like something like this:

/* fox_compress
 * @input: Pointer to uncompressed data
 * @output: Pointer to buffer
 * @inlen: Size of uncompressed data
 * @outlen: Size of the buffer
 *
 * Return:
 * 0 on successful compression
 * -Esomething on error
 *
 * Side effects:
 * Output buffer is filled with random data after an error
 * condition or the compressed input data on success.
 * outlen remains unchanged on error and holds the compressed
 * data size on success
 *
 * If the output buffer is too small, this is an error.
 */
int fox_compress(unsigned char *input, unsigned char *output,
                uint32_t inlen, uint32_t *outlen);

/* fox_decompress
 * see above, basically
 */
int fox_decompress(unsigned char *input, unsigned char *output,
                uint32_t inlen, uint32_t *outlen);

Then the mm code can pick any useful size for compression.

Jörn

-- 
My second remark is that our intellectual powers are rather geared to
master static relations and that our powers to visualize processes
evolving in time are relatively poorly developed.
-- Edsger W. Dijkstra
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:25 EST