Re: [patch 12/16] fix race between writeback and unlink

Riley Williams
2002-07-07T20:36:17Z

Hi Linus.

> You can do it with direct disk access and knowledge of the FS
> internals, but it should not be all that hard to add some simple
> interface to get a "block usage byte array" kind of thing (more
> efficient than doing bmap on all files, _and_ can tell about blocks
> reserved for inodes, superblocks and other special uses), which
> together with a user-level interface to "preallocate" and your
> "relocate page" should actually make it possible to make a fairly
> FS-independent defragmenter.

Would I be right in thinking that this would be an array with three
possible values for each element...

FIXED Block not movable.
MOVABLE Block in use and movable.
UNUSED Block not in use.

...with the defragmenter basically exchanging MOVABLE and UNUSED blocks
to get the files in an unfragmented state. The FIXED value would handle
things like the superblock, inode blocks and other special uses, and all
other blocks would be either MOVABLE or UNUSED as appropriate.

Another option might be to split MOVABLE into DIRECTORY and FILE values
instead, but whether that would be useful is questionable at best.

> Add a nice graphical front-end, and you can make it a useful
> screen-saver.

As long as it runs on systems without X-windows available rather than
being limited to only run under X... My preference would be for a tool
similar to `make menuconfig` for this sort of utility.

Best wishes from Riley.