Re: [PATCH v2 06/10] fs/ntfs3: Add compression

From: Randy Dunlap
Date: Fri Aug 21 2020 - 12:46:35 EST


On 8/21/20 9:25 AM, Konstantin Komarov wrote:
> This adds compression
>
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx>
> ---
> fs/ntfs3/lznt.c | 449 ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 449 insertions(+)
> create mode 100644 fs/ntfs3/lznt.c
>
> diff --git a/fs/ntfs3/lznt.c b/fs/ntfs3/lznt.c
> new file mode 100644
> index 000000000000..db3256c08387
> --- /dev/null
> +++ b/fs/ntfs3/lznt.c
> @@ -0,0 +1,449 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * linux/fs/ntfs3/lznt.c
> + *
> + * Copyright (C) 2019-2020 Paragon Software GmbH, All rights reserved.
> + *
> + */

Hi,

> +// 0x3FFF
> +#define HeaderOfNonCompressedChunk ((LZNT_CHUNK_SIZE + 2 - 3) | 0x3000)

Do we need something in coding-style.rst that says:
Avoid CamelCase in Linux kernel source code.
?

> +
> +/*
> + * compess_chunk

Just curious: what is this compess name?

> + *
> + * returns one of the tree values:

s/tree/three/


> + * 0 - ok, 'cmpr' contains 'cmpr_chunk_size' bytes of compressed data
> + * 1 == LZNT_ERROR_ALL_ZEROS - input buffer is full zero
> + * -2 == LZNT_ERROR_TOOSMALL
> + */
> +static inline int compess_chunk(size_t (*match)(const u8 *, struct lznt *),
> + const u8 *unc, const u8 *unc_end, u8 *cmpr,
> + u8 *cmpr_end, size_t *cmpr_chunk_size,
> + struct lznt *ctx)
> +{

...


--
~Randy