aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-03-09 05:56:30 -0500
committerJens Axboe <jaxboe@fusionio.com>2011-03-10 02:52:27 -0500
commit721a9602e6607417c6bc15b18e97a2f35266c690 (patch)
tree4987991e43f35b8b3b685fea0040c5265b578996 /fs
parentcf15900e1209d5b46ec2d24643adbf561830935f (diff)
block: kill off REQ_UNPLUG
With the plugging now being explicitly controlled by the submitter, callers need not pass down unplugging hints to the block layer. If they want to unplug, it's because they manually plugged on their own - in which case, they should just unplug at will. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent_io.c2
-rw-r--r--fs/buffer.c14
-rw-r--r--fs/direct-io.c2
-rw-r--r--fs/ext4/page-io.c3
-rw-r--r--fs/gfs2/log.c4
-rw-r--r--fs/gfs2/lops.c12
-rw-r--r--fs/gfs2/meta_io.c2
-rw-r--r--fs/jbd/commit.c2
-rw-r--r--fs/jbd2/commit.c6
-rw-r--r--fs/nilfs2/segbuf.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c3
11 files changed, 22 insertions, 30 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 92ac5192c518..b76f7cd47401 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2182,7 +2182,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
2182 unsigned long nr_written = 0; 2182 unsigned long nr_written = 0;
2183 2183
2184 if (wbc->sync_mode == WB_SYNC_ALL) 2184 if (wbc->sync_mode == WB_SYNC_ALL)
2185 write_flags = WRITE_SYNC_PLUG; 2185 write_flags = WRITE_SYNC;
2186 else 2186 else
2187 write_flags = WRITE; 2187 write_flags = WRITE;
2188 2188
diff --git a/fs/buffer.c b/fs/buffer.c
index f903f2e5b4fe..42534f67d71b 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -767,7 +767,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
767 * still in flight on potentially older 767 * still in flight on potentially older
768 * contents. 768 * contents.
769 */ 769 */
770 write_dirty_buffer(bh, WRITE_SYNC_PLUG); 770 write_dirty_buffer(bh, WRITE_SYNC);
771 771
772 /* 772 /*
773 * Kick off IO for the previous mapping. Note 773 * Kick off IO for the previous mapping. Note
@@ -1602,14 +1602,8 @@ EXPORT_SYMBOL(unmap_underlying_metadata);
1602 * prevents this contention from occurring. 1602 * prevents this contention from occurring.
1603 * 1603 *
1604 * If block_write_full_page() is called with wbc->sync_mode == 1604 * If block_write_full_page() is called with wbc->sync_mode ==
1605 * WB_SYNC_ALL, the writes are posted using WRITE_SYNC_PLUG; this 1605 * WB_SYNC_ALL, the writes are posted using WRITE_SYNC; this
1606 * causes the writes to be flagged as synchronous writes, but the 1606 * causes the writes to be flagged as synchronous writes.
1607 * block device queue will NOT be unplugged, since usually many pages
1608 * will be pushed to the out before the higher-level caller actually
1609 * waits for the writes to be completed. The various wait functions,
1610 * such as wait_on_writeback_range() will ultimately call sync_page()
1611 * which will ultimately call blk_run_backing_dev(), which will end up
1612 * unplugging the device queue.
1613 */ 1607 */
1614static int __block_write_full_page(struct inode *inode, struct page *page, 1608static int __block_write_full_page(struct inode *inode, struct page *page,
1615 get_block_t *get_block, struct writeback_control *wbc, 1609 get_block_t *get_block, struct writeback_control *wbc,
@@ -1622,7 +1616,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
1622 const unsigned blocksize = 1 << inode->i_blkbits; 1616 const unsigned blocksize = 1 << inode->i_blkbits;
1623 int nr_underway = 0; 1617 int nr_underway = 0;
1624 int write_op = (wbc->sync_mode == WB_SYNC_ALL ? 1618 int write_op = (wbc->sync_mode == WB_SYNC_ALL ?
1625 WRITE_SYNC_PLUG : WRITE); 1619 WRITE_SYNC : WRITE);
1626 1620
1627 BUG_ON(!PageLocked(page)); 1621 BUG_ON(!PageLocked(page));
1628 1622
diff --git a/fs/direct-io.c b/fs/direct-io.c
index df709b3b860a..426083136099 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1173,7 +1173,7 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1173 struct dio *dio; 1173 struct dio *dio;
1174 1174
1175 if (rw & WRITE) 1175 if (rw & WRITE)
1176 rw = WRITE_ODIRECT_PLUG; 1176 rw = WRITE_ODIRECT;
1177 1177
1178 if (bdev) 1178 if (bdev)
1179 bdev_blkbits = blksize_bits(bdev_logical_block_size(bdev)); 1179 bdev_blkbits = blksize_bits(bdev_logical_block_size(bdev));
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 955cc309142f..e2cd90e4bb7c 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -310,8 +310,7 @@ static int io_submit_init(struct ext4_io_submit *io,
310 io_end->offset = (page->index << PAGE_CACHE_SHIFT) + bh_offset(bh); 310 io_end->offset = (page->index << PAGE_CACHE_SHIFT) + bh_offset(bh);
311 311
312 io->io_bio = bio; 312 io->io_bio = bio;
313 io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? 313 io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE);
314 WRITE_SYNC_PLUG : WRITE);
315 io->io_next_block = bh->b_blocknr; 314 io->io_next_block = bh->b_blocknr;
316 return 0; 315 return 0;
317} 316}
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index eb01f3575e10..7f1c11202342 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -121,7 +121,7 @@ __acquires(&sdp->sd_log_lock)
121 lock_buffer(bh); 121 lock_buffer(bh);
122 if (test_clear_buffer_dirty(bh)) { 122 if (test_clear_buffer_dirty(bh)) {
123 bh->b_end_io = end_buffer_write_sync; 123 bh->b_end_io = end_buffer_write_sync;
124 submit_bh(WRITE_SYNC_PLUG, bh); 124 submit_bh(WRITE_SYNC, bh);
125 } else { 125 } else {
126 unlock_buffer(bh); 126 unlock_buffer(bh);
127 brelse(bh); 127 brelse(bh);
@@ -647,7 +647,7 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp)
647 lock_buffer(bh); 647 lock_buffer(bh);
648 if (buffer_mapped(bh) && test_clear_buffer_dirty(bh)) { 648 if (buffer_mapped(bh) && test_clear_buffer_dirty(bh)) {
649 bh->b_end_io = end_buffer_write_sync; 649 bh->b_end_io = end_buffer_write_sync;
650 submit_bh(WRITE_SYNC_PLUG, bh); 650 submit_bh(WRITE_SYNC, bh);
651 } else { 651 } else {
652 unlock_buffer(bh); 652 unlock_buffer(bh);
653 brelse(bh); 653 brelse(bh);
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index bf33f822058d..48b545a1979a 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -200,7 +200,7 @@ static void buf_lo_before_commit(struct gfs2_sbd *sdp)
200 } 200 }
201 201
202 gfs2_log_unlock(sdp); 202 gfs2_log_unlock(sdp);
203 submit_bh(WRITE_SYNC_PLUG, bh); 203 submit_bh(WRITE_SYNC, bh);
204 gfs2_log_lock(sdp); 204 gfs2_log_lock(sdp);
205 205
206 n = 0; 206 n = 0;
@@ -210,7 +210,7 @@ static void buf_lo_before_commit(struct gfs2_sbd *sdp)
210 gfs2_log_unlock(sdp); 210 gfs2_log_unlock(sdp);
211 lock_buffer(bd2->bd_bh); 211 lock_buffer(bd2->bd_bh);
212 bh = gfs2_log_fake_buf(sdp, bd2->bd_bh); 212 bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
213 submit_bh(WRITE_SYNC_PLUG, bh); 213 submit_bh(WRITE_SYNC, bh);
214 gfs2_log_lock(sdp); 214 gfs2_log_lock(sdp);
215 if (++n >= num) 215 if (++n >= num)
216 break; 216 break;
@@ -352,7 +352,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
352 sdp->sd_log_num_revoke--; 352 sdp->sd_log_num_revoke--;
353 353
354 if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) { 354 if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) {
355 submit_bh(WRITE_SYNC_PLUG, bh); 355 submit_bh(WRITE_SYNC, bh);
356 356
357 bh = gfs2_log_get_buf(sdp); 357 bh = gfs2_log_get_buf(sdp);
358 mh = (struct gfs2_meta_header *)bh->b_data; 358 mh = (struct gfs2_meta_header *)bh->b_data;
@@ -369,7 +369,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
369 } 369 }
370 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke); 370 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke);
371 371
372 submit_bh(WRITE_SYNC_PLUG, bh); 372 submit_bh(WRITE_SYNC, bh);
373} 373}
374 374
375static void revoke_lo_before_scan(struct gfs2_jdesc *jd, 375static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
@@ -571,7 +571,7 @@ static void gfs2_write_blocks(struct gfs2_sbd *sdp, struct buffer_head *bh,
571 ptr = bh_log_ptr(bh); 571 ptr = bh_log_ptr(bh);
572 572
573 get_bh(bh); 573 get_bh(bh);
574 submit_bh(WRITE_SYNC_PLUG, bh); 574 submit_bh(WRITE_SYNC, bh);
575 gfs2_log_lock(sdp); 575 gfs2_log_lock(sdp);
576 while(!list_empty(list)) { 576 while(!list_empty(list)) {
577 bd = list_entry(list->next, struct gfs2_bufdata, bd_le.le_list); 577 bd = list_entry(list->next, struct gfs2_bufdata, bd_le.le_list);
@@ -597,7 +597,7 @@ static void gfs2_write_blocks(struct gfs2_sbd *sdp, struct buffer_head *bh,
597 } else { 597 } else {
598 bh1 = gfs2_log_fake_buf(sdp, bd->bd_bh); 598 bh1 = gfs2_log_fake_buf(sdp, bd->bd_bh);
599 } 599 }
600 submit_bh(WRITE_SYNC_PLUG, bh1); 600 submit_bh(WRITE_SYNC, bh1);
601 gfs2_log_lock(sdp); 601 gfs2_log_lock(sdp);
602 ptr += 2; 602 ptr += 2;
603 } 603 }
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index a566331db4e1..867b713cba92 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -37,7 +37,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb
37 struct buffer_head *bh, *head; 37 struct buffer_head *bh, *head;
38 int nr_underway = 0; 38 int nr_underway = 0;
39 int write_op = REQ_META | 39 int write_op = REQ_META |
40 (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC_PLUG : WRITE); 40 (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE);
41 41
42 BUG_ON(!PageLocked(page)); 42 BUG_ON(!PageLocked(page));
43 BUG_ON(!page_has_buffers(page)); 43 BUG_ON(!page_has_buffers(page));
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index 34a4861c14b8..66be299acb1b 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -333,7 +333,7 @@ void journal_commit_transaction(journal_t *journal)
333 * instead we rely on sync_buffer() doing the unplug for us. 333 * instead we rely on sync_buffer() doing the unplug for us.
334 */ 334 */
335 if (commit_transaction->t_synchronous_commit) 335 if (commit_transaction->t_synchronous_commit)
336 write_op = WRITE_SYNC_PLUG; 336 write_op = WRITE_SYNC;
337 spin_lock(&commit_transaction->t_handle_lock); 337 spin_lock(&commit_transaction->t_handle_lock);
338 while (commit_transaction->t_updates) { 338 while (commit_transaction->t_updates) {
339 DEFINE_WAIT(wait); 339 DEFINE_WAIT(wait);
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index f3ad1598b201..3da1cc4346d5 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -137,9 +137,9 @@ static int journal_submit_commit_record(journal_t *journal,
137 if (journal->j_flags & JBD2_BARRIER && 137 if (journal->j_flags & JBD2_BARRIER &&
138 !JBD2_HAS_INCOMPAT_FEATURE(journal, 138 !JBD2_HAS_INCOMPAT_FEATURE(journal,
139 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) 139 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT))
140 ret = submit_bh(WRITE_SYNC_PLUG | WRITE_FLUSH_FUA, bh); 140 ret = submit_bh(WRITE_SYNC | WRITE_FLUSH_FUA, bh);
141 else 141 else
142 ret = submit_bh(WRITE_SYNC_PLUG, bh); 142 ret = submit_bh(WRITE_SYNC, bh);
143 143
144 *cbh = bh; 144 *cbh = bh;
145 return ret; 145 return ret;
@@ -369,7 +369,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
369 * instead we rely on sync_buffer() doing the unplug for us. 369 * instead we rely on sync_buffer() doing the unplug for us.
370 */ 370 */
371 if (commit_transaction->t_synchronous_commit) 371 if (commit_transaction->t_synchronous_commit)
372 write_op = WRITE_SYNC_PLUG; 372 write_op = WRITE_SYNC;
373 trace_jbd2_commit_locking(journal, commit_transaction); 373 trace_jbd2_commit_locking(journal, commit_transaction);
374 stats.run.rs_wait = commit_transaction->t_max_wait; 374 stats.run.rs_wait = commit_transaction->t_max_wait;
375 stats.run.rs_locked = jiffies; 375 stats.run.rs_locked = jiffies;
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 0f83e93935b2..2853ff20f85a 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -509,7 +509,7 @@ static int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf,
509 * Last BIO is always sent through the following 509 * Last BIO is always sent through the following
510 * submission. 510 * submission.
511 */ 511 */
512 rw |= REQ_SYNC | REQ_UNPLUG; 512 rw |= REQ_SYNC;
513 res = nilfs_segbuf_submit_bio(segbuf, &wi, rw); 513 res = nilfs_segbuf_submit_bio(segbuf, &wi, rw);
514 } 514 }
515 515
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 83c1c20d145a..6bbb0ee33253 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -413,8 +413,7 @@ xfs_submit_ioend_bio(
413 if (xfs_ioend_new_eof(ioend)) 413 if (xfs_ioend_new_eof(ioend))
414 xfs_mark_inode_dirty(XFS_I(ioend->io_inode)); 414 xfs_mark_inode_dirty(XFS_I(ioend->io_inode));
415 415
416 submit_bio(wbc->sync_mode == WB_SYNC_ALL ? 416 submit_bio(wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE, bio);
417 WRITE_SYNC_PLUG : WRITE, bio);
418} 417}
419 418
420STATIC struct bio * 419STATIC struct bio *