Lines Matching refs:curseg

2498 	struct curseg_info *curseg = CURSEG_I(sbi, type);
2499 void *addr = curseg->sum_blk;
2500 addr += curseg->next_blkoff * sizeof(struct f2fs_summary);
2563 struct curseg_info *curseg = CURSEG_I(sbi, type);
2565 struct f2fs_summary_block *src = curseg->sum_blk;
2571 mutex_lock(&curseg->curseg_mutex);
2573 down_read(&curseg->journal_rwsem);
2574 memcpy(&dst->journal, curseg->journal, SUM_JOURNAL_SIZE);
2575 up_read(&curseg->journal_rwsem);
2580 mutex_unlock(&curseg->curseg_mutex);
2587 struct curseg_info *curseg, int type)
2589 unsigned int segno = curseg->segno + 1;
2690 struct curseg_info *curseg = CURSEG_I(sbi, type);
2692 unsigned short seg_type = curseg->seg_type;
2694 curseg->inited = true;
2695 curseg->segno = curseg->next_segno;
2696 curseg->zone = GET_ZONE_FROM_SEG(sbi, curseg->segno);
2697 curseg->next_blkoff = 0;
2698 curseg->next_segno = NULL_SEGNO;
2700 sum_footer = &(curseg->sum_blk->footer);
2709 __set_sit_entry_type(sbi, seg_type, curseg->segno, modified);
2714 struct curseg_info *curseg = CURSEG_I(sbi, type);
2715 unsigned short seg_type = curseg->seg_type;
2721 return curseg->segno;
2724 if (!curseg->inited)
2741 return curseg->segno;
2750 struct curseg_info *curseg = CURSEG_I(sbi, type);
2751 unsigned short seg_type = curseg->seg_type;
2752 unsigned int segno = curseg->segno;
2755 if (curseg->inited)
2756 write_sum_page(sbi, curseg->sum_blk,
2766 curseg->next_segno = segno;
2768 curseg->alloc_type = LFS;
2827 struct curseg_info *curseg = CURSEG_I(sbi, type);
2828 unsigned int new_segno = curseg->next_segno;
2833 write_sum_page(sbi, curseg->sum_blk,
2834 GET_SUM_BLOCK(sbi, curseg->segno));
2844 curseg->alloc_type = SSR;
2845 __next_free_blkoff(sbi, curseg, 0);
2850 memset(curseg->sum_blk, 0, SUM_ENTRY_SIZE);
2854 memcpy(curseg->sum_blk, sum_node, SUM_ENTRY_SIZE);
2865 struct curseg_info *curseg = CURSEG_I(sbi, type);
2867 curseg->seg_type = target_type;
2870 struct seg_entry *se = get_seg_entry(sbi, curseg->next_segno);
2872 curseg->seg_type = se->type;
2876 curseg->seg_type = CURSEG_COLD_DATA;
2879 stat_inc_seg_type(sbi, curseg);
2884 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_ALL_DATA_ATGC);
2891 mutex_lock(&curseg->curseg_mutex);
2897 mutex_unlock(&curseg->curseg_mutex);
2909 struct curseg_info *curseg = CURSEG_I(sbi, type);
2911 mutex_lock(&curseg->curseg_mutex);
2912 if (!curseg->inited)
2915 if (get_valid_blocks(sbi, curseg->segno, false)) {
2916 write_sum_page(sbi, curseg->sum_blk,
2917 GET_SUM_BLOCK(sbi, curseg->segno));
2920 __set_test_and_free(sbi, curseg->segno, true);
2924 mutex_unlock(&curseg->curseg_mutex);
2937 struct curseg_info *curseg = CURSEG_I(sbi, type);
2939 mutex_lock(&curseg->curseg_mutex);
2940 if (!curseg->inited)
2942 if (get_valid_blocks(sbi, curseg->segno, false))
2946 __set_test_and_inuse(sbi, curseg->segno);
2949 mutex_unlock(&curseg->curseg_mutex);
2963 struct curseg_info *curseg = CURSEG_I(sbi, type);
2966 unsigned short seg_type = curseg->seg_type;
2974 curseg->next_segno = segno;
3001 curseg->next_segno = segno;
3010 curseg->next_segno = segno;
3024 struct curseg_info *curseg = CURSEG_I(sbi, type);
3029 curseg->seg_type == CURSEG_WARM_NODE)
3031 else if (curseg->alloc_type == LFS &&
3032 is_next_segment_free(sbi, curseg, type) &&
3045 stat_inc_seg_type(sbi, curseg);
3051 struct curseg_info *curseg = CURSEG_I(sbi, type);
3055 mutex_lock(&curseg->curseg_mutex);
3067 stat_inc_seg_type(sbi, curseg);
3073 if (segno != curseg->segno)
3074 f2fs_notice(sbi, "For resize: curseg of type %d: %u ==> %u",
3075 type, segno, curseg->segno);
3077 mutex_unlock(&curseg->curseg_mutex);
3084 struct curseg_info *curseg = CURSEG_I(sbi, type);
3087 if (!curseg->inited)
3090 if (curseg->next_blkoff ||
3091 get_valid_blocks(sbi, curseg->segno, new_sec))
3094 if (!get_ckpt_valid_blocks(sbi, curseg->segno, new_sec))
3097 old_segno = curseg->segno;
3303 struct curseg_info *curseg)
3305 return curseg->next_blkoff < f2fs_usable_blks_in_seg(sbi,
3306 curseg->segno);
3501 struct curseg_info *curseg = CURSEG_I(sbi, type);
3512 mutex_lock(&curseg->curseg_mutex);
3521 *new_blkaddr = NEXT_FREE_BLKADDR(sbi, curseg);
3523 f2fs_bug_on(sbi, curseg->next_blkoff >= sbi->blocks_per_seg);
3534 __refresh_next_blkoff(sbi, curseg);
3536 stat_inc_block_count(sbi, curseg);
3554 if (!__has_curseg_space(sbi, curseg)) {
3586 fill_node_footer_blkaddr(page, NEXT_FREE_BLKADDR(sbi, curseg));
3605 mutex_unlock(&curseg->curseg_mutex);
3760 struct curseg_info *curseg;
3791 curseg = CURSEG_I(sbi, type);
3793 mutex_lock(&curseg->curseg_mutex);
3796 old_cursegno = curseg->segno;
3797 old_blkoff = curseg->next_blkoff;
3800 if (segno != curseg->segno) {
3801 curseg->next_segno = segno;
3805 curseg->next_blkoff = GET_BLKOFF_FROM_SEG0(sbi, new_blkaddr);
3827 if (old_cursegno != curseg->segno) {
3828 curseg->next_segno = old_cursegno;
3831 curseg->next_blkoff = old_blkoff;
3835 mutex_unlock(&curseg->curseg_mutex);
3968 struct curseg_info *curseg;
4016 /* set uncompleted segment to curseg */
4017 curseg = CURSEG_I(sbi, type);
4018 mutex_lock(&curseg->curseg_mutex);
4021 down_write(&curseg->journal_rwsem);
4022 memcpy(curseg->journal, &sum->journal, SUM_JOURNAL_SIZE);
4023 up_write(&curseg->journal_rwsem);
4025 memcpy(curseg->sum_blk->entries, sum->entries, SUM_ENTRY_SIZE);
4026 memcpy(&curseg->sum_blk->footer, &sum->footer, SUM_FOOTER_SIZE);
4027 curseg->next_segno = segno;
4029 curseg->alloc_type = ckpt->alloc_type[type];
4030 curseg->next_blkoff = blk_off;
4031 mutex_unlock(&curseg->curseg_mutex);
4275 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA);
4276 struct f2fs_journal *journal = curseg->journal;
4279 down_write(&curseg->journal_rwsem);
4291 up_write(&curseg->journal_rwsem);
4302 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA);
4303 struct f2fs_journal *journal = curseg->journal;
4347 down_write(&curseg->journal_rwsem);
4394 up_write(&curseg->journal_rwsem);
4596 struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_COLD_DATA);
4597 struct f2fs_journal *journal = curseg->journal;
4658 down_read(&curseg->journal_rwsem);
4707 up_read(&curseg->journal_rwsem);
4848 * In LFS/SSR curseg, .next_blkoff should point to an unused blkaddr;
4849 * In LFS curseg, all blkaddr after .next_blkoff should be unused.
4852 struct curseg_info *curseg = CURSEG_I(sbi, i);
4853 struct seg_entry *se = get_seg_entry(sbi, curseg->segno);
4854 unsigned int blkofs = curseg->next_blkoff;
4856 sanity_check_seg_type(sbi, curseg->seg_type);
4858 if (curseg->alloc_type != LFS && curseg->alloc_type != SSR) {
4861 curseg->alloc_type);
4868 if (curseg->alloc_type == SSR)
4877 i, curseg->segno, curseg->alloc_type,
4878 curseg->next_blkoff, blkofs);
5011 /* report zone for the sector the curseg points to */
5034 f2fs_notice(sbi, "Unaligned curseg[%d] with write pointer: "
5035 "curseg[0x%x,0x%x] wp[0x%x,0x%x]",
5038 f2fs_notice(sbi, "Assign new section to curseg[%d]: "
5039 "curseg[0x%x,0x%x]", type, cs->segno, cs->next_blkoff);
5042 /* check consistency of the zone curseg pointed to */
5069 "New zone for curseg[%d] is not yet discarded. "
5070 "Reset the zone: curseg[0x%x,0x%x]",