Skip to content

Commit 877f962

Browse files
committed
buffer: add BH_Prio and BH_Meta flags
Add buffer_head flags so that buffer cache writebacks can be marked with the the appropriate request flags, so that metadata blocks can be marked appropriately in blktrace. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 9f20350 commit 877f962

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎fs/buffer.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,6 +2988,11 @@ int submit_bh(int rw, struct buffer_head * bh)
29882988
/* Take care of bh's that straddle the end of the device */
29892989
guard_bh_eod(rw, bio, bh);
29902990

2991+
if (buffer_meta(bh))
2992+
rw |= REQ_META;
2993+
if (buffer_prio(bh))
2994+
rw |= REQ_PRIO;
2995+
29912996
bio_get(bio);
29922997
submit_bio(rw, bio);
29932998

‎include/linux/buffer_head.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ enum bh_state_bits {
3434
BH_Write_EIO, /* I/O error on write */
3535
BH_Unwritten, /* Buffer is allocated on disk but not written */
3636
BH_Quiet, /* Buffer Error Prinks to be quiet */
37+
BH_Meta, /* Buffer contains metadata */
38+
BH_Prio, /* Buffer should be submitted with REQ_PRIO */
3739

3840
BH_PrivateStart,/* not a state bit, but the first bit available
3941
* for private allocation by other entities
@@ -124,6 +126,8 @@ BUFFER_FNS(Delay, delay)
124126
BUFFER_FNS(Boundary, boundary)
125127
BUFFER_FNS(Write_EIO, write_io_error)
126128
BUFFER_FNS(Unwritten, unwritten)
129+
BUFFER_FNS(Meta, meta)
130+
BUFFER_FNS(Prio, prio)
127131

128132
#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
129133

0 commit comments

Comments
 (0)