Linux Kernel - Refreshing VFS Dentry Cache
- by Mike D
I wrote a system call that opens a directory and gets the file object and the dentry struct. Im trying to list all entries including entries in subdirectories using the list_for_each() macro. The problem is its only displaying whats currently in the dentry cache. If I open the directory with nautilus then rerun the system call, all the entries are listed. Is there a way to check the exact list of entries or refresh the cache?
f = s_open(tpath);
fle = fget(f);
d = fle->f_path.dentry;
list_for_each ( position , &d->d_subdirs ) {
dtmp = list_entry(position, struct dentry, d_u.d_child);
...
}
sys_close(f);