Re: [PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 08:54:15PM +0100, David Sterba wrote: > On Tue, Feb 05, 2019 at 02:32:54PM -0500, Dennis Zhou wrote: > > On Tue, Feb 05, 2019 at 08:06:37PM +0100, David Sterba wrote: > > > On Mon, Feb 04, 2019 at 03:20:05PM -0500, Dennis Zhou wrote: > > > > -unsigned int btrfs_compress_str2

Re: [PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-05 Thread David Sterba
On Tue, Feb 05, 2019 at 02:32:54PM -0500, Dennis Zhou wrote: > On Tue, Feb 05, 2019 at 08:06:37PM +0100, David Sterba wrote: > > On Mon, Feb 04, 2019 at 03:20:05PM -0500, Dennis Zhou wrote: > > > -unsigned int btrfs_compress_str2level(const char *str) > > > +unsigned int btrfs_compress_str2level(un

Re: [PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 08:06:37PM +0100, David Sterba wrote: > On Mon, Feb 04, 2019 at 03:20:05PM -0500, Dennis Zhou wrote: > > -unsigned int btrfs_compress_str2level(const char *str) > > +unsigned int btrfs_compress_str2level(unsigned int type, const char *str) > > { > > - if (strncmp(str, "zl

Re: [PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-05 Thread David Sterba
On Mon, Feb 04, 2019 at 03:20:05PM -0500, Dennis Zhou wrote: > -unsigned int btrfs_compress_str2level(const char *str) > +unsigned int btrfs_compress_str2level(unsigned int type, const char *str) > { > - if (strncmp(str, "zlib", 4) != 0) > + unsigned int level; > + int ret; > + > +

[PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-04 Thread Dennis Zhou
Currently, the only user of set_level() is zlib which sets an internal workspace parameter. As level is now plumbed into get_workspace(), this can be handled there rather than separately. This repurposes set_level() to bound the level passed in so it can be used when setting the mounts compression