checkpoint.c (551414861fbd494d58d50f4750d1d1b7f42b6df1) checkpoint.c (3c64298579a1343cbdf3d2f17adf774a58546aae)
1/*
2 * fs/f2fs/checkpoint.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 450 unchanged lines hidden (view full) ---

459 clear_nlink(inode);
460
461 /* truncate all the data during iput */
462 iput(inode);
463}
464
465void recover_orphan_inodes(struct f2fs_sb_info *sbi)
466{
1/*
2 * fs/f2fs/checkpoint.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 450 unchanged lines hidden (view full) ---

459 clear_nlink(inode);
460
461 /* truncate all the data during iput */
462 iput(inode);
463}
464
465void recover_orphan_inodes(struct f2fs_sb_info *sbi)
466{
467 block_t start_blk, orphan_blkaddr, i, j;
467 block_t start_blk, orphan_blocks, i, j;
468
469 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG))
470 return;
471
472 set_sbi_flag(sbi, SBI_POR_DOING);
473
474 start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi);
468
469 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG))
470 return;
471
472 set_sbi_flag(sbi, SBI_POR_DOING);
473
474 start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi);
475 orphan_blkaddr = __start_sum_addr(sbi) - 1;
475 orphan_blocks = __start_sum_addr(sbi) - 1 - __cp_payload(sbi);
476
476
477 ra_meta_pages(sbi, start_blk, orphan_blkaddr, META_CP);
477 ra_meta_pages(sbi, start_blk, orphan_blocks, META_CP);
478
478
479 for (i = 0; i < orphan_blkaddr; i++) {
479 for (i = 0; i < orphan_blocks; i++) {
480 struct page *page = get_meta_page(sbi, start_blk + i);
481 struct f2fs_orphan_block *orphan_blk;
482
483 orphan_blk = (struct f2fs_orphan_block *)page_address(page);
484 for (j = 0; j < le32_to_cpu(orphan_blk->entry_count); j++) {
485 nid_t ino = le32_to_cpu(orphan_blk->ino[j]);
486 recover_orphan_inode(sbi, ino);
487 }

--- 647 unchanged lines hidden ---
480 struct page *page = get_meta_page(sbi, start_blk + i);
481 struct f2fs_orphan_block *orphan_blk;
482
483 orphan_blk = (struct f2fs_orphan_block *)page_address(page);
484 for (j = 0; j < le32_to_cpu(orphan_blk->entry_count); j++) {
485 nid_t ino = le32_to_cpu(orphan_blk->ino[j]);
486 recover_orphan_inode(sbi, ino);
487 }

--- 647 unchanged lines hidden ---