diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-26 00:25:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-26 00:25:02 -0500 |
commit | 8f5f90a872c38b4e78f3cc95e8a25434b98e4db2 (patch) | |
tree | 36c50b0c97286ab89c85016f7ab281f8e843c05c /fs/f2fs/segment.h | |
parent | c0cd2da16b431a2007ea83865f3dd1530c1643a5 (diff) | |
parent | 949db153b6466c6f7cad5a427ecea94985927311 (diff) |
Merge 3.8-rc5 into staging-next
This resolves a merge issue with a iio driver, and the zram code.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 0948405af6f5..66a288a52fd3 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h | |||
@@ -459,7 +459,20 @@ static inline int get_ssr_segment(struct f2fs_sb_info *sbi, int type) | |||
459 | 459 | ||
460 | static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi) | 460 | static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi) |
461 | { | 461 | { |
462 | return free_sections(sbi) <= reserved_sections(sbi); | 462 | unsigned int pages_per_sec = (1 << sbi->log_blocks_per_seg) * |
463 | sbi->segs_per_sec; | ||
464 | int node_secs = ((get_pages(sbi, F2FS_DIRTY_NODES) + pages_per_sec - 1) | ||
465 | >> sbi->log_blocks_per_seg) / sbi->segs_per_sec; | ||
466 | int dent_secs = ((get_pages(sbi, F2FS_DIRTY_DENTS) + pages_per_sec - 1) | ||
467 | >> sbi->log_blocks_per_seg) / sbi->segs_per_sec; | ||
468 | |||
469 | if (sbi->por_doing) | ||
470 | return false; | ||
471 | |||
472 | if (free_sections(sbi) <= (node_secs + 2 * dent_secs + | ||
473 | reserved_sections(sbi))) | ||
474 | return true; | ||
475 | return false; | ||
463 | } | 476 | } |
464 | 477 | ||
465 | static inline int utilization(struct f2fs_sb_info *sbi) | 478 | static inline int utilization(struct f2fs_sb_info *sbi) |