diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-11-01 08:20:50 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-12-03 06:13:59 -0500 |
commit | a1dc080c27ec8ea7ca1c8a9b499362a71ebff792 (patch) | |
tree | a41c931fb6f7c8bdc0c3481545892216921074eb /fs/ubifs/super.c | |
parent | 062e4fee4400f283307cf8ac1b7931c939010229 (diff) |
UBIFS: use bit-fields to store compression type
Save a 4 bytes of RAM per 'struct inode' by stroring inode
compression type in bit-filed, instead of using 'int'.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r-- | fs/ubifs/super.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index d80b2aef42b6..21b4103271ec 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -2021,6 +2021,14 @@ static int __init ubifs_init(void) | |||
2021 | BUILD_BUG_ON(UBIFS_REF_NODE_SZ != 64); | 2021 | BUILD_BUG_ON(UBIFS_REF_NODE_SZ != 64); |
2022 | 2022 | ||
2023 | /* | 2023 | /* |
2024 | * We use 2 bit wide bit-fields to store compression type, which should | ||
2025 | * be amended if more compressors are added. The bit-fields are: | ||
2026 | * @compr_type in 'struct ubifs_inode' and @default_compr in | ||
2027 | * 'struct ubifs_info'. | ||
2028 | */ | ||
2029 | BUILD_BUG_ON(UBIFS_COMPR_TYPES_CNT > 4); | ||
2030 | |||
2031 | /* | ||
2024 | * We require that PAGE_CACHE_SIZE is greater-than-or-equal-to | 2032 | * We require that PAGE_CACHE_SIZE is greater-than-or-equal-to |
2025 | * UBIFS_BLOCK_SIZE. It is assumed that both are powers of 2. | 2033 | * UBIFS_BLOCK_SIZE. It is assumed that both are powers of 2. |
2026 | */ | 2034 | */ |