Commit 221cb251 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent 85da94c6
...@@ -380,26 +380,18 @@ xfs_submit_ioend_bio( ...@@ -380,26 +380,18 @@ xfs_submit_ioend_bio(
submit_bio(wbc->sync_mode == WB_SYNC_ALL ? submit_bio(wbc->sync_mode == WB_SYNC_ALL ?
WRITE_SYNC_PLUG : WRITE, bio); WRITE_SYNC_PLUG : WRITE, bio);
ASSERT(!bio_flagged(bio, BIO_EOPNOTSUPP));
bio_put(bio);
} }
STATIC struct bio * STATIC struct bio *
xfs_alloc_ioend_bio( xfs_alloc_ioend_bio(
struct buffer_head *bh) struct buffer_head *bh)
{ {
struct bio *bio;
int nvecs = bio_get_nr_vecs(bh->b_bdev); int nvecs = bio_get_nr_vecs(bh->b_bdev);
struct bio *bio = bio_alloc(GFP_NOIO, nvecs);
do {
bio = bio_alloc(GFP_NOIO, nvecs);
nvecs >>= 1;
} while (!bio);
ASSERT(bio->bi_private == NULL); ASSERT(bio->bi_private == NULL);
bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9); bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9);
bio->bi_bdev = bh->b_bdev; bio->bi_bdev = bh->b_bdev;
bio_get(bio);
return bio; return bio;
} }
...@@ -470,9 +462,8 @@ xfs_submit_ioend( ...@@ -470,9 +462,8 @@ xfs_submit_ioend(
/* Pass 1 - start writeback */ /* Pass 1 - start writeback */
do { do {
next = ioend->io_list; next = ioend->io_list;
for (bh = ioend->io_buffer_head; bh; bh = bh->b_private) { for (bh = ioend->io_buffer_head; bh; bh = bh->b_private)
xfs_start_buffer_writeback(bh); xfs_start_buffer_writeback(bh);
}
} while ((ioend = next) != NULL); } while ((ioend = next) != NULL);
/* Pass 2 - submit I/O */ /* Pass 2 - submit I/O */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment