Fwd: Accessing dentry structs and lists in the VFS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does anyone have any more suggestions on how I can achieve this? I've since tried walking through the directory lists with list_for_each() but the kernel crashes each time it is called.

---------- 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

2009/11/22 SandeepKsinha <sandeepksinha@xxxxxxxxx>

Hi Sam,


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?
>

I think walking a directory inside the kernel is not suggested.
If you share what you are trying to achieve, it would better to help
with your problem.

> At the moment I'm trying something like,
>
> printk("%s\n", file->f_dentry->d_subdirs->next.d_name);
>

Remember, you can always have a negative dentry. How are you getting
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.”



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux