views:

93

answers:

1

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 ( dentry ) {   
    ...
}
sys_close(f);
+2  A: 

Why are you using a system call to read the contents of a directory? It sounds like you really should be in userland, and that you should then be using something like opendir.