LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-28-2011, 11:55 PM   #1
zishan.shaikh
LQ Newbie
 
Registered: Dec 2011
Location: Pune, India
Distribution: Fedora 17
Posts: 6

Rep: Reputation: Disabled
Tracing how a file is actually written.


I am currently working on a project on EXT3 filesystem in my college.

I need to trace how is the file actually written, that is, write from the VFS code upto block allocation level. For example, if you give command say "cp a.c b.c", then i need to know how is the data of the file b.c actually written and which functions are called to do so (including VFS functions such as vfs_write(), do_sync_write() )

So far, i have tried putting printk() and traceflags in respective files for ext3. I have also tried the same for file "fs/read_write.c". It has helped me reach to vfs_write() and do_sync_write in fs/read_write.c

But i am unable to find the EXACT flow from VFS.

In addition, can anyone please tell me the function used by VFS to write into a file....

I need to modify the writing strategy. For that i need the above function.

Kindly help,
Zishan Shaikh.
 
Old 12-29-2011, 07:23 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I think you best get hold of a copy of "Understanding the Linux Kernel" (ULK3) and check chapter 16.1: "Reading and Writing a File".
 
Old 01-05-2012, 10:25 PM   #3
zishan.shaikh
LQ Newbie
 
Registered: Dec 2011
Location: Pune, India
Distribution: Fedora 17
Posts: 6

Original Poster
Rep: Reputation: Disabled
It worked

I had read that chapter already but had not understood when i had read earlier. Now when i got used to the variables used in the code and the chapter, i read that entire chapter thrice to get the exact flow. The problem is solved. I have successfully found where EXT3 actually allocates the blocks, thanks to the flow of how the data is written to the disk through VFS.
Thank you,
Zishan.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How would I see how many times a file has been written to? anon02 Linux - Software 6 09-23-2011 01:34 AM
file system calls tracing salalimo Linux - Kernel 3 02-22-2011 11:56 PM
samba share folder and file tracing greenday_ra Linux - Networking 1 06-17-2008 03:42 AM
need a log file for tracing services during startup shipon_97 Linux - Newbie 2 08-06-2007 01:42 AM
moving a file while is being written omnio Programming 10 03-23-2007 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration