Commit f51b4ce6 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: shrink size of struct seg_entry

Restructure struct seg_entry to eliminate holes in it, after that,
in 32-bits machine, it reduces size from 32 bytes to 24 bytes; in
64-bits machine, it reduces size from 56 bytes to 40 bytes.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent bd933d4f
...@@ -158,16 +158,17 @@ struct victim_sel_policy { ...@@ -158,16 +158,17 @@ struct victim_sel_policy {
}; };
struct seg_entry { struct seg_entry {
unsigned short valid_blocks; /* # of valid blocks */ unsigned int type:6; /* segment type like CURSEG_XXX_TYPE */
unsigned int valid_blocks:10; /* # of valid blocks */
unsigned int ckpt_valid_blocks:10; /* # of valid blocks last cp */
unsigned int padding:6; /* padding */
unsigned char *cur_valid_map; /* validity bitmap of blocks */ unsigned char *cur_valid_map; /* validity bitmap of blocks */
/* /*
* # of valid blocks and the validity bitmap stored in the the last * # of valid blocks and the validity bitmap stored in the the last
* checkpoint pack. This information is used by the SSR mode. * checkpoint pack. This information is used by the SSR mode.
*/ */
unsigned short ckpt_valid_blocks; unsigned char *ckpt_valid_map; /* validity bitmap of blocks last cp */
unsigned char *ckpt_valid_map;
unsigned char *discard_map; unsigned char *discard_map;
unsigned char type; /* segment type like CURSEG_XXX_TYPE */
unsigned long long mtime; /* modification time of the segment */ unsigned long long mtime; /* modification time of the segment */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment