diff options
author | Nathan Scott <nathans@sgi.com> | 2005-09-02 02:39:56 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-09-02 02:39:56 -0400 |
commit | eedb5530aad71aecbc1e99cb67f676c26280d3f9 (patch) | |
tree | 613ddae544b533a9051fd3bb8a733aaf6133961e /fs/xfs/linux-2.6/xfs_buf.c | |
parent | cdb626878f6f5e37d678d30c9cacf5726b88a656 (diff) |
[XFS] Make metadata IO completion consistent with other IO completion
handlers.
SGI-PV: 938409
SGI-Modid: xfs-linux:xfs-kern:22965a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index df0cba239dd5..58286b1d733b 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of version 2 of the GNU General Public License as | 5 | * under the terms of version 2 of the GNU General Public License as |
@@ -1249,8 +1249,8 @@ bio_end_io_pagebuf( | |||
1249 | int error) | 1249 | int error) |
1250 | { | 1250 | { |
1251 | xfs_buf_t *pb = (xfs_buf_t *)bio->bi_private; | 1251 | xfs_buf_t *pb = (xfs_buf_t *)bio->bi_private; |
1252 | unsigned int i, blocksize = pb->pb_target->pbr_bsize; | 1252 | unsigned int blocksize = pb->pb_target->pbr_bsize; |
1253 | struct bio_vec *bvec = bio->bi_io_vec; | 1253 | struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; |
1254 | 1254 | ||
1255 | if (bio->bi_size) | 1255 | if (bio->bi_size) |
1256 | return 1; | 1256 | return 1; |
@@ -1258,10 +1258,12 @@ bio_end_io_pagebuf( | |||
1258 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) | 1258 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) |
1259 | pb->pb_error = EIO; | 1259 | pb->pb_error = EIO; |
1260 | 1260 | ||
1261 | for (i = 0; i < bio->bi_vcnt; i++, bvec++) { | 1261 | do { |
1262 | struct page *page = bvec->bv_page; | 1262 | struct page *page = bvec->bv_page; |
1263 | 1263 | ||
1264 | if (pb->pb_error) { | 1264 | if (unlikely(pb->pb_error)) { |
1265 | if (pb->pb_flags & PBF_READ) | ||
1266 | ClearPageUptodate(page); | ||
1265 | SetPageError(page); | 1267 | SetPageError(page); |
1266 | } else if (blocksize == PAGE_CACHE_SIZE) { | 1268 | } else if (blocksize == PAGE_CACHE_SIZE) { |
1267 | SetPageUptodate(page); | 1269 | SetPageUptodate(page); |
@@ -1270,10 +1272,13 @@ bio_end_io_pagebuf( | |||
1270 | set_page_region(page, bvec->bv_offset, bvec->bv_len); | 1272 | set_page_region(page, bvec->bv_offset, bvec->bv_len); |
1271 | } | 1273 | } |
1272 | 1274 | ||
1275 | if (--bvec >= bio->bi_io_vec) | ||
1276 | prefetchw(&bvec->bv_page->flags); | ||
1277 | |||
1273 | if (_pagebuf_iolocked(pb)) { | 1278 | if (_pagebuf_iolocked(pb)) { |
1274 | unlock_page(page); | 1279 | unlock_page(page); |
1275 | } | 1280 | } |
1276 | } | 1281 | } while (bvec >= bio->bi_io_vec); |
1277 | 1282 | ||
1278 | _pagebuf_iodone(pb, 1); | 1283 | _pagebuf_iodone(pb, 1); |
1279 | bio_put(bio); | 1284 | bio_put(bio); |