lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 21 Jul 2013 21:35:58 -0700
From:	Joe Perches <joe@...ches.com>
To:	Phillip Lougher <phillip@...ashfs.org.uk>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-embedded@...r.kernel.org
Subject: Re: [PATCH 1/2] Squashfs: add LZ4 compression support

On Mon, 2013-07-22 at 03:21 +0100, Phillip Lougher wrote:
> Add support for reading file systems compressed with the
> LZ4 compression algorithm.

Some whitespace trivia and a naming comment.

> diff --git a/fs/squashfs/lz4_wrapper.c b/fs/squashfs/lz4_wrapper.c
[]
> +static void *lz4_init(struct squashfs_sb_info *msblk, void *buff, int len)
[]
> +	/* LZ4 compressed filesystems always have compression options */
> +	if(comp_opts == NULL || len < sizeof(*comp_opts)) {

space after ifs please.

> +	if(le32_to_cpu(comp_opts->version) != LZ4_LEGACY) {

> +
> +
> +static void lz4_free(void *strm)

Single blank line between functions

> +static int lz4_uncompress(struct squashfs_sb_info *msblk, void **buffer,
> +	struct buffer_head **bh, int b, int offset, int length, int srclength,
> +	int pages)
> +{
> +	struct squashfs_lz4 *stream = msblk->stream;
> +	void *buff = stream->input;

It's not particularly nice to have both buffer and buff
in the same function.

Maybe void *input though char *input would be better.

> +	int avail, i, bytes = length, res;
> +	size_t dest_len = srclength;
> +
> +	mutex_lock(&msblk->read_data_mutex);
> +
> +	for (i = 0; i < b; i++) {
> +		wait_on_buffer(bh[i]);
> +		if (!buffer_uptodate(bh[i]))
> +			goto block_release;
> +
> +		avail = min(bytes, msblk->devblksize - offset);
> +		memcpy(buff, bh[i]->b_data + offset, avail);
> +		buff += avail;
> +		bytes -= avail;
> +		offset = 0;
> +		put_bh(bh[i]);
> +	}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ