aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-12-10 03:42:17 -0500
committerAlex Elder <aelder@sgi.com>2010-12-16 17:05:40 -0500
commit221cb2517e8fc9a1d67c7a8a9c19fc5a916b583f (patch)
tree891f7a8f1063f862a8c4d76882a0606191813fca /fs
parent85da94c6b4666582c38579ccdcd90a5d9b5697ef (diff)
xfs: remove some dead bio handling code
We'll never have BIO_EOPNOTSUPP set after calling submit_bio as this can only happen for discards, and used to happen for barriers, none of which is every submitted by xfs_submit_ioend_bio. Also remove the loop around bio_alloc as it will never fail due to it's mempool backing. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 23a7668e07d..ca67ae92c23 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -380,26 +380,18 @@ xfs_submit_ioend_bio(
380 380
381 submit_bio(wbc->sync_mode == WB_SYNC_ALL ? 381 submit_bio(wbc->sync_mode == WB_SYNC_ALL ?
382 WRITE_SYNC_PLUG : WRITE, bio); 382 WRITE_SYNC_PLUG : WRITE, bio);
383 ASSERT(!bio_flagged(bio, BIO_EOPNOTSUPP));
384 bio_put(bio);
385} 383}
386 384
387STATIC struct bio * 385STATIC struct bio *
388xfs_alloc_ioend_bio( 386xfs_alloc_ioend_bio(
389 struct buffer_head *bh) 387 struct buffer_head *bh)
390{ 388{
391 struct bio *bio;
392 int nvecs = bio_get_nr_vecs(bh->b_bdev); 389 int nvecs = bio_get_nr_vecs(bh->b_bdev);
393 390 struct bio *bio = bio_alloc(GFP_NOIO, nvecs);
394 do {
395 bio = bio_alloc(GFP_NOIO, nvecs);
396 nvecs >>= 1;
397 } while (!bio);
398 391
399 ASSERT(bio->bi_private == NULL); 392 ASSERT(bio->bi_private == NULL);
400 bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9); 393 bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9);
401 bio->bi_bdev = bh->b_bdev; 394 bio->bi_bdev = bh->b_bdev;
402 bio_get(bio);
403 return bio; 395 return bio;
404} 396}
405 397
@@ -470,9 +462,8 @@ xfs_submit_ioend(
470 /* Pass 1 - start writeback */ 462 /* Pass 1 - start writeback */
471 do { 463 do {
472 next = ioend->io_list; 464 next = ioend->io_list;
473 for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { 465 for (bh = ioend->io_buffer_head; bh; bh = bh->b_private)
474 xfs_start_buffer_writeback(bh); 466 xfs_start_buffer_writeback(bh);
475 }
476 } while ((ioend = next) != NULL); 467 } while ((ioend = next) != NULL);
477 468
478 /* Pass 2 - submit I/O */ 469 /* Pass 2 - submit I/O */