From: John M. <jo...@jm...> - 2010-04-08 00:26:00
|
On 2010-04-07, at 5:22 PM, Nikolaus Rath wrote: > Miklos Szeredi <mi...@sz...> writes: >>>> Is there any way to force the kernel to forget about the cached attributes >>>> for a directory entry? >>>> >> >> Since libfuse-2.8 the following functions are part of the lowlevel API: >> >> fuse_lowlevel_notify_inval_inode() >> fuse_lowlevel_notify_inval_entry() > > Could you explain which function has to be used in what case? The > documentation in fuse_lowlevel.h didn't help me very much. What is > 'dentry matching parent/name'? > > Basically, I have a directory with name "foo" and inode 42 that has > gained additional directory entries. Some of them might be > subdirectories, so st_nlinks of the directory may change as well. What > function do I have to call? notify_inval_inode() will invalidate the attributes for the given inode by number. notify_inval_entry() will invalidate the attributes of the given directory (parent) and directory entry (file) matching parent/name. For your case (adding a file to a directory), you need to call notify_inval_inode() on the parent directory. Notify_inval_entry() is typically for removal of files and directories (or rename-over a file), although removal of a directory that is in use does not work (there is an additional patch that is not integrated into the kernel). Note that this interface really only applies if you are using the low-level interface and define the inode numbers. When you use the high level interface, the inode numbers are defined by the high level library (and have nothing to do with st_ino). Regards, John. -- John Muir - jo...@jm... |