Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128501
b: refs/heads/master
c: 0a2118d
h: refs/heads/master
i:
  128499: e5c99ac
v: v3
  • Loading branch information
Jens Axboe authored and Chris Mason committed Sep 25, 2008
1 parent f8e772f commit 44df15f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae2f5411c4ce7180cca8418853db50c8e52d40db
refs/heads/master: 0a2118dfd4c328e8823cdcfebf839dff73ac21e9
25 changes: 25 additions & 0 deletions trunk/fs/btrfs/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/spinlock.h>
#include <linux/blkdev.h>
#include <linux/swap.h>
#include <linux/version.h>
#include "extent_map.h"

/* temporary define until extent_map moves out of btrfs */
Expand Down Expand Up @@ -1274,8 +1275,12 @@ static int check_page_writeback(struct extent_map_tree *tree,
* Scheduling is not allowed, so the extent state tree is expected
* to have one and only one object corresponding to this IO.
*/
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
static void end_bio_extent_writepage(struct bio *bio, int err)
#else
static int end_bio_extent_writepage(struct bio *bio,
unsigned int bytes_done, int err)
#endif
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
Expand All @@ -1284,8 +1289,10 @@ static int end_bio_extent_writepage(struct bio *bio,
u64 end;
int whole_page;

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
if (bio->bi_size)
return 1;
#endif

do {
struct page *page = bvec->bv_page;
Expand Down Expand Up @@ -1316,7 +1323,9 @@ static int end_bio_extent_writepage(struct bio *bio,
} while (bvec >= bio->bi_io_vec);

bio_put(bio);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
return 0;
#endif
}

/*
Expand All @@ -1330,8 +1339,12 @@ static int end_bio_extent_writepage(struct bio *bio,
* Scheduling is not allowed, so the extent state tree is expected
* to have one and only one object corresponding to this IO.
*/
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
static void end_bio_extent_readpage(struct bio *bio, int err)
#else
static int end_bio_extent_readpage(struct bio *bio,
unsigned int bytes_done, int err)
#endif
{
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
Expand All @@ -1341,8 +1354,10 @@ static int end_bio_extent_readpage(struct bio *bio,
int whole_page;
int ret;

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
if (bio->bi_size)
return 1;
#endif

do {
struct page *page = bvec->bv_page;
Expand Down Expand Up @@ -1382,25 +1397,33 @@ static int end_bio_extent_readpage(struct bio *bio,
} while (bvec >= bio->bi_io_vec);

bio_put(bio);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
return 0;
#endif
}

/*
* IO done from prepare_write is pretty simple, we just unlock
* the structs in the extent tree when done, and set the uptodate bits
* as appropriate.
*/
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)
static void end_bio_extent_preparewrite(struct bio *bio, int err)
#else
static int end_bio_extent_preparewrite(struct bio *bio,
unsigned int bytes_done, int err)
#endif
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
struct extent_map_tree *tree = bio->bi_private;
u64 start;
u64 end;

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
if (bio->bi_size)
return 1;
#endif

do {
struct page *page = bvec->bv_page;
Expand All @@ -1422,7 +1445,9 @@ static int end_bio_extent_preparewrite(struct bio *bio,
} while (bvec >= bio->bi_io_vec);

bio_put(bio);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
return 0;
#endif
}

static int submit_extent_page(int rw, struct extent_map_tree *tree,
Expand Down

0 comments on commit 44df15f

Please sign in to comment.