regarding read call arguments in blk driver

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

 



Hi All
I am trying to work on a block driver.

I have  a read call from my user test file and is as follows:
read(fd, ubuf, 1024));

In the driver: the request ( read_sector ) gets invoked with parameters specified in current request.
cur_req(&blkdrv, sector,  CURRENT->current_nr_sectors,  CURRENT->buffer);

Anyone pl tell how the the "no:of bytes" parameter ( 3rd arg) in read call gets converted to sector( starting sector from where to read ) & current_nr_sectors (number of sectors to read)
in the driver.

Can i give the sector number from where to start and number of sectors to read from user test file.

Thanks in Advance
Sudheer


--
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