Subject: Re: Deleting files
To: Christian von Kleist <firstname.lastname@example.org>
From: Johnny Billquist <email@example.com>
Date: 03/17/2003 17:50:14
On Mon, 17 Mar 2003, Christian von Kleist wrote:
> Why do deletion operations take so long? Doing
> $ rm -rf /usr/src
> ...takes forever (half an hour, maybe). Deleting the files is
> limited to walking the inodes and modifying each one, right?
Actually no. It's walking the tree and removing the file name for each
file from the directory it is in, decrementing the refcount to the inode,
and since the refcount becomes zero, you free the inode, and move all the
allocated blocks back to the free blocks.
Copying files have the same problem. For each created file you need to
allocate an inode, create an entry in the directory, and start populating
the file with blocks, which you then fill with data.
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: firstname.lastname@example.org || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol