diff options
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 5022a7d7f7ca..87840bccaf21 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -573,6 +573,14 @@ static inline int get_pages(struct f2fs_sb_info *sbi, int count_type) | |||
573 | return atomic_read(&sbi->nr_pages[count_type]); | 573 | return atomic_read(&sbi->nr_pages[count_type]); |
574 | } | 574 | } |
575 | 575 | ||
576 | static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type) | ||
577 | { | ||
578 | unsigned int pages_per_sec = sbi->segs_per_sec * | ||
579 | (1 << sbi->log_blocks_per_seg); | ||
580 | return ((get_pages(sbi, block_type) + pages_per_sec - 1) | ||
581 | >> sbi->log_blocks_per_seg) / sbi->segs_per_sec; | ||
582 | } | ||
583 | |||
576 | static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi) | 584 | static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi) |
577 | { | 585 | { |
578 | block_t ret; | 586 | block_t ret; |