Lines Matching refs:sbi
165 static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi) in F2FS_RAW_SUPER() argument
167 return (struct f2fs_super_block *)(sbi->raw_super); in F2FS_RAW_SUPER()
170 static inline struct f2fs_checkpoint *F2FS_CKPT(struct f2fs_sb_info *sbi) in F2FS_CKPT() argument
172 return (struct f2fs_checkpoint *)(sbi->ckpt); in F2FS_CKPT()
175 static inline struct f2fs_fsck *F2FS_FSCK(struct f2fs_sb_info *sbi) in F2FS_FSCK() argument
177 return (struct f2fs_fsck *)(sbi->fsck); in F2FS_FSCK()
180 static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi) in NM_I() argument
182 return (struct f2fs_nm_info *)(sbi->nm_info); in NM_I()
185 static inline struct f2fs_sm_info *SM_I(struct f2fs_sb_info *sbi) in SM_I() argument
187 return (struct f2fs_sm_info *)(sbi->sm_info); in SM_I()
190 static inline struct sit_info *SIT_I(struct f2fs_sb_info *sbi) in SIT_I() argument
192 return (struct sit_info *)(SM_I(sbi)->sit_info); in SIT_I()
206 static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag) in __bitmap_size() argument
208 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); in __bitmap_size()
219 static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag) in __bitmap_ptr() argument
221 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); in __bitmap_ptr()
223 if (le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload) > 0) { in __bitmap_ptr()
241 static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi) in __start_cp_addr() argument
244 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); in __start_cp_addr()
247 start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr); in __start_cp_addr()
254 start_addr += sbi->blocks_per_seg; in __start_cp_addr()
259 static inline block_t __start_sum_addr(struct f2fs_sb_info *sbi) in __start_sum_addr() argument
261 return le32_to_cpu(F2FS_CKPT(sbi)->cp_pack_start_sum); in __start_sum_addr()
264 static inline block_t __end_block_addr(struct f2fs_sb_info *sbi) in __end_block_addr() argument
266 block_t end = SM_I(sbi)->main_blkaddr; in __end_block_addr()
267 return end + le64_to_cpu(F2FS_RAW_SUPER(sbi)->block_count); in __end_block_addr()
270 #define GET_ZONENO_FROM_SEGNO(sbi, segno) \ argument
271 ((segno / sbi->segs_per_sec) / sbi->secs_per_zone)
281 #define GET_SUM_BLKADDR(sbi, segno) \ argument
282 ((sbi->sm_info->ssa_blkaddr) + segno)
284 #define GET_SEGOFF_FROM_SEG0(sbi, blk_addr) \ argument
285 ((blk_addr) - SM_I(sbi)->seg0_blkaddr)
287 #define GET_SEGNO_FROM_SEG0(sbi, blk_addr) \ argument
288 (GET_SEGOFF_FROM_SEG0(sbi, blk_addr) >> sbi->log_blocks_per_seg)
290 #define GET_BLKOFF_FROM_SEG0(sbi, blk_addr) \ argument
291 (GET_SEGOFF_FROM_SEG0(sbi, blk_addr) & (sbi->blocks_per_seg - 1))
293 #define FREE_I_START_SEGNO(sbi) \ argument
294 GET_SEGNO_FROM_SEG0(sbi, SM_I(sbi)->main_blkaddr)
295 #define GET_R2L_SEGNO(sbi, segno) (segno + FREE_I_START_SEGNO(sbi)) argument
297 #define START_BLOCK(sbi, segno) (SM_I(sbi)->main_blkaddr + \ argument
298 (segno << sbi->log_blocks_per_seg))
300 static inline struct curseg_info *CURSEG_I(struct f2fs_sb_info *sbi, int type) in CURSEG_I() argument
302 return (struct curseg_info *)(SM_I(sbi)->curseg_array + type); in CURSEG_I()
305 static inline block_t start_sum_block(struct f2fs_sb_info *sbi) in start_sum_block() argument
307 return __start_cp_addr(sbi) + le32_to_cpu(F2FS_CKPT(sbi)->cp_pack_start_sum); in start_sum_block()
310 static inline block_t sum_blk_addr(struct f2fs_sb_info *sbi, int base, int type) in sum_blk_addr() argument
312 return __start_cp_addr(sbi) + le32_to_cpu(F2FS_CKPT(sbi)->cp_pack_total_block_count) in sum_blk_addr()
329 #define TOTAL_SEGS(sbi) (SM_I(sbi)->main_segments) argument
331 static inline bool IS_VALID_NID(struct f2fs_sb_info *sbi, u32 nid) in IS_VALID_NID() argument
334 F2FS_RAW_SUPER(sbi)->segment_count_nat in IS_VALID_NID()
335 << (sbi->log_blocks_per_seg - 1))); in IS_VALID_NID()
338 static inline bool IS_VALID_BLK_ADDR(struct f2fs_sb_info *sbi, u32 addr) in IS_VALID_BLK_ADDR() argument
342 if (addr >= F2FS_RAW_SUPER(sbi)->block_count || in IS_VALID_BLK_ADDR()
343 addr < SM_I(sbi)->main_blkaddr) { in IS_VALID_BLK_ADDR()
349 struct curseg_info *curseg = CURSEG_I(sbi, i); in IS_VALID_BLK_ADDR()
351 if (START_BLOCK(sbi, curseg->segno) + in IS_VALID_BLK_ADDR()
358 static inline u64 BLKOFF_FROM_MAIN(struct f2fs_sb_info *sbi, u64 blk_addr) in BLKOFF_FROM_MAIN() argument
360 ASSERT(blk_addr >= SM_I(sbi)->main_blkaddr); in BLKOFF_FROM_MAIN()
361 return blk_addr - SM_I(sbi)->main_blkaddr; in BLKOFF_FROM_MAIN()
364 static inline u32 GET_SEGNO(struct f2fs_sb_info *sbi, u64 blk_addr) in GET_SEGNO() argument
366 return (u32)(BLKOFF_FROM_MAIN(sbi, blk_addr) in GET_SEGNO()
367 >> sbi->log_blocks_per_seg); in GET_SEGNO()
370 static inline u32 OFFSET_IN_SEG(struct f2fs_sb_info *sbi, u64 blk_addr) in OFFSET_IN_SEG() argument
372 return (u32)(BLKOFF_FROM_MAIN(sbi, blk_addr) in OFFSET_IN_SEG()
373 % (1 << sbi->log_blocks_per_seg)); in OFFSET_IN_SEG()
384 extern int lookup_nat_in_journal(struct f2fs_sb_info *sbi, u32 nid, struct f2fs_nat_entry *ne);