开发者

Linux Kernel - Refreshing VFS Dentry Cache

开发者 https://www.devze.com 2022-12-27 21:17 出处:网络
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 prob

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消