2008年8月17日 星期日

do I/O without request queue

three steps:
1. define a make_request function
ex:
static int sbull_make_request(request_queue_t *q, struct bio *bio) 

     in the make_request function, transfer bio & call bio_endio(struct bio *bio, unsigned int bytes, int error) to signal completion 

2. use blk_alloc_queue(GFP_KERNEL) to allocate a queue 

3. call blk_queue_make_request(request_queue_t *queue, make_request_fn *func)

when make_request function return non-zero:
the bio is submitted again. Hence, we can modify bi_bdev & starting sector to redirect bio to another device

split bio into multiple chunks:
bio_split

沒有留言: