Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230707
b: refs/heads/master
c: c32b0d4
h: refs/heads/master
i:
  230705: b873f8a
  230703: b6bc0c0
v: v3
  • Loading branch information
Hai Shan authored and Linus Torvalds committed Jan 14, 2011
1 parent f445023 commit 4fd28d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9cbb4cb21b19fff46cf1174d0ed699ef710e641c
refs/heads/master: c32b0d4b3f19c2f5d29568f8b7b72b61693f1277
49 changes: 17 additions & 32 deletions trunk/fs/mpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* status of that page is hard. See end_buffer_async_read() for the details.
* There is no point in duplicating all that complexity.
*/
static void mpage_end_io_read(struct bio *bio, int err)
static void mpage_end_io(struct bio *bio, int err)
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
Expand All @@ -50,44 +50,29 @@ static void mpage_end_io_read(struct bio *bio, int err)

if (--bvec >= bio->bi_io_vec)
prefetchw(&bvec->bv_page->flags);

if (uptodate) {
SetPageUptodate(page);
} else {
ClearPageUptodate(page);
SetPageError(page);
}
unlock_page(page);
} while (bvec >= bio->bi_io_vec);
bio_put(bio);
}

static void mpage_end_io_write(struct bio *bio, int err)
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;

do {
struct page *page = bvec->bv_page;

if (--bvec >= bio->bi_io_vec)
prefetchw(&bvec->bv_page->flags);

if (!uptodate){
SetPageError(page);
if (page->mapping)
set_bit(AS_EIO, &page->mapping->flags);
if (bio_data_dir(bio) == READ) {
if (uptodate) {
SetPageUptodate(page);
} else {
ClearPageUptodate(page);
SetPageError(page);
}
unlock_page(page);
} else { /* bio_data_dir(bio) == WRITE */
if (!uptodate) {
SetPageError(page);
if (page->mapping)
set_bit(AS_EIO, &page->mapping->flags);
}
end_page_writeback(page);
}
end_page_writeback(page);
} while (bvec >= bio->bi_io_vec);
bio_put(bio);
}

static struct bio *mpage_bio_submit(int rw, struct bio *bio)
{
bio->bi_end_io = mpage_end_io_read;
if (rw == WRITE)
bio->bi_end_io = mpage_end_io_write;
bio->bi_end_io = mpage_end_io;
submit_bio(rw, bio);
return NULL;
}
Expand Down

0 comments on commit 4fd28d1

Please sign in to comment.