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. I开发者_如何学JAVAf 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);
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.
精彩评论