What is Bio->segment?

来源:互联网 发布:qq api 发送消息 java 编辑:程序博客网 时间:2024/05/21 20:24
The basic container for block I/O within the kernel is thebio structure, which is defined
in <linux/bio.h>.This structure represents block I/O operations that are in flight
(active) as a list of segments.A segment is a chunk of a buffer that is contiguous in memory.Thus, individual buffers need not be contiguous in memory. By allowing the buffers
to be described in chunks, the bio structure provides the capability for the kernel to perform block I/O operations of even a single buffer from multiple locations in memory.

Vector I/O such as this is called scatter-gather I/O.


从LKD摘的一段话,解释一下什么是block device 操作的bio segment.


BIO structure 用 segments链表来表达blick i/o正在进行的操作, 一个segment是buffer的一部分,准确的说是buffer中在memory上连续的一部分,这样的话,就不要求整个buffer在memory中连续。

0 0