aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 1af7879bfb75..b32eb565e6b3 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1798,14 +1798,6 @@ static void merge_nats_in_set(struct f2fs_sb_info *sbi)
1798 write_unlock(&nm_i->nat_tree_lock); 1798 write_unlock(&nm_i->nat_tree_lock);
1799} 1799}
1800 1800
1801static bool __has_cursum_space(struct f2fs_summary_block *sum, int size)
1802{
1803 if (nats_in_cursum(sum) + size <= NAT_JOURNAL_ENTRIES)
1804 return true;
1805 else
1806 return false;
1807}
1808
1809static void remove_nats_in_journal(struct f2fs_sb_info *sbi) 1801static void remove_nats_in_journal(struct f2fs_sb_info *sbi)
1810{ 1802{
1811 struct f2fs_nm_info *nm_i = NM_I(sbi); 1803 struct f2fs_nm_info *nm_i = NM_I(sbi);
@@ -1860,7 +1852,7 @@ void flush_nat_entries(struct f2fs_sb_info *sbi)
1860 * entries, remove all entries from journal and merge them 1852 * entries, remove all entries from journal and merge them
1861 * into nat entry set. 1853 * into nat entry set.
1862 */ 1854 */
1863 if (!__has_cursum_space(sum, nm_i->dirty_nat_cnt)) { 1855 if (!__has_cursum_space(sum, nm_i->dirty_nat_cnt, NAT_JOURNAL)) {
1864 remove_nats_in_journal(sbi); 1856 remove_nats_in_journal(sbi);
1865 1857
1866 /* 1858 /*
@@ -1883,7 +1875,8 @@ void flush_nat_entries(struct f2fs_sb_info *sbi)
1883 struct page *page; 1875 struct page *page;
1884 nid_t start_nid = nes->start_nid; 1876 nid_t start_nid = nes->start_nid;
1885 1877
1886 if (to_journal && !__has_cursum_space(sum, nes->entry_cnt)) 1878 if (to_journal &&
1879 !__has_cursum_space(sum, nes->entry_cnt, NAT_JOURNAL))
1887 to_journal = false; 1880 to_journal = false;
1888 1881
1889 if (to_journal) { 1882 if (to_journal) {