aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_map.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-19 09:23:05 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:57 -0400
commit0a2118dfd4c328e8823cdcfebf839dff73ac21e9 (patch)
treeb154f28d366a43e6caab1a2276ec40a28b977a77 /fs/btrfs/extent_map.c
parentae2f5411c4ce7180cca8418853db50c8e52d40db (diff)
Btrfs: Fix bi_end_io() functions on > 2.6.23 kernels
It now returns void and it is never called for partial completions, so the bio->bi_size check must go. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r--fs/btrfs/extent_map.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 89d0ebd0ea83..c0f834563ced 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -9,6 +9,7 @@
9#include <linux/spinlock.h> 9#include <linux/spinlock.h>
10#include <linux/blkdev.h> 10#include <linux/blkdev.h>
11#include <linux/swap.h> 11#include <linux/swap.h>
12#include <linux/version.h>
12#include "extent_map.h" 13#include "extent_map.h"
13 14
14/* temporary define until extent_map moves out of btrfs */ 15/* temporary define until extent_map moves out of btrfs */
@@ -1274,8 +1275,12 @@ static int check_page_writeback(struct extent_map_tree *tree,
1274 * Scheduling is not allowed, so the extent state tree is expected 1275 * Scheduling is not allowed, so the extent state tree is expected
1275 * to have one and only one object corresponding to this IO. 1276 * to have one and only one object corresponding to this IO.
1276 */ 1277 */
1278#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
1279static void end_bio_extent_writepage(struct bio *bio, int err)
1280#else
1277static int end_bio_extent_writepage(struct bio *bio, 1281static int end_bio_extent_writepage(struct bio *bio,
1278 unsigned int bytes_done, int err) 1282 unsigned int bytes_done, int err)
1283#endif
1279{ 1284{
1280 const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 1285 const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
1281 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; 1286 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
@@ -1284,8 +1289,10 @@ static int end_bio_extent_writepage(struct bio *bio,
1284 u64 end; 1289 u64 end;
1285 int whole_page; 1290 int whole_page;
1286 1291
1292#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
1287 if (bio->bi_size) 1293 if (bio->bi_size)
1288 return 1; 1294 return 1;
1295#endif
1289 1296
1290 do { 1297 do {
1291 struct page *page = bvec->bv_page; 1298 struct page *page = bvec->bv_page;
@@ -1316,7 +1323,9 @@ static int end_bio_extent_writepage(struct bio *bio,
1316 } while (bvec >= bio->bi_io_vec); 1323 } while (bvec >= bio->bi_io_vec);
1317 1324
1318 bio_put(bio); 1325 bio_put(bio);
1326#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
1319 return 0; 1327 return 0;
1328#endif
1320} 1329}
1321 1330
1322/* 1331/*
@@ -1330,8 +1339,12 @@ static int end_bio_extent_writepage(struct bio *bio,
1330 * Scheduling is not allowed, so the extent state tree is expected 1339 * Scheduling is not allowed, so the extent state tree is expected
1331 * to have one and only one object corresponding to this IO. 1340 * to have one and only one object corresponding to this IO.
1332 */ 1341 */
1342#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
1343static void end_bio_extent_readpage(struct bio *bio, int err)
1344#else
1333static int end_bio_extent_readpage(struct bio *bio, 1345static int end_bio_extent_readpage(struct bio *bio,
1334 unsigned int bytes_done, int err) 1346 unsigned int bytes_done, int err)
1347#endif
1335{ 1348{
1336 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 1349 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
1337 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; 1350 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
@@ -1341,8 +1354,10 @@ static int end_bio_extent_readpage(struct bio *bio,
1341 int whole_page; 1354 int whole_page;
1342 int ret; 1355 int ret;
1343 1356
1357#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
1344 if (bio->bi_size) 1358 if (bio->bi_size)
1345 return 1; 1359 return 1;
1360#endif
1346 1361
1347 do { 1362 do {
1348 struct page *page = bvec->bv_page; 1363 struct page *page = bvec->bv_page;
@@ -1382,7 +1397,9 @@ static int end_bio_extent_readpage(struct bio *bio,
1382 } while (bvec >= bio->bi_io_vec); 1397 } while (bvec >= bio->bi_io_vec);
1383 1398
1384 bio_put(bio); 1399 bio_put(bio);
1400#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
1385 return 0; 1401 return 0;
1402#endif
1386} 1403}
1387 1404
1388/* 1405/*
@@ -1390,8 +1407,12 @@ static int end_bio_extent_readpage(struct bio *bio,
1390 * the structs in the extent tree when done, and set the uptodate bits 1407 * the structs in the extent tree when done, and set the uptodate bits
1391 * as appropriate. 1408 * as appropriate.
1392 */ 1409 */
1410#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
1411static void end_bio_extent_preparewrite(struct bio *bio, int err)
1412#else
1393static int end_bio_extent_preparewrite(struct bio *bio, 1413static int end_bio_extent_preparewrite(struct bio *bio,
1394 unsigned int bytes_done, int err) 1414 unsigned int bytes_done, int err)
1415#endif
1395{ 1416{
1396 const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 1417 const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
1397 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; 1418 struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
@@ -1399,8 +1420,10 @@ static int end_bio_extent_preparewrite(struct bio *bio,
1399 u64 start; 1420 u64 start;
1400 u64 end; 1421 u64 end;
1401 1422
1423#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
1402 if (bio->bi_size) 1424 if (bio->bi_size)
1403 return 1; 1425 return 1;
1426#endif
1404 1427
1405 do { 1428 do {
1406 struct page *page = bvec->bv_page; 1429 struct page *page = bvec->bv_page;
@@ -1422,7 +1445,9 @@ static int end_bio_extent_preparewrite(struct bio *bio,
1422 } while (bvec >= bio->bi_io_vec); 1445 } while (bvec >= bio->bi_io_vec);
1423 1446
1424 bio_put(bio); 1447 bio_put(bio);
1448#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
1425 return 0; 1449 return 0;
1450#endif
1426} 1451}
1427 1452
1428static int submit_extent_page(int rw, struct extent_map_tree *tree, 1453static int submit_extent_page(int rw, struct extent_map_tree *tree,