Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358995
b: refs/heads/master
c: 5ac206c
h: refs/heads/master
i:
  358993: 0295d28
  358991: 42ce3b2
v: v3
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Feb 11, 2013
1 parent 6c0ec33 commit 031e8ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25718423ea6f7118f9c173adff0fac52414571b8
refs/heads/master: 5ac206cf4f9aad871aa1f1dd653a3404092db56c
8 changes: 8 additions & 0 deletions trunk/fs/f2fs/f2fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,14 @@ static inline int get_pages(struct f2fs_sb_info *sbi, int count_type)
return atomic_read(&sbi->nr_pages[count_type]);
}

static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
{
unsigned int pages_per_sec = sbi->segs_per_sec *
(1 << sbi->log_blocks_per_seg);
return ((get_pages(sbi, block_type) + pages_per_sec - 1)
>> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
}

static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi)
{
block_t ret;
Expand Down
8 changes: 2 additions & 6 deletions trunk/fs/f2fs/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ static inline int is_idle(struct f2fs_sb_info *sbi)

static inline bool should_do_checkpoint(struct f2fs_sb_info *sbi)
{
unsigned int pages_per_sec = sbi->segs_per_sec *
(1 << sbi->log_blocks_per_seg);
int node_secs = ((get_pages(sbi, F2FS_DIRTY_NODES) + pages_per_sec - 1)
>> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
int dent_secs = ((get_pages(sbi, F2FS_DIRTY_DENTS) + pages_per_sec - 1)
>> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES);
int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS);
return free_sections(sbi) <= (node_secs + 2 * dent_secs + 2);
}
9 changes: 2 additions & 7 deletions trunk/fs/f2fs/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,8 @@ static inline int get_ssr_segment(struct f2fs_sb_info *sbi, int type)

static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi)
{
unsigned int pages_per_sec = (1 << sbi->log_blocks_per_seg) *
sbi->segs_per_sec;
int node_secs = ((get_pages(sbi, F2FS_DIRTY_NODES) + pages_per_sec - 1)
>> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
int dent_secs = ((get_pages(sbi, F2FS_DIRTY_DENTS) + pages_per_sec - 1)
>> sbi->log_blocks_per_seg) / sbi->segs_per_sec;

int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES);
int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS);
if (sbi->por_doing)
return false;

Expand Down

0 comments on commit 031e8ca

Please sign in to comment.