aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 9196f2a270da..161be58c5cb0 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -49,7 +49,6 @@
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 unsigned long bio_flags,
53 struct writeback_control *wbc); 52 struct writeback_control *wbc);
54 53
55#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)
@@ -1830,7 +1829,7 @@ int __block_write_full_page(struct inode *inode, struct page *page,
1830 do { 1829 do {
1831 struct buffer_head *next = bh->b_this_page; 1830 struct buffer_head *next = bh->b_this_page;
1832 if (buffer_async_write(bh)) { 1831 if (buffer_async_write(bh)) {
1833 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc); 1832 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc);
1834 nr_underway++; 1833 nr_underway++;
1835 } 1834 }
1836 bh = next; 1835 bh = next;
@@ -1884,7 +1883,7 @@ recover:
1884 struct buffer_head *next = bh->b_this_page; 1883 struct buffer_head *next = bh->b_this_page;
1885 if (buffer_async_write(bh)) { 1884 if (buffer_async_write(bh)) {
1886 clear_buffer_dirty(bh); 1885 clear_buffer_dirty(bh);
1887 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc); 1886 submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc);
1888 nr_underway++; 1887 nr_underway++;
1889 } 1888 }
1890 bh = next; 1889 bh = next;
@@ -2379,8 +2378,7 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
2379 goto out; 2378 goto out;
2380 2379
2381 err = pagecache_write_begin(NULL, mapping, size, 0, 2380 err = pagecache_write_begin(NULL, mapping, size, 0,
2382 AOP_FLAG_UNINTERRUPTIBLE|AOP_FLAG_CONT_EXPAND, 2381 AOP_FLAG_CONT_EXPAND, &page, &fsdata);
2383 &page, &fsdata);
2384 if (err) 2382 if (err)
2385 goto out; 2383 goto out;
2386 2384
@@ -2415,9 +2413,8 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
2415 } 2413 }
2416 len = PAGE_SIZE - zerofrom; 2414 len = PAGE_SIZE - zerofrom;
2417 2415
2418 err = pagecache_write_begin(file, mapping, curpos, len, 2416 err = pagecache_write_begin(file, mapping, curpos, len, 0,
2419 AOP_FLAG_UNINTERRUPTIBLE, 2417 &page, &fsdata);
2420 &page, &fsdata);
2421 if (err) 2418 if (err)
2422 goto out; 2419 goto out;
2423 zero_user(page, zerofrom, len); 2420 zero_user(page, zerofrom, len);
@@ -2449,9 +2446,8 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
2449 } 2446 }
2450 len = offset - zerofrom; 2447 len = offset - zerofrom;
2451 2448
2452 err = pagecache_write_begin(file, mapping, curpos, len, 2449 err = pagecache_write_begin(file, mapping, curpos, len, 0,
2453 AOP_FLAG_UNINTERRUPTIBLE, 2450 &page, &fsdata);
2454 &page, &fsdata);
2455 if (err) 2451 if (err)
2456 goto out; 2452 goto out;
2457 zero_user(page, zerofrom, len); 2453 zero_user(page, zerofrom, len);
@@ -3095,7 +3091,7 @@ void guard_bio_eod(int op, struct bio *bio)
3095} 3091}
3096 3092
3097static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, 3093static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
3098 unsigned long bio_flags, struct writeback_control *wbc) 3094 struct writeback_control *wbc)
3099{ 3095{
3100 struct bio *bio; 3096 struct bio *bio;
3101 3097
@@ -3130,7 +3126,6 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
3130 3126
3131 bio->bi_end_io = end_bio_bh_io_sync; 3127 bio->bi_end_io = end_bio_bh_io_sync;
3132 bio->bi_private = bh; 3128 bio->bi_private = bh;
3133 bio->bi_flags |= bio_flags;
3134 3129
3135 /* Take care of bh's that straddle the end of the device */ 3130 /* Take care of bh's that straddle the end of the device */
3136 guard_bio_eod(op, bio); 3131 guard_bio_eod(op, bio);
@@ -3145,16 +3140,9 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
3145 return 0; 3140 return 0;
3146} 3141}
3147 3142
3148int _submit_bh(int op, int op_flags, struct buffer_head *bh, 3143int submit_bh(int op, int op_flags, struct buffer_head *bh)
3149 unsigned long bio_flags)
3150{ 3144{
3151 return submit_bh_wbc(op, op_flags, bh, bio_flags, NULL); 3145 return submit_bh_wbc(op, op_flags, bh, NULL);
3152}
3153EXPORT_SYMBOL_GPL(_submit_bh);
3154
3155int submit_bh(int op, int op_flags, struct buffer_head *bh)
3156{
3157 return submit_bh_wbc(op, op_flags, bh, 0, NULL);
3158} 3146}
3159EXPORT_SYMBOL(submit_bh); 3147EXPORT_SYMBOL(submit_bh);
3160 3148