When a special file is opened, it's file operations are set by filesystem in which the file is. Say for example if you have /dev/hda in ext3 filesystem, it's file operations will be set by ext3 when incore inode will be created (generally when file is opened for the first time). These file operation are specific to the file type (directories, link, device...etc). Now for a block device which /dev/hda is, these operations are defined in def_blk_fops (fs/block_dev.c). This structure has generic_file_read as it's read function. generic_file_read doesn't do nothing. This function is used for all filesystems that can use page_cache directly. I don't understand this function much, so cann't explain it further. Cheers! -Manu On Wed, 29 Sep 2004 15:23:24 +0545, manish regmi <regmi.manish@xxxxxxxxx> 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/ > > -- ---------------- Manu Garg http://manugarg.freezope.org -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/