diff options
author | Richard Weinberger <richard@nod.at> | 2016-09-29 21:17:15 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2016-12-12 23:07:38 +0100 |
commit | f1f52d6b029776bef4a60cc30011a81f0420a873 (patch) | |
tree | 7d7c6078c20eac59ce2c5ace303caaa55ebc90a1 /fs/ubifs/ubifs-media.h | |
parent | ubifs: Enforce crypto policy in mmap (diff) | |
download | linux-f1f52d6b029776bef4a60cc30011a81f0420a873.tar.xz linux-f1f52d6b029776bef4a60cc30011a81f0420a873.zip |
ubifs: Introduce new data node field, compr_size
When data of a data node is compressed and encrypted
we need to store the size of the compressed data because
before encryption we may have to add padding bytes.
For the new field we consume the last two padding bytes
in struct ubifs_data_node. Two bytes are fine because
the data length is at most 4096.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/ubifs-media.h')
-rw-r--r-- | fs/ubifs/ubifs-media.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ubifs/ubifs-media.h b/fs/ubifs/ubifs-media.h index aa302b11aec8..e46331dcca4c 100644 --- a/fs/ubifs/ubifs-media.h +++ b/fs/ubifs/ubifs-media.h @@ -553,18 +553,16 @@ struct ubifs_dent_node { * @key: node key * @size: uncompressed data size in bytes * @compr_type: compression type (%UBIFS_COMPR_NONE, %UBIFS_COMPR_LZO, etc) - * @padding: reserved for future, zeroes + * @compr_size: compressed data size in bytes, only valid when data is encrypted * @data: data * - * Note, do not forget to amend 'zero_data_node_unused()' function when - * changing the padding fields. */ struct ubifs_data_node { struct ubifs_ch ch; __u8 key[UBIFS_MAX_KEY_LEN]; __le32 size; __le16 compr_type; - __u8 padding[2]; /* Watch 'zero_data_node_unused()' if changing! */ + __le16 compr_size; __u8 data[]; } __packed; |