[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: reading an empty directory after reboot is very slow



Bob Proulx <bob@proulx.com> writes:

> Petter Adsen wrote:
>> Can someone please enlighten me as to why the entry for this directory
>> is so large, even though it is empty? Since it's apparently obvious to
>> everyone else, I would very much like to know :)
>
> <snipped>
> 
> If a directory became full it was easy to extend it
> by writing the array longer.  But if an early entry in the array was
> deleted the system would zero it out rather than move each and every
> entry in the file system down a slot.  (I always wondered why they
> didn't simply take the *last* entry and move it down to the deleted
> entry and simply keep the array always compacted.  I wonder.  But they
> didn't do it that way.)
>

Moving entries around breaks ongoing readdir operations.  If a readdir
has gone past the file being removed, and you moved the last entry
there, the entry being moved would be missed, despite *it* not being the
entry added or removed.

> <snipped>

-- 
regards,
kushal


Reply to: