struct address_space {
385 struct inode *host; /* owner: inode, block_device */
386 struct radix_tree_root page_tree; /* radix tree of all pages */
387 rwlock_t tree_lock; /* and rwlock protecting it */
388 unsigned int i_mmap_writable;/* count VM_SHARED mappings */
389 struct prio_tree_root i_mmap; /* tree of private and shared mappings */
390 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
391 spinlock_t i_mmap_lock; /* protect tree, count, list */
392 unsigned int truncate_count; /* Cover race condition with truncate */
393 unsigned long nrpages; /* number of total pages */
394 pgoff_t writeback_index;/* writeback starts here */
395 struct address_space_operations *a_ops; /* methods */
396 unsigned long flags; /* error bits/gfp mask */
397 struct backing_dev_info *backing_dev_info; /* device readahead, etc */
398 spinlock_t private_lock; /* for use by the address_space */
399 struct list_head private_list; /* ditto */
400 struct address_space *assoc_mapping; /* ditto */
401 }
struct buffer_head {
58 unsigned long b_state; /* buffer state bitmap (see above) */
59 struct buffer_head *b_this_page;/* circular list of page's buffers */
60 struct page *b_page; /* the page this bh is mapped to */
61
62 sector_t b_blocknr; /* start block number */
63 size_t b_size; /* size of mapping */
64 char *b_data; /* pointer to data within the page */
65
66 struct block_device *b_bdev;
67 bh_end_io_t *b_end_io; /* I/O completion */
68 void *b_private; /* reserved for b_end_io */
69 struct list_head b_assoc_buffers; /* associated with another mapping */
70 atomic_t b_count; /* users using this buffer_head */
71 }
struct bio {
73 sector_t bi_sector;
74 struct bio *bi_next; /* request queue link */
75 struct block_device *bi_bdev;
76 unsigned long bi_flags; /* status, command, etc */
77 unsigned long bi_rw; /* bottom bits READ/WRITE,
78 * top bits priority
79 */
80
81 unsigned short bi_vcnt; /* how many bio_vec's */
82 unsigned short bi_idx; /* current index into bvl_vec */
83
84 /* Number of segments in this BIO after
85 * physical address coalescing is performed.
86 */
87 unsigned short bi_phys_segments;
88
89 /* Number of segments after physical and DMA remapping
90 * hardware coalescing is performed.
91 */
92 unsigned short bi_hw_segments;
93
94 unsigned int bi_size; /* residual I/O count */
95
96 /*
97 * To keep track of the max hw size, we account for the
98 * sizes of the first and last virtually mergeable segments
99 * in this bio
100 */
101 unsigned int bi_hw_front_size;
102 unsigned int bi_hw_back_size;
103
104 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
105
106 struct bio_vec *bi_io_vec; /* the actual vec list */
107
108 bio_end_io_t *bi_end_io;
109 atomic_t bi_cnt; /* pin count */
110
111 void *bi_private;
112
113 bio_destructor_t *bi_destructor; /* destructor */
114 }
**********
http://lxr.linux.no/source/block/?v=2.6.18
redesigned block layer:2.6......>技术改进提升I/O性能。
The kernel eliminates the bounce buffer used when performing I/O into high memory.
It uses per-request queue lock in replace of the global I/O requst lock.
The buffer_head structure, which represents I/O requests, is replaced by new data structure named bio.