In: Computer Science
Review the following files associated with block IO:
block/genhd.c
fs/partitions/check.c
block/ll_rw_blk.c
include/linux/bio.h
include/linux/blkdev.h
include/linux/genhd.h
block/elevator.c
Discuss what you found in these files. What is the purpose of the code in each file? How do they fit together to block IO?
these are the files that are provided to me, everything here is what i can see as far as the question goes.
block/genhd.c
fs/partitions/check.c
block/ll_rw_blk.c
include/linux/bio.h
include/linux/blkdev.h
include/linux/genhd.h
block/elevator.c
List of file associated with block IO
1) block/genhd.c: This file basically registers a block driver software with kernel
and kernel interface of this file is register_blkdev()
2) fs/partitions/check.c: Frees the space of gendisk and its kernel interface prototype is del_gendisk()
block/ll_rw_blk.c: This file does two main function namely i) Allocates a request queue ii) registers a request() function for processing request in the queue. Its prototype is blk_init_queue()
3) include/linux/bio.h: Loops via every segment of page in basic input/output. Kernel interface is bio_every_segment_of_page()
4) include/linux/blkdev.h: This file keep checking whether a particular request is obtained from the request queue or not. Prototype blk_fs_request()
5) include/linux/genhd.h: This file essentially set capacity of various storage media in terms of #of sectors using function set_capacity()
6) block/elevator.c: get next entry from request queue using elv_next_request() function