aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 161be58c5cb0..5c2cba8d2387 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -49,7 +49,7 @@
49 49
50static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); 50static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);
51static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, 51static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
52 struct writeback_control *wbc); 52 enum rw_hint hint, struct writeback_control *wbc);
53 53
54#define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) 54#define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers)
55 55
@@ -1829,7 +1829,8 @@ int __block_write_full_page(struct inode *inode, struct page *page,
1829 do { 1829 do {
1830 struct buffer_head *next = bh->b_this_page; 1830 struct buffer_head *next = bh->b_this_page;
1831 if (buffer_async_write(bh)) { 1831 if (buffer_async_write(bh)) {
1832 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); 1832 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh,
1833 inode->i_write_hint, wbc);
1833 nr_underway++; 1834 nr_underway++;
1834 } 1835 }
1835 bh = next; 1836 bh = next;
@@ -1883,7 +1884,8 @@ recover:
1883 struct buffer_head *next = bh->b_this_page; 1884 struct buffer_head *next = bh->b_this_page;
1884 if (buffer_async_write(bh)) { 1885 if (buffer_async_write(bh)) {
1885 clear_buffer_dirty(bh); 1886 clear_buffer_dirty(bh);
1886 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); 1887 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh,
1888 inode->i_write_hint, wbc);
1887 nr_underway++; 1889 nr_underway++;
1888 } 1890 }
1889 bh = next; 1891 bh = next;
@@ -3038,7 +3040,7 @@ static void end_bio_bh_io_sync(struct bio *bio)
3038 if (unlikely(bio_flagged(bio, BIO_QUIET))) 3040 if (unlikely(bio_flagged(bio, BIO_QUIET)))
3039 set_bit(BH_Quiet, &bh->b_state); 3041 set_bit(BH_Quiet, &bh->b_state);
3040 3042
3041 bh->b_end_io(bh, !bio->bi_error); 3043 bh->b_end_io(bh, !bio->bi_status);
3042 bio_put(bio); 3044 bio_put(bio);
3043} 3045}
3044 3046
@@ -3091,7 +3093,7 @@ void guard_bio_eod(int op, struct bio *bio)
3091} 3093}
3092 3094
3093static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, 3095static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
3094 struct writeback_control *wbc) 3096 enum rw_hint write_hint, struct writeback_control *wbc)
3095{ 3097{
3096 struct bio *bio; 3098 struct bio *bio;
3097 3099
@@ -3120,6 +3122,7 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
3120 3122
3121 bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); 3123 bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
3122 bio->bi_bdev = bh->b_bdev; 3124 bio->bi_bdev = bh->b_bdev;
3125 bio->bi_write_hint = write_hint;
3123 3126
3124 bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); 3127 bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
3125 BUG_ON(bio->bi_iter.bi_size != bh->b_size); 3128 BUG_ON(bio->bi_iter.bi_size != bh->b_size);
@@ -3142,7 +3145,7 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
3142 3145
3143int submit_bh(int op, int op_flags, struct buffer_head *bh) 3146int submit_bh(int op, int op_flags, struct buffer_head *bh)
3144{ 3147{
3145 return submit_bh_wbc(op, op_flags, bh, NULL); 3148 return submit_bh_wbc(op, op_flags, bh, 0, NULL);
3146} 3149}
3147EXPORT_SYMBOL(submit_bh); 3150EXPORT_SYMBOL(submit_bh);
3148 3151