diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-05-04 23:19:48 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-07 10:32:29 -0700 |
commit | f51b4ce6c1759a64d68d314545854dc226ab69a0 (patch) | |
tree | cd552c152c6e9e3c122070c4536cb62f29e89004 /fs/f2fs/segment.h | |
parent | bd933d4faedf3a79034e67e8032d153bf1afcd83 (diff) | |
download | talos-obmc-linux-f51b4ce6c1759a64d68d314545854dc226ab69a0.tar.gz talos-obmc-linux-f51b4ce6c1759a64d68d314545854dc226ab69a0.zip |
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: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 975c33df65c7..7a756ff5a36d 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -158,16 +158,17 @@ struct victim_sel_policy { }; 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 */ /* * # of valid blocks and the validity bitmap stored in the the last * checkpoint pack. This information is used by the SSR mode. */ - unsigned short ckpt_valid_blocks; - unsigned char *ckpt_valid_map; + unsigned char *ckpt_valid_map; /* validity bitmap of blocks last cp */ unsigned char *discard_map; - unsigned char type; /* segment type like CURSEG_XXX_TYPE */ unsigned long long mtime; /* modification time of the segment */ }; |