Re: open, readdir in ramfs

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

 



On Thu, 2006-01-26 at 15:45 +0530, Sunil Agham wrote:
<snip> 
> i used ramfs code, i then defined open and readdir functions and added
> printk, i compliled it as a module,inserted to kernel and mounted it.

What do you mean?  How did you define open and readdir in ramfs?  Did
you define your own calls?  If so, did you replace the pointers in the
operation vectors?

>  and when i invoked "ls" at mount point,  its not invoking open,
> readdir 
> can anyone please help me .

The ls command calls the getdents (or getdents64) system call.  Check
the code for sys_getdents() in fs/readdir.c.  This system call calls
vfs_readdir, which calls file->f_op->readdir().

If you look at ramfs_get_inode(), if it is creating a directory, it sets
inode->i_fop to simple_dir_operations, which defines both open and
readdir.

Feel free to ask any more questions you have on kernelnewbies, but your
question had nothing to do with the unionfs developers, so I don't know
why you sent it there...

Good luck.

Avishay Traeger
http://www.fsl.cs.sunysb.edu/~avishay/


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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