From: Joe Perches <joe@perches.com>
To: Phillip Lougher <phillip@squashfs.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-embedded@vger.kernel.org
Subject: Re: [PATCH 1/2] Squashfs: add LZ4 compression support
Date: Sun, 21 Jul 2013 21:35:58 -0700 [thread overview]
Message-ID: <1374467758.2061.14.camel@joe-AO722> (raw)
In-Reply-To: <1374459663-15363-2-git-send-email-phillip@squashfs.org.uk>
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]);
> + }
next prev parent reply other threads:[~2013-07-22 4:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 2:21 [PATCH 0/2] Squashfs: add LZ4 compression Phillip Lougher
2013-07-22 2:21 ` [PATCH 1/2] Squashfs: add LZ4 compression support Phillip Lougher
2013-07-22 4:35 ` Joe Perches [this message]
2013-07-22 2:21 ` [PATCH 2/2] Squashfs: Add LZ4 compression configuration option Phillip Lougher
2013-07-22 3:05 ` [PATCH 0/2] Squashfs: add LZ4 compression Gu Zheng
2013-07-22 5:07 ` Phillip Lougher
2013-07-22 6:04 ` Gu Zheng
2013-07-22 13:38 ` Phillip Lougher
2013-07-26 22:00 ` Rob Landley
2014-09-05 10:01 ` Guan, Xin
2014-09-06 20:29 ` Guan, Xin
[not found] ` <20130723151009.GA5971@wolff.to>
2013-07-23 16:17 ` Phillip Lougher
2013-07-23 16:29 ` Bruno Wolff III
-- strict thread matches above, loose matches on Subject: below --
2014-11-27 8:00 Phillip Lougher
2014-11-27 8:00 ` [PATCH 1/2] Squashfs: add LZ4 compression support Phillip Lougher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374467758.2061.14.camel@joe-AO722 \
--to=joe@perches.com \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=phillip@squashfs.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).