aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/dev_bdev.c
diff options
context:
space:
mode:
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 9718c22f186d..a5d0c56d3ebc 100644
--- a/fs/logfs/dev_bdev.c
+++ b/fs/logfs/dev_bdev.c
@@ -80,6 +80,7 @@ static void writeseg_end_io(struct bio *bio, int err)
80 prefetchw(&bvec->bv_page->flags); 80 prefetchw(&bvec->bv_page->flags);
81 81
82 end_page_writeback(page); 82 end_page_writeback(page);
83 page_cache_release(page);
83 } while (bvec >= bio->bi_io_vec); 84 } while (bvec >= bio->bi_io_vec);
84 bio_put(bio); 85 bio_put(bio);
85 if (atomic_dec_and_test(&super->s_pending_writes)) 86 if (atomic_dec_and_test(&super->s_pending_writes))
@@ -97,8 +98,10 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index,
97 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9); 98 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
98 int i; 99 int i;
99 100
101 if (max_pages > BIO_MAX_PAGES)
102 max_pages = BIO_MAX_PAGES;
100 bio = bio_alloc(GFP_NOFS, max_pages); 103 bio = bio_alloc(GFP_NOFS, max_pages);
101 BUG_ON(!bio); /* FIXME: handle this */ 104 BUG_ON(!bio);
102 105
103 for (i = 0; i < nr_pages; i++) { 106 for (i = 0; i < nr_pages; i++) {
104 if (i >= max_pages) { 107 if (i >= max_pages) {
@@ -191,8 +194,10 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index,
191 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9); 194 unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
192 int i; 195 int i;
193 196
197 if (max_pages > BIO_MAX_PAGES)
198 max_pages = BIO_MAX_PAGES;
194 bio = bio_alloc(GFP_NOFS, max_pages); 199 bio = bio_alloc(GFP_NOFS, max_pages);
195 BUG_ON(!bio); /* FIXME: handle this */ 200 BUG_ON(!bio);
196 201
197 for (i = 0; i < nr_pages; i++) { 202 for (i = 0; i < nr_pages; i++) {
198 if (i >= max_pages) { 203 if (i >= max_pages) {