diff options
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r-- | fs/f2fs/checkpoint.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index f9d4f7de75ad..ed82de6bfb47 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c | |||
@@ -311,11 +311,10 @@ static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk) | |||
311 | unsigned short orphan_blocks = (unsigned short)((sbi->n_orphans + | 311 | unsigned short orphan_blocks = (unsigned short)((sbi->n_orphans + |
312 | (F2FS_ORPHANS_PER_BLOCK - 1)) / F2FS_ORPHANS_PER_BLOCK); | 312 | (F2FS_ORPHANS_PER_BLOCK - 1)) / F2FS_ORPHANS_PER_BLOCK); |
313 | struct page *page = NULL; | 313 | struct page *page = NULL; |
314 | struct page *pages[orphan_blocks]; | ||
315 | struct orphan_inode_entry *orphan = NULL; | 314 | struct orphan_inode_entry *orphan = NULL; |
316 | 315 | ||
317 | for (index = 0; index < orphan_blocks; index++) | 316 | for (index = 0; index < orphan_blocks; index++) |
318 | pages[index] = grab_meta_page(sbi, start_blk + index); | 317 | grab_meta_page(sbi, start_blk + index); |
319 | 318 | ||
320 | index = 1; | 319 | index = 1; |
321 | spin_lock(&sbi->orphan_inode_lock); | 320 | spin_lock(&sbi->orphan_inode_lock); |
@@ -324,10 +323,12 @@ static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk) | |||
324 | /* loop for each orphan inode entry and write them in Jornal block */ | 323 | /* loop for each orphan inode entry and write them in Jornal block */ |
325 | list_for_each_entry(orphan, head, list) { | 324 | list_for_each_entry(orphan, head, list) { |
326 | if (!page) { | 325 | if (!page) { |
327 | page = pages[index - 1]; | 326 | page = find_get_page(META_MAPPING(sbi), start_blk++); |
327 | f2fs_bug_on(!page); | ||
328 | orphan_blk = | 328 | orphan_blk = |
329 | (struct f2fs_orphan_block *)page_address(page); | 329 | (struct f2fs_orphan_block *)page_address(page); |
330 | memset(orphan_blk, 0, sizeof(*orphan_blk)); | 330 | memset(orphan_blk, 0, sizeof(*orphan_blk)); |
331 | f2fs_put_page(page, 0); | ||
331 | } | 332 | } |
332 | 333 | ||
333 | orphan_blk->ino[nentries++] = cpu_to_le32(orphan->ino); | 334 | orphan_blk->ino[nentries++] = cpu_to_le32(orphan->ino); |