<div dir="ltr"><div>> I'm still not able to figure out where exactly is the position of file stored per task_struct.<br></div><div>struct file * itself is per process (task_struct) so file->f_pos is file position per process, if thats what you are looking for. I hope you haven't assumed that struct file itself is unique for a file, i.e. per inode? Then that assumption is wrong.<br>
<br></div><div>-Rajat<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 29, 2013 at 6:38 PM, Pranay Kumar Srivastava <span dir="ltr"><<a href="mailto:Pranay.Shrivastava@hcl.com" target="_blank">Pranay.Shrivastava@hcl.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Everyone,<br>
<br>
I was trying to find out where does Linux store per process file position? Since struct file is allocated once when the file is first opened (get_empty_filp() via do_sys_open) .I looked at these,<br>
<br>
Copy_process--->copy_files-->dup_fd it seemed to allocate only (struct file*)<br>
<br>
struct files_struct , but I couldn't find any field that is actually being used to store the file position.<br>
<br>
<br>
I'm still not able to figure out where exactly is the position of file stored per task_struct. Secondly even if this was being saved does the kernel changes f_pos of struct file whenever a (read/write) is done? I don't that happens [Correct?].<br>
<br>
Regards,<br>
Pranay Kumar Srivastava<br>
<br>
<br>
::DISCLAIMER::<br>
----------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.<br>
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,<br>
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents<br>
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.<br>
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the<br>
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,<br>
distribution and / or publication of this message without the prior written consent of authorized representative of<br>
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.<br>
Before opening any email and/or attachments, please check them for viruses and other defects.<br>
<br>
----------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br></div>