diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-02-21 13:17:22 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-02-24 16:00:40 +0900 |
commit | fffc2a00fc01b781c1e3b9541e3e0f270c50ce90 (patch) | |
tree | ef9baeee5d33b51acda782320c7b47299345fec3 /fs/f2fs/node.h | |
parent | 6437d1b0adb46f29aafcbf10950a89211028ca09 (diff) | |
download | linux-fffc2a00fc01b781c1e3b9541e3e0f270c50ce90.tar.gz linux-fffc2a00fc01b781c1e3b9541e3e0f270c50ce90.tar.bz2 linux-fffc2a00fc01b781c1e3b9541e3e0f270c50ce90.zip |
f2fs: fix to mark the checkpointed nat entry correctly
The nat cache entry maintains a status whether it is checkpointed or not.
So, if a new cache entry is loaded from the last checkpoint,
nat_entry->checkpointed should be true.
If the cache entry is modified as being dirty, nat_entry->checkpoint should
be false.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.h')
-rw-r--r-- | fs/f2fs/node.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h index c4c79885c993..4dea719766ef 100644 --- a/fs/f2fs/node.h +++ b/fs/f2fs/node.h @@ -58,9 +58,15 @@ struct nat_entry { #define nat_set_version(nat, v) (nat->ni.version = v) #define __set_nat_cache_dirty(nm_i, ne) \ - list_move_tail(&ne->list, &nm_i->dirty_nat_entries); + do { \ + ne->checkpointed = false; \ + list_move_tail(&ne->list, &nm_i->dirty_nat_entries); \ + } while (0); #define __clear_nat_cache_dirty(nm_i, ne) \ - list_move_tail(&ne->list, &nm_i->nat_entries); + do { \ + ne->checkpointed = true; \ + list_move_tail(&ne->list, &nm_i->nat_entries); \ + } while (0); #define inc_node_version(version) (++version) static inline void node_info_from_raw_nat(struct node_info *ni, |