summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-03-18 20:02:46 +0800
committerDavid Sterba <dsterba@suse.cz>2014-04-11 19:05:40 +0200
commit8bae5a152538adb41ff63f1c7882666bcd0ced19 (patch)
treeefe28f9b0cf9d575d7eba85ae20d42b428fac946 /cmds-check.c
parentc920facc1844c1d26b3c7b1fc45e66be997dc034 (diff)
Btrfs-progs: fsck: reduce memory usage of extent record struct
Two changes: 1.use bit filed for @found_rec 2.u32 is enough to calculate duplicate extent number. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 72f37183..39a08694 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -92,7 +92,6 @@ struct extent_record {
struct list_head list;
struct cache_extent cache;
struct btrfs_disk_key parent_key;
- unsigned int found_rec;
u64 start;
u64 max_size;
u64 nr;
@@ -101,8 +100,9 @@ struct extent_record {
u64 generation;
u64 parent_generation;
u64 info_objectid;
- u64 num_duplicates;
+ u32 num_duplicates;
u8 info_level;
+ unsigned int found_rec:1;
unsigned int content_checked:1;
unsigned int owner_ref_checked:1;
unsigned int is_root:1;
@@ -2737,7 +2737,7 @@ static int add_extent_rec(struct cache_tree *extent_cache,
rec->start = start;
rec->max_size = max_size;
rec->nr = max(nr, max_size);
- rec->found_rec = extent_rec;
+ rec->found_rec = !!extent_rec;
rec->content_checked = 0;
rec->owner_ref_checked = 0;
rec->num_duplicates = 0;