mapping of inode and file structure in Open System call

Pranay Srivastava pranjas at gmail.com
Thu Nov 13 00:44:30 EST 2014


Hi Lokesh

On Wed, Nov 12, 2014 at 6:42 PM, lokesh kumar <lokeshkumar.222 at gmail.com> wrote:
> Hi,
>
> I have a question regarding  open systemcall
>
> "open(dev_name, O_RDWR, 0)"    -->userspace
>
> suppose devname is /dev/my_device
>
> Now when we look into open file operation, we have prototype
> "int (*open) (struct inode *, struct file *);"
>
> could anyone tell me how inode and file structure pointer are filled.
>
> I think logic is written in fs/open.c
>
> but i got confused in callbacks used in it.could anyone please tell me
> which topics should i cover to understand open system call.
>

You should probably first understand how the file is located. See the
role of lookup.

> Thanks.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
        ---P.K.S



More information about the Kernelnewbies mailing list