aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/dev_bdev.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-04-04 22:37:28 -0400
committerTejun Heo <tj@kernel.org>2010-04-04 22:37:28 -0400
commit336f5899d287f06d8329e208fc14ce50f7ec9698 (patch)
tree9b762d450d5eb248a6ff8317badb7e223d93ed58 /fs/logfs/dev_bdev.c
parenta4ab2773205e8b94c18625455f85e3b6bb9d7ad6 (diff)
parentdb217dece3003df0841bacf9556b5c06aa097dae (diff)
Merge branch 'master' into export-slabh
Diffstat (limited to 'fs/logfs/dev_bdev.c')
-rw-r--r--fs/logfs/dev_bdev.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c
index 18e8c144c7f1..243c00071f76 100644
--- a/fs/logfs/dev_bdev.c
+++ b/fs/logfs/dev_bdev.c
@@ -81,6 +81,7 @@ static void writeseg_end_io(struct bio *bio, int err)
81 prefetchw(&bvec->bv_page->flags); 81 prefetchw(&bvec->bv_page->flags);
82 82
83 end_page_writeback(page); 83 end_page_writeback(page);
84 page_cache_release(page);
84 } while (bvec >= bio->bi_io_vec); 85 } while (bvec >= bio->bi_io_vec);
85 bio_put(bio); 86 bio_put(bio);
86 if (atomic_dec_and_test(&super->s_pending_writes)) 87 if (atomic_dec_and_test(&super->s_pending_writes))
@@ -98,8 +99,10 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index,
98 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9); 99 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
99 int i; 100 int i;
100 101
102 if (max_pages > BIO_MAX_PAGES)
103 max_pages = BIO_MAX_PAGES;
101 bio = bio_alloc(GFP_NOFS, max_pages); 104 bio = bio_alloc(GFP_NOFS, max_pages);
102 BUG_ON(!bio); /* FIXME: handle this */ 105 BUG_ON(!bio);
103 106
104 for (i = 0; i < nr_pages; i++) { 107 for (i = 0; i < nr_pages; i++) {
105 if (i >= max_pages) { 108 if (i >= max_pages) {
@@ -192,8 +195,10 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index,
192 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9); 195 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
193 int i; 196 int i;
194 197
198 if (max_pages > BIO_MAX_PAGES)
199 max_pages = BIO_MAX_PAGES;
195 bio = bio_alloc(GFP_NOFS, max_pages); 200 bio = bio_alloc(GFP_NOFS, max_pages);
196 BUG_ON(!bio); /* FIXME: handle this */ 201 BUG_ON(!bio);
197 202
198 for (i = 0; i < nr_pages; i++) { 203 for (i = 0; i < nr_pages; i++) {
199 if (i >= max_pages) { 204 if (i >= max_pages) {