---------- Forwarded message ----------
From: Sam Carter <sam.w.carter@xxxxxxxxx>
Date: 2009/11/22
Subject: Re: Accessing dentry structs and lists in the VFS
To: SandeepKsinha <sandeepksinha@xxxxxxxxx>
Hi Sandeep,
I'm trying to intercept the list returned by getdents64() to perform some filtering operations before returning the list. This is for an academic project more for the benefit of proof-of-concept. I'm interested in getting the list of full paths, at the moment I can get hold of only the name of the dentry the getdents function is called on.
Thanks, Sam
From: Sam Carter <sam.w.carter@xxxxxxxxx>
Date: 2009/11/22
Subject: Re: Accessing dentry structs and lists in the VFS
To: SandeepKsinha <sandeepksinha@xxxxxxxxx>
Hi Sandeep,
I'm trying to intercept the list returned by getdents64() to perform some filtering operations before returning the list. This is for an academic project more for the benefit of proof-of-concept. I'm interested in getting the list of full paths, at the moment I can get hold of only the name of the dentry the getdents function is called on.
Thanks, Sam
2009/11/22 SandeepKsinha <sandeepksinha@xxxxxxxxx>
Hi Sam,
I think walking a directory inside the kernel is not suggested.
On Sun, Nov 22, 2009 at 7:19 PM, Sam Carter <sam.w.carter@xxxxxxxxx> wrote:
> Hi folks,
>
> If I have a file object in the kernel, and want to get hold of the files in
> that dentry Object, how do I approach it?
>
If you share what you are trying to achieve, it would better to help
with your problem.
Remember, you can always have a negative dentry. How are you getting
> At the moment I'm trying something like,
>
> printk("%s\n", file->f_dentry->d_subdirs->next.d_name);
>
the file object.
--
> However I'm getting an error based on not understanding the structures
> correctly. Am I correct in thinking that if 'file' is a directory, d_subdirs
> will hold the first file in that directory? How can I get hold of the names?
>
> Thanks, Sam
>
Regards,
Sandeep.
“To learn is to change. Education is a process that changes the learner.”