LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-22-2014, 01:22 PM   #1
saurin
Member
 
Registered: Aug 2008
Posts: 50

Rep: Reputation: 0
linux AHCI driver which functions are responsible to read/write on disk


Hi,

I have SATA disk connected to my system running centos, i am looking for the disk i/o function which is responsible to do the read/write on disk, would somebody point me?

Thanks,
Saurin
 
Old 07-22-2014, 02:47 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
AHCI is used by kernel to perform read and write operation. Could you be more specific as to what exactly you are looking for? Are you looking for specific parameters that can be tuned?
 
Old 07-23-2014, 01:09 PM   #3
saurin
Member
 
Registered: Aug 2008
Posts: 50

Original Poster
Rep: Reputation: 0
I Want to process the data just before it is written to disk. also wants to process the data immediately after reading from disk.
 
Old 07-23-2014, 02:44 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
I Want to process the data just before it is written to disk. also wants to process the data immediately after reading from disk.
That is how it is done. So am not quite sure what exactly you are looking for? For example: If an application given task to process the data it will contact the kernel, kernel then load that process in CPU, if data is there on cache or RAM it will pick it up else will go to disk for getting the relevant data. Once data is process it will be written to the disk. Vice-versa happens when you talk about reading from the disk.

If you are talking about parameters for performing immediate sync which are responsible for writing the data immediately to the disk then that is something different.
 
Old 07-23-2014, 04:20 PM   #5
saurin
Member
 
Registered: Aug 2008
Posts: 50

Original Poster
Rep: Reputation: 0
I am interested to know the function responsible in kernel which writes the chunk of data to the disk. looks like it is not strait forward to find that function.
 
Old 07-23-2014, 04:24 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Ok it is the application that writes to the disk with the help of the kernel. When application has to write any data to the disk post processing (already explained in my previous post) it will tell the kernel that I want to write this stuff to the disk. Kernel will then provide VFS (virtual file system because application doesn't care about the file system you are running on) to the application for data writing which in turn in the backend with the help of kernel writes to the disk.
 
Old 07-23-2014, 04:36 PM   #7
saurin
Member
 
Registered: Aug 2008
Posts: 50

Original Poster
Rep: Reputation: 0
May be my question is not clear. Let me ask this way, In a block driver after the I/O scheduler which function is responsible for writing into disk?
 
Old 07-23-2014, 05:32 PM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Now it is quite clear. Basically you are looking for which function is invoked by ahci module (block driver) which helps the kernel to write. Have a look at this wiki and read the POSIX section of it: http://en.wikipedia.org/wiki/Write_(system_call) .
 
  


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
[SOLVED] Why not get the offset to the read-write functions of my driver? eduardosufan Linux - Kernel 4 07-11-2013 03:31 PM
[SOLVED] Device driver read/write functions not running for address 0x80000000 shade963 Linux - Kernel 0 09-10-2012 10:27 AM
How to write a keyboard driver read and interrupt functions? sunr2007 Programming 1 01-13-2009 08:38 AM
how i can list directory by using read() & write() kernll functions ashamry Programming 2 05-10-2004 01:44 PM

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

All times are GMT -5. The time now is 05:15 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
Open Source Consulting | Domain Registration