diff options
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r-- | include/linux/buffer_head.h | 6 |
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) \ |
86 | static __always_inline void set_buffer_##name(struct buffer_head *bh) \ | 88 | static __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 | } \ |
90 | static __always_inline void clear_buffer_##name(struct buffer_head *bh) \ | 93 | static __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 | ||
152 | void mark_buffer_dirty(struct buffer_head *bh); | 155 | void mark_buffer_dirty(struct buffer_head *bh); |
153 | void mark_buffer_write_io_error(struct buffer_head *bh); | 156 | void mark_buffer_write_io_error(struct buffer_head *bh); |
154 | void init_buffer(struct buffer_head *, bh_end_io_t *, void *); | ||
155 | void touch_buffer(struct buffer_head *bh); | 157 | void touch_buffer(struct buffer_head *bh); |
156 | void set_bh_page(struct buffer_head *bh, | 158 | void set_bh_page(struct buffer_head *bh, |
157 | struct page *page, unsigned long offset); | 159 | struct page *page, unsigned long offset); |