aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/buffer_head.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r--include/linux/buffer_head.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 8b1bf8d3d4a2..894e5d125de6 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -81,11 +81,14 @@ struct buffer_head {
81/* 81/*
82 * macro tricks to expand the set_buffer_foo(), clear_buffer_foo() 82 * macro tricks to expand the set_buffer_foo(), clear_buffer_foo()
83 * and buffer_foo() functions. 83 * and buffer_foo() functions.
84 * To avoid reset buffer flags that are already set, because that causes
85 * a costly cache line transition, check the flag first.
84 */ 86 */
85#define BUFFER_FNS(bit, name) \ 87#define BUFFER_FNS(bit, name) \
86static __always_inline void set_buffer_##name(struct buffer_head *bh) \ 88static __always_inline void set_buffer_##name(struct buffer_head *bh) \
87{ \ 89{ \
88 set_bit(BH_##bit, &(bh)->b_state); \ 90 if (!test_bit(BH_##bit, &(bh)->b_state)) \
91 set_bit(BH_##bit, &(bh)->b_state); \
89} \ 92} \
90static __always_inline void clear_buffer_##name(struct buffer_head *bh) \ 93static __always_inline void clear_buffer_##name(struct buffer_head *bh) \
91{ \ 94{ \
@@ -151,7 +154,6 @@ void buffer_check_dirty_writeback(struct page *page,
151 154
152void mark_buffer_dirty(struct buffer_head *bh); 155void mark_buffer_dirty(struct buffer_head *bh);
153void mark_buffer_write_io_error(struct buffer_head *bh); 156void mark_buffer_write_io_error(struct buffer_head *bh);
154void init_buffer(struct buffer_head *, bh_end_io_t *, void *);
155void touch_buffer(struct buffer_head *bh); 157void touch_buffer(struct buffer_head *bh);
156void set_bh_page(struct buffer_head *bh, 158void set_bh_page(struct buffer_head *bh,
157 struct page *page, unsigned long offset); 159 struct page *page, unsigned long offset);