* Invalidating dentries
@ 2005-03-21 15:26 Jan Engelhardt
2005-03-21 15:46 ` linux-os
2005-03-23 2:44 ` Andrew Morton
0 siblings, 2 replies; 5+ messages in thread
From: Jan Engelhardt @ 2005-03-21 15:26 UTC (permalink / raw)
To: linux-kernel
Hello list,
how can I invalidate all buffered/cached dentries so that ls -l /somefolder
will definitely go read the harddisk?
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Invalidating dentries
2005-03-21 15:26 Jan Engelhardt
@ 2005-03-21 15:46 ` linux-os
2005-03-23 2:44 ` Andrew Morton
1 sibling, 0 replies; 5+ messages in thread
From: linux-os @ 2005-03-21 15:46 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: linux-kernel
On Mon, 21 Mar 2005, Jan Engelhardt wrote:
> Hello list,
>
>
> how can I invalidate all buffered/cached dentries so that ls -l /somefolder
> will definitely go read the harddisk?
>
fsync() on the file(s) in the directory then fsync() on the directory
itself. For this, one can open the directory as though it was
just a file, you don't need opendir().
FYI, this is what `man fsync` promises. It may be broken. Last
time I checked, one needed to umount() the file-system to make
sure the directories were updated. The problem may be that
somebody can have either the directory or a file within it
open. Until they get out, the directory entry may not actually
be finalized. Oh,... Unix/Linux doesn't have "folders". That's
some M$ thing. Real operating systems have directories. Your
GUI may have folders, just like it may have little houses,
trash-cans, red hats, and other odd widgets. However, the
operating system doesn't.
>
> Jan Engelhardt
> --
Cheers,
Dick Johnson
Penguin : Linux version 2.6.11 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Invalidating dentries
[not found] ` <3Kxue-6D8-35@gated-at.bofh.it>
@ 2005-03-23 0:07 ` Robert Hancock
0 siblings, 0 replies; 5+ messages in thread
From: Robert Hancock @ 2005-03-23 0:07 UTC (permalink / raw)
To: linux-kernel
linux-os wrote:
> On Mon, 21 Mar 2005, Jan Engelhardt wrote:
>
>> Hello list,
>>
>>
>> how can I invalidate all buffered/cached dentries so that ls -l
>> /somefolder
>> will definitely go read the harddisk?
>>
>
> fsync() on the file(s) in the directory then fsync() on the directory
> itself. For this, one can open the directory as though it was
> just a file, you don't need opendir().
I don't think this is what they want, it sounds like they want to
effectively clear the read cache for the file system. I'm not sure
there's an easy way to do that other than maybe umounting and mounting
the file system again..
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Invalidating dentries
2005-03-21 15:26 Jan Engelhardt
2005-03-21 15:46 ` linux-os
@ 2005-03-23 2:44 ` Andrew Morton
2005-03-23 7:08 ` Jan Engelhardt
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2005-03-23 2:44 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: linux-kernel
Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
>
> how can I invalidate all buffered/cached dentries so that ls -l /somefolder
> will definitely go read the harddisk?
Patch the kernel?
There's no way of doing this apart from unmount/mount, or by forcing a ton
of memory pressure and hoping that the dentries get reclaimed.
A quick way of doing it would be to add a new mount option to the
filesystem and call shrink_dcache_sb() from there. do `mount -o
remount,shrink_dcache'.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Invalidating dentries
2005-03-23 2:44 ` Andrew Morton
@ 2005-03-23 7:08 ` Jan Engelhardt
0 siblings, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2005-03-23 7:08 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
>> how can I invalidate all buffered/cached dentries so that ls -l /somefolder
>> will definitely go read the harddisk?
>
>Patch the kernel?
Great idea.
>A quick way of doing it would be to add a new mount option to the
>filesystem and call shrink_dcache_sb() from there. do `mount -o
>remount,shrink_dcache'.
I doubt that there is a way to define an option applicable to all fs?
But thanks for the idea.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-03-23 7:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <3Kx1c-6iK-37@gated-at.bofh.it>
[not found] ` <3Kxue-6D8-35@gated-at.bofh.it>
2005-03-23 0:07 ` Invalidating dentries Robert Hancock
2005-03-21 15:26 Jan Engelhardt
2005-03-21 15:46 ` linux-os
2005-03-23 2:44 ` Andrew Morton
2005-03-23 7:08 ` Jan Engelhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox