All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs: define compression levels statically
Date: Tue, 20 Aug 2019 16:35:22 +0200	[thread overview]
Message-ID: <20190820143521.GT24086@twin.jikos.cz> (raw)
In-Reply-To: <ae30ae87-0e4a-af31-5a58-b32e7364588e@suse.com>

On Mon, Aug 12, 2019 at 11:30:42AM +0300, Nikolay Borisov wrote:
> 
> 
> On 9.08.19 г. 17:55 ч., David Sterba wrote:
> > The maximum and default levels do not change and can be defined
> > directly. The set_level callback was a temporary solution and will be
> > removed.
> > 
> > Signed-off-by: David Sterba <dsterba@suse.com>
> > ---
> >  fs/btrfs/compression.h | 4 ++++
> >  fs/btrfs/lzo.c         | 2 ++
> >  fs/btrfs/zlib.c        | 2 ++
> >  fs/btrfs/zstd.c        | 2 ++
> >  4 files changed, 10 insertions(+)
> > 
> > diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
> > index 2035b8eb1290..07b2009dc63f 100644
> > --- a/fs/btrfs/compression.h
> > +++ b/fs/btrfs/compression.h
> > @@ -162,6 +162,10 @@ struct btrfs_compress_op {
> >  	 * if the level is out of bounds or the default if 0 is passed in.
> >  	 */
> >  	unsigned int (*set_level)(unsigned int level);
> > +
> > +	/* Maximum level supported by the compression algorithm */
> > +	int max_level;
> > +	int default_level;
> 
> can levels be negative? If not just define those as unsigned ints and in
> the next patch it won't be necessary to use min_t but plain min.

No, levels should be >= 0.

  reply	other threads:[~2019-08-20 14:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 14:55 [PATCH 0/2] Compression level API cleanups David Sterba
2019-08-09 14:55 ` [PATCH 1/2] btrfs: define compression levels statically David Sterba
2019-08-12  8:30   ` Nikolay Borisov
2019-08-20 14:35     ` David Sterba [this message]
2019-08-09 14:55 ` [PATCH 2/2] btrfs: compression: replace set_level callbacks by a common helper David Sterba
2019-08-11 13:05   ` kbuild test robot
2019-08-11 13:08   ` kbuild test robot

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=20190820143521.GT24086@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.