Creating BIO structure

Submitted by Anonymous
on February 17, 2005 - 12:37am

Hi,

I want to create my own bio structure to write the data to a block disk.

I have block device details in terms of dev_t, I have data in my driver allocated pages.

How I can achieve this?

* Use bio_alloc to get bio
* Using bio_add_page add my own buffer (got using page_alloc) to the bio structure
* Construct the block_device *bi_bdev structure { Actually I have dev_t type for my block device, how I can get corresponding block_device structure?), construct the gendisk structure
* submit_bio

Is there any way to get block_disk structure from dev_t type?
get_bdisk returns an object of type block_disk, but its gendisk structure is empty.

Regards,Explorer