lkml.org 
[lkml]   [1998]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: ext2fs enhacement/fix [re: shrinking directories]
On Mon, Jul 20, 1998 at 12:13:41PM +0200, Jan Kara wrote:
> > Rough outline of steps I think would work:
> > 1. Read directory information
> > 2. Pack and possibly sort it, meanwhile other programs can still access
> > the directory information
> > 3. Check change time stamp and if not changed replace the directory
> > information with the new one
> > If changed try again.
> >
> The problem of this solution is (when done on mounted fs) that noone can be
> reading the directory when we are replacing the old copy (dir->f_pos will be bad :() and
> I'm not sure how often this is satisfied on a busy servers with big dirs...
>
> Bye Honza

This could perhaps be satisfied by slight of hand and numerous calls
to link().

i.e.
2. becomes copy all info from directory -> .directory.new and possibly sort it
3. check change time stamp, do a special block on access to directory
so all read/write requests to directory goes to .directory.new,
rename directory -> .directory.old and .directory.new -> directory.
4. unlink all entries in .directory.old.
5. go on with life.

This could require filesystem magic, such as a special extentions to
all directory-related e2fs calls so that for the time of the copying
from directory -> .directory.new an open in directory would also cause
a new directory/file to be linked to director.new/file, and it would
break programs that depended on link count being a specific number on
open. I think this could be worked out somehow, but I don't have the
skills to do it :( It would be handy, though. I don't know if this is
the best way to go about it.

-Peter


-
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.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.048 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site