diff options
Diffstat (limited to 'include/linux/buffer_head.h')
| -rw-r--r-- | include/linux/buffer_head.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 9f159baf153f..fb7e9b7ccbe3 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -46,25 +46,28 @@ struct address_space; | |||
| 46 | typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); | 46 | typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); |
| 47 | 47 | ||
| 48 | /* | 48 | /* |
| 49 | * Keep related fields in common cachelines. The most commonly accessed | 49 | * Historically, a buffer_head was used to map a single block |
| 50 | * field (b_state) goes at the start so the compiler does not generate | 50 | * within a page, and of course as the unit of I/O through the |
| 51 | * indexed addressing for it. | 51 | * filesystem and block layers. Nowadays the basic I/O unit |
| 52 | * is the bio, and buffer_heads are used for extracting block | ||
| 53 | * mappings (via a get_block_t call), for tracking state within | ||
| 54 | * a page (via a page_mapping) and for wrapping bio submission | ||
| 55 | * for backward compatibility reasons (e.g. submit_bh). | ||
| 52 | */ | 56 | */ |
| 53 | struct buffer_head { | 57 | struct buffer_head { |
| 54 | /* First cache line: */ | ||
| 55 | unsigned long b_state; /* buffer state bitmap (see above) */ | 58 | unsigned long b_state; /* buffer state bitmap (see above) */ |
| 56 | struct buffer_head *b_this_page;/* circular list of page's buffers */ | 59 | struct buffer_head *b_this_page;/* circular list of page's buffers */ |
| 57 | struct page *b_page; /* the page this bh is mapped to */ | 60 | struct page *b_page; /* the page this bh is mapped to */ |
| 58 | atomic_t b_count; /* users using this block */ | ||
| 59 | u32 b_size; /* block size */ | ||
| 60 | 61 | ||
| 61 | sector_t b_blocknr; /* block number */ | 62 | sector_t b_blocknr; /* start block number */ |
| 62 | char *b_data; /* pointer to data block */ | 63 | size_t b_size; /* size of mapping */ |
| 64 | char *b_data; /* pointer to data within the page */ | ||
| 63 | 65 | ||
| 64 | struct block_device *b_bdev; | 66 | struct block_device *b_bdev; |
| 65 | bh_end_io_t *b_end_io; /* I/O completion */ | 67 | bh_end_io_t *b_end_io; /* I/O completion */ |
| 66 | void *b_private; /* reserved for b_end_io */ | 68 | void *b_private; /* reserved for b_end_io */ |
| 67 | struct list_head b_assoc_buffers; /* associated with another mapping */ | 69 | struct list_head b_assoc_buffers; /* associated with another mapping */ |
| 70 | atomic_t b_count; /* users using this buffer_head */ | ||
| 68 | }; | 71 | }; |
| 69 | 72 | ||
| 70 | /* | 73 | /* |
| @@ -189,8 +192,8 @@ extern int buffer_heads_over_limit; | |||
| 189 | * address_spaces. | 192 | * address_spaces. |
| 190 | */ | 193 | */ |
| 191 | int try_to_release_page(struct page * page, gfp_t gfp_mask); | 194 | int try_to_release_page(struct page * page, gfp_t gfp_mask); |
| 192 | int block_invalidatepage(struct page *page, unsigned long offset); | 195 | void block_invalidatepage(struct page *page, unsigned long offset); |
| 193 | int do_invalidatepage(struct page *page, unsigned long offset); | 196 | void do_invalidatepage(struct page *page, unsigned long offset); |
| 194 | int block_write_full_page(struct page *page, get_block_t *get_block, | 197 | int block_write_full_page(struct page *page, get_block_t *get_block, |
| 195 | struct writeback_control *wbc); | 198 | struct writeback_control *wbc); |
| 196 | int block_read_full_page(struct page*, get_block_t*); | 199 | int block_read_full_page(struct page*, get_block_t*); |
| @@ -200,7 +203,7 @@ int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, | |||
| 200 | int generic_cont_expand(struct inode *inode, loff_t size); | 203 | int generic_cont_expand(struct inode *inode, loff_t size); |
| 201 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | 204 | int generic_cont_expand_simple(struct inode *inode, loff_t size); |
| 202 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 205 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
| 203 | int block_sync_page(struct page *); | 206 | void block_sync_page(struct page *); |
| 204 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 207 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
| 205 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); | 208 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); |
| 206 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 209 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
| @@ -277,6 +280,7 @@ map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) | |||
| 277 | set_buffer_mapped(bh); | 280 | set_buffer_mapped(bh); |
| 278 | bh->b_bdev = sb->s_bdev; | 281 | bh->b_bdev = sb->s_bdev; |
| 279 | bh->b_blocknr = block; | 282 | bh->b_blocknr = block; |
| 283 | bh->b_size = sb->s_blocksize; | ||
| 280 | } | 284 | } |
| 281 | 285 | ||
| 282 | /* | 286 | /* |
