History

[PATCH] change buffer_head.b_size to size_t

Increase the size of the buffer_head b_size field (only) for 64 bit platforms. Update some old and moldy comments in and around the structure as well. The b_size increase allows us to perform larger mappings and allocations for large I/O requests from userspace, which tie in with other changes allowing the get_block_t() interface to map multiple blocks at once.

Badari Pulavarty committed 20 years ago

Commit 205f87f1 parent d48589b4 files · +17 −12Browse files

Showing the changes to include/linux/buffer_head.h (1 of 4 files). Show all

Unified · Split

include/linux/buffer_head.h+11−8
@@ -46,25 +46,28 @@ struct address_space; · 45 unmodified lines
4646 typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
4747
4848 /*
49− * Keep related fields in common cachelines. The most commonly accessed
50− * field (b_state) goes at the start so the compiler does not generate
51− * indexed addressing for it.
49+ * Historically, a buffer_head was used to map a single block
50+ * within a page, and of course as the unit of I/O through the
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).
5256 */
5357 struct buffer_head {
54− /* First cache line: */
5558 unsigned long b_state; /* buffer state bitmap (see above) */
5659 struct buffer_head *b_this_page;/* circular list of page's buffers */
5760 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 */
6061
61− sector_t b_blocknr; /* block number */
62− char *b_data; /* pointer to data block */
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 */
6365
6466 struct block_device *b_bdev;
6567 bh_end_io_t *b_end_io; /* I/O completion */
6668 void *b_private; /* reserved for b_end_io */
6769 struct list_head b_assoc_buffers; /* associated with another mapping */
70+ atomic_t b_count; /* users using this buffer_head */
6871 };
6972
7073 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t