gc.c (d27998185da8fbdc35911307ae13518d168778d7) gc.c (1ad71a27124caf0b68ddd3c92be01aa2b2a72b2a)
1/*
2 * fs/f2fs/gc.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

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

619 return;
620
621 if (!check_valid_map(F2FS_I_SB(inode), segno, off))
622 goto out;
623
624 if (f2fs_is_atomic_file(inode))
625 goto out;
626
1/*
2 * fs/f2fs/gc.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

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

619 return;
620
621 if (!check_valid_map(F2FS_I_SB(inode), segno, off))
622 goto out;
623
624 if (f2fs_is_atomic_file(inode))
625 goto out;
626
627 if (f2fs_is_pinned_file(inode)) {
628 f2fs_pin_file_control(inode, true);
629 goto out;
630 }
631
627 set_new_dnode(&dn, inode, NULL, NULL, 0);
628 err = get_dnode_of_data(&dn, bidx, LOOKUP_NODE);
629 if (err)
630 goto out;
631
632 if (unlikely(dn.data_blkaddr == NULL_ADDR)) {
633 ClearPageUptodate(page);
634 goto put_out;

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

715 if (IS_ERR(page))
716 return;
717
718 if (!check_valid_map(F2FS_I_SB(inode), segno, off))
719 goto out;
720
721 if (f2fs_is_atomic_file(inode))
722 goto out;
632 set_new_dnode(&dn, inode, NULL, NULL, 0);
633 err = get_dnode_of_data(&dn, bidx, LOOKUP_NODE);
634 if (err)
635 goto out;
636
637 if (unlikely(dn.data_blkaddr == NULL_ADDR)) {
638 ClearPageUptodate(page);
639 goto put_out;

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

720 if (IS_ERR(page))
721 return;
722
723 if (!check_valid_map(F2FS_I_SB(inode), segno, off))
724 goto out;
725
726 if (f2fs_is_atomic_file(inode))
727 goto out;
728 if (f2fs_is_pinned_file(inode)) {
729 if (gc_type == FG_GC)
730 f2fs_pin_file_control(inode, true);
731 goto out;
732 }
723
724 if (gc_type == BG_GC) {
725 if (PageWriteback(page))
726 goto out;
727 set_page_dirty(page);
728 set_cold_data(page);
729 } else {
730 struct f2fs_io_info fio = {

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

1086
1087 /* threshold of # of valid blocks in a section for victims of FG_GC */
1088 main_count = SM_I(sbi)->main_segments << sbi->log_blocks_per_seg;
1089 resv_count = SM_I(sbi)->reserved_segments << sbi->log_blocks_per_seg;
1090 ovp_count = SM_I(sbi)->ovp_segments << sbi->log_blocks_per_seg;
1091
1092 sbi->fggc_threshold = div64_u64((main_count - ovp_count) *
1093 BLKS_PER_SEC(sbi), (main_count - resv_count));
733
734 if (gc_type == BG_GC) {
735 if (PageWriteback(page))
736 goto out;
737 set_page_dirty(page);
738 set_cold_data(page);
739 } else {
740 struct f2fs_io_info fio = {

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

1096
1097 /* threshold of # of valid blocks in a section for victims of FG_GC */
1098 main_count = SM_I(sbi)->main_segments << sbi->log_blocks_per_seg;
1099 resv_count = SM_I(sbi)->reserved_segments << sbi->log_blocks_per_seg;
1100 ovp_count = SM_I(sbi)->ovp_segments << sbi->log_blocks_per_seg;
1101
1102 sbi->fggc_threshold = div64_u64((main_count - ovp_count) *
1103 BLKS_PER_SEC(sbi), (main_count - resv_count));
1104 sbi->gc_pin_file_threshold = DEF_GC_FAILED_PINNED_FILES;
1094
1095 /* give warm/cold data area from slower device */
1096 if (sbi->s_ndevs && sbi->segs_per_sec == 1)
1097 SIT_I(sbi)->last_victim[ALLOC_NEXT] =
1098 GET_SEGNO(sbi, FDEV(0).end_blk) + 1;
1099}
1105
1106 /* give warm/cold data area from slower device */
1107 if (sbi->s_ndevs && sbi->segs_per_sec == 1)
1108 SIT_I(sbi)->last_victim[ALLOC_NEXT] =
1109 GET_SEGNO(sbi, FDEV(0).end_blk) + 1;
1110}