Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Nov 2000 21:18:10 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        "Human" <human@adept.co.za>
Cc:        questions@freebsd.org
Subject:   Re: filesystem/dir file?
Message-ID:  <14875.15090.97012.14749@guru.mired.org>
In-Reply-To: <75277658@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Human <human@adept.co.za> types:
> HI
> Ive tried this in SCO UW7, Redhat and FBSD 4.0.
> 
> If u make a empty directory and then run a script in it to produce a couple
> thousand empty  files , u will note that the size of the actual directory
> file increases, which is normal because the actual file names of the files u
> have created in the dir and their inode numbers are stored in the directory
> file. The strange thing is once u delete the files in the directory the size
> of the directory file does NOT decrease, why??? I presume the reference to
> the file is removed but it seems (im not sure about the wording) the
> placeholder or buffer in the directory file does not get removed therefore
> it stays the same size.
> 
> My question is why does it not empty the file properly this seems like a
> large waste of space, the only conclusion I can come to is in the old days
> (b4 I was born) computers were too slow and it would have used up
> unnecessary resources?????
> Any one have a better theory?

Well, I think you're partly right. Part of the answer is that what
you're doing is sufficiently unnatural that savings would be very
small, so there's no point in doing it.

The speed of old/current machines doesn't really have much to do with
the performance issue. If you double the number of disk access it
takes to delete a file (and that's the least I can see it adding with
no real work on the problem), you double the time no matter how fast
the computer is. That's a serious performance hit.

If you're really interested in how much this would save, why don't you
find a file tree that's being used for real work, "cp -r" it to
another place, then sum the size of the directories in the two
trees. That will tell you how much space not compacting directories is
costing.

If you think it's a lot of space, feel free to dive into the kernel
sources and fix the problem.

	<mike



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14875.15090.97012.14749>