Re: Read operation on Block device.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



AFAIK, open calls library wrapper [if therez any] and then that calls  sys_open call 
which actually calls device_operations struct of the driver attached to this device 
file "/dev/hda". FYI, This binding has been made during the insmod time [as you 
have used device_operations struct in your driver for a Major no and would have 
initialized blk_dev_queue for pending I/Os]. Now, when you do read(), sys_read and 
then driver specific read will be called. In this case it's generic_file_read only... 
 
Thanks. 
Sumit Sharma, 
IBM, Bangalore. 
 
 
On Wed, 29 Sep 2004 manish regmi wrote : 
>Hi, 
>  Can anybody explain me how read operation on Block device (say ide 
>device) work. 
>The read file operations of Block device is set to generic_file_read, 
>i.e nothing. and the ide driver does not have read routine. 
>Then, How Block device driver or Ide Driver reads the data? 
> 
>for eg in this type of app. 
>i = open(/dev/hda, O_RDONLY); 
>read(i ,....); 
> 
>Thanks in advance. 
> 
>-- 
>Kernelnewbies: Help each other learn about the Linux kernel. 
>Archive:       http://mail.nl.linux.org/kernelnewbies/ 
>FAQ:           http://kernelnewbies.org/faq/ 
> 

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux