Re: kernel read/write question

From: Riley Williams (rhw@MemAlpha.CX)
Date: Sat Feb 05 2000 - 18:02:54 EST


Hi Christopher.

> I would like to thank Stephen, Laslo and Andreas for the links
> and info about e2compr, but I already knew about the patch.

> If I understand the patch correcly, it works by setting a
> permission bit to determine if a file is to be compressed, and
> if the file is a directory, then all new files are compressed
> (if I'm wrong, let me know).

I use the patch in question, and can confirm that it does far more
than that. What basically happens is that the user runs, for
example...

        chattr -R -V +c /usr/src

...which causes the `chattr` command to recursively descend from
/usr/src/ telling the kernel to set the +c attribute on every file and
directory it finds, and verbosely tells you what it's doing whilst
it's at it.

Each time the kernel is asked to set the +c attribute on a file that
doesn't already have that attribute set, it promptly compresses it
using the currently specified compression method, and blocks until the
compression is finished.

Likewise, if you specify -c instead of +c then as the kernel clears
the said flag, it also decompresses the file.

> My intention is to mount a filesystem where everything is
> compressed, except for the files already compressed.

I'm not even sure what you mean by that, so can hardly comment
thereon.

> An example would be a directory or file move and having it
> already compressed without having to set additional bits...

If the target directory has the +c attribute set, that happens
automatically, even if it wasn't compressed in the directory it's
being moved from.

> ...or remembering to set the compression bit each time I mount a
> disk.

You don't have to do that now - once set, it remains set across
mount/umount/reboot until somebody explicitly clears it.

> I'm not sure if that helps any.

I would suspect that you haven't even tried the patch, and would
suggest you do so, and then clarify your comments if I've
misunderstood them...

Best wishes from Riley.

 * Copyright (C) 1999, Memory Alpha Systems.
 * All rights and wrongs reserved.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
 * http://www.memalpha.cx/Linux/Kernel/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:12 EST