LinuxQuestions.org
Visit Jeremy's Blog.
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 11-30-2009, 03:10 PM   #1
viswesh530
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
tracking a file in user and Kernel space


Hi,

I am a Linux newbie and am currently looking at understanding the operation of the VFS, specifically the read and write operation. I have created a file using open() and am reading from it using the read() call. I want to print information like the read ahead size, block/segment information each time from the kernel whenever this specific file is accessed. Any pointers on how I could identify the file uniquely in my application as well as from vfs would be extremely helpful. Looking forward to the responses...
 
Old 12-01-2009, 03:48 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,246

Rep: Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639
The VFS is an abstraction layer that is designed to specifically hide those sort of details. Nobody(*) cares. What matters is that application writers can write generic code, and "something" manages to get it out to (or from) the device. Whatever that device is, and whatever its capabilities.
To get into ugly details, you need to be talking at the block device driver layer. Which is what the VFS is protecting you from.
Userspace uses file descriptors to reference files - kernelspace cares about inodes. Have a look at task_struct.
 
Old 12-03-2009, 01:08 PM   #3
viswesh530
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up

Thanks a lot Syg00..I see your point..i managed to get the information I was looking for using plain old printk statements.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Do we have any chance of calling user space callback function from kernel space? ravishankar.g Linux - Newbie 1 09-22-2009 08:14 PM
how to call socket prog code written in user space from kernel space???HELP kurt2 Programming 2 07-15-2009 10:56 PM
Write into File from Kernel and read the same file from User space saurabhchokshi Programming 0 05-01-2009 03:26 PM

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

All times are GMT -5. The time now is 08:12 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration