Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45719
b: refs/heads/master
c: cda9205
h: refs/heads/master
i:
  45717: 32be373
  45715: b5d637d
  45711: 16e0982
v: v3
  • Loading branch information
Chen, Kenneth W authored and Linus Torvalds committed Jan 23, 2007
1 parent 358efb1 commit 1985782
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 15c945c3d0913d73a7d57d7a0a3c4e2902598cc6
refs/heads/master: cda9205da24aeaa8fb086b0fb85cdf39571ecc3f
8 changes: 8 additions & 0 deletions trunk/fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ static struct page *blk_get_page(unsigned long addr, size_t count, int rw,
return pvec->page[pvec->idx++];
}

/* return a page back to pvec array */
static void blk_unget_page(struct page *page, struct pvec *pvec)
{
pvec->page[--pvec->idx] = page;
}

static ssize_t
blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
loff_t pos, unsigned long nr_segs)
Expand Down Expand Up @@ -278,6 +284,8 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
count = min(count, nbytes);
goto same_bio;
}
} else {
blk_unget_page(page, &pvec);
}

/* bio is ready, submit it */
Expand Down

0 comments on commit 1985782

Please sign in to comment.