Lines Matching refs:curseg
2538 struct curseg_info *curseg = CURSEG_I(sbi, type);
2542 return curseg->next_blkoff;
2600 struct curseg_info *curseg = CURSEG_I(sbi, type);
2602 struct f2fs_summary_block *src = curseg->sum_blk;
2608 mutex_lock(&curseg->curseg_mutex);
2610 down_read(&curseg->journal_rwsem);
2611 memcpy(&dst->journal, curseg->journal, SUM_JOURNAL_SIZE);
2612 up_read(&curseg->journal_rwsem);
2617 mutex_unlock(&curseg->curseg_mutex);
2624 struct curseg_info *curseg, int type)
2626 unsigned int segno = curseg->segno + 1;
2727 struct curseg_info *curseg = CURSEG_I(sbi, type);
2729 unsigned short seg_type = curseg->seg_type;
2731 curseg->inited = true;
2732 curseg->segno = curseg->next_segno;
2733 curseg->zone = GET_ZONE_FROM_SEG(sbi, curseg->segno);
2734 curseg->next_blkoff = 0;
2735 curseg->next_segno = NULL_SEGNO;
2737 sum_footer = &(curseg->sum_blk->footer);
2746 __set_sit_entry_type(sbi, seg_type, curseg->segno, modified);
2751 struct curseg_info *curseg = CURSEG_I(sbi, type);
2752 unsigned short seg_type = curseg->seg_type;
2760 return curseg->segno;
2763 if (!curseg->inited)
2780 return curseg->segno;
2789 struct curseg_info *curseg = CURSEG_I(sbi, type);
2790 unsigned short seg_type = curseg->seg_type;
2791 unsigned int segno = curseg->segno;
2794 if (curseg->inited)
2795 write_sum_page(sbi, curseg->sum_blk,
2805 curseg->next_segno = segno;
2807 curseg->alloc_type = LFS;
2809 curseg->fragment_remained_chunk =
2847 struct curseg_info *curseg = CURSEG_I(sbi, type);
2848 unsigned int new_segno = curseg->next_segno;
2852 write_sum_page(sbi, curseg->sum_blk, GET_SUM_BLOCK(sbi, curseg->segno));
2862 curseg->alloc_type = SSR;
2863 curseg->next_blkoff = __next_free_blkoff(sbi, curseg->segno, 0);
2868 memset(curseg->sum_blk, 0, SUM_ENTRY_SIZE);
2872 memcpy(curseg->sum_blk, sum_node, SUM_ENTRY_SIZE);
2883 struct curseg_info *curseg = CURSEG_I(sbi, type);
2885 curseg->seg_type = target_type;
2888 struct seg_entry *se = get_seg_entry(sbi, curseg->next_segno);
2890 curseg->seg_type = se->type;
2894 curseg->seg_type = CURSEG_COLD_DATA;
2897 stat_inc_seg_type(sbi, curseg);
2902 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_ALL_DATA_ATGC);
2909 mutex_lock(&curseg->curseg_mutex);
2915 mutex_unlock(&curseg->curseg_mutex);
2927 struct curseg_info *curseg = CURSEG_I(sbi, type);
2929 mutex_lock(&curseg->curseg_mutex);
2930 if (!curseg->inited)
2933 if (get_valid_blocks(sbi, curseg->segno, false)) {
2934 write_sum_page(sbi, curseg->sum_blk,
2935 GET_SUM_BLOCK(sbi, curseg->segno));
2938 __set_test_and_free(sbi, curseg->segno, true);
2942 mutex_unlock(&curseg->curseg_mutex);
2955 struct curseg_info *curseg = CURSEG_I(sbi, type);
2957 mutex_lock(&curseg->curseg_mutex);
2958 if (!curseg->inited)
2960 if (get_valid_blocks(sbi, curseg->segno, false))
2964 __set_test_and_inuse(sbi, curseg->segno);
2967 mutex_unlock(&curseg->curseg_mutex);
2981 struct curseg_info *curseg = CURSEG_I(sbi, type);
2983 unsigned short seg_type = curseg->seg_type;
2991 curseg->next_segno = segno;
3018 curseg->next_segno = segno;
3027 curseg->next_segno = segno;
3036 struct curseg_info *curseg = CURSEG_I(sbi, type);
3039 curseg->seg_type == CURSEG_WARM_NODE)
3041 if (curseg->alloc_type == LFS &&
3042 is_next_segment_free(sbi, curseg, type) &&
3053 struct curseg_info *curseg = CURSEG_I(sbi, type);
3057 mutex_lock(&curseg->curseg_mutex);
3069 stat_inc_seg_type(sbi, curseg);
3075 if (segno != curseg->segno)
3076 f2fs_notice(sbi, "For resize: curseg of type %d: %u ==> %u",
3077 type, segno, curseg->segno);
3079 mutex_unlock(&curseg->curseg_mutex);
3086 struct curseg_info *curseg = CURSEG_I(sbi, type);
3089 if (!force && curseg->inited &&
3090 !curseg->next_blkoff &&
3091 !get_valid_blocks(sbi, curseg->segno, new_sec) &&
3092 !get_ckpt_valid_blocks(sbi, curseg->segno, new_sec))
3095 old_segno = curseg->segno;
3097 stat_inc_seg_type(sbi, curseg);
3417 struct curseg_info *curseg = CURSEG_I(sbi, type);
3425 mutex_lock(&curseg->curseg_mutex);
3434 *new_blkaddr = NEXT_FREE_BLKADDR(sbi, curseg);
3436 f2fs_bug_on(sbi, curseg->next_blkoff >= sbi->blocks_per_seg);
3440 curseg->sum_blk->entries[curseg->next_blkoff] = *sum;
3441 if (curseg->alloc_type == SSR) {
3442 curseg->next_blkoff = f2fs_find_next_ssr_block(sbi, curseg);
3444 curseg->next_blkoff++;
3446 f2fs_randomize_chunk(sbi, curseg);
3448 if (curseg->next_blkoff >= f2fs_usable_blks_in_seg(sbi, curseg->segno))
3450 stat_inc_block_count(sbi, curseg);
3481 stat_inc_seg_type(sbi, curseg);
3492 if (IS_DATASEG(curseg->seg_type))
3497 if (page && IS_NODESEG(curseg->seg_type)) {
3498 fill_node_footer_blkaddr(page, NEXT_FREE_BLKADDR(sbi, curseg));
3517 mutex_unlock(&curseg->curseg_mutex);
3699 struct curseg_info *curseg;
3731 curseg = CURSEG_I(sbi, type);
3733 mutex_lock(&curseg->curseg_mutex);
3736 old_cursegno = curseg->segno;
3737 old_blkoff = curseg->next_blkoff;
3738 old_alloc_type = curseg->alloc_type;
3741 if (segno != curseg->segno) {
3742 curseg->next_segno = segno;
3746 curseg->next_blkoff = GET_BLKOFF_FROM_SEG0(sbi, new_blkaddr);
3747 curseg->sum_blk->entries[curseg->next_blkoff] = *sum;
3767 if (old_cursegno != curseg->segno) {
3768 curseg->next_segno = old_cursegno;
3771 curseg->next_blkoff = old_blkoff;
3772 curseg->alloc_type = old_alloc_type;
3776 mutex_unlock(&curseg->curseg_mutex);
3916 struct curseg_info *curseg;
3965 /* set uncompleted segment to curseg */
3966 curseg = CURSEG_I(sbi, type);
3967 mutex_lock(&curseg->curseg_mutex);
3970 down_write(&curseg->journal_rwsem);
3971 memcpy(curseg->journal, &sum->journal, SUM_JOURNAL_SIZE);
3972 up_write(&curseg->journal_rwsem);
3974 memcpy(curseg->sum_blk->entries, sum->entries, SUM_ENTRY_SIZE);
3975 memcpy(&curseg->sum_blk->footer, &sum->footer, SUM_FOOTER_SIZE);
3976 curseg->next_segno = segno;
3978 curseg->alloc_type = ckpt->alloc_type[type];
3979 curseg->next_blkoff = blk_off;
3980 mutex_unlock(&curseg->curseg_mutex);
4222 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA);
4223 struct f2fs_journal *journal = curseg->journal;
4226 down_write(&curseg->journal_rwsem);
4238 up_write(&curseg->journal_rwsem);
4249 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA);
4250 struct f2fs_journal *journal = curseg->journal;
4294 down_write(&curseg->journal_rwsem);
4341 up_write(&curseg->journal_rwsem);
4543 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA);
4544 struct f2fs_journal *journal = curseg->journal;
4609 down_read(&curseg->journal_rwsem);
4662 up_read(&curseg->journal_rwsem);
4812 * In LFS/SSR curseg, .next_blkoff should point to an unused blkaddr;
4813 * In LFS curseg, all blkaddr after .next_blkoff should be unused.
4816 struct curseg_info *curseg = CURSEG_I(sbi, i);
4817 struct seg_entry *se = get_seg_entry(sbi, curseg->segno);
4818 unsigned int blkofs = curseg->next_blkoff;
4824 sanity_check_seg_type(sbi, curseg->seg_type);
4826 if (curseg->alloc_type != LFS && curseg->alloc_type != SSR) {
4829 curseg->alloc_type);
4837 if (curseg->alloc_type == SSR)
4846 i, curseg->segno, curseg->alloc_type,
4847 curseg->next_blkoff, blkofs);
5002 /* report zone for the sector the curseg points to */
5025 f2fs_notice(sbi, "Unaligned curseg[%d] with write pointer: "
5026 "curseg[0x%x,0x%x] wp[0x%x,0x%x]",
5029 f2fs_notice(sbi, "Assign new section to curseg[%d]: "
5030 "curseg[0x%x,0x%x]", type, cs->segno, cs->next_blkoff);
5034 /* check consistency of the zone curseg pointed to */
5061 "New zone for curseg[%d] is not yet discarded. "
5062 "Reset the zone: curseg[0x%x,0x%x]",