Re: [PATCH 03/11] btrfs: manage heuristic workspace as index 0
From: Dennis Zhou
Date: Tue Jan 29 2019 - 17:43:50 EST
On Tue, Jan 29, 2019 at 09:53:33AM +0200, Nikolay Borisov wrote:
>
>
> On 28.01.19 Ð. 23:24 Ñ., Dennis Zhou wrote:
> > While the heuristic workspaces aren't really compression workspaces,
> > they use the same interface for managing them. So rather than branching,
> > let's just handle them once again as the index 0 compression type.
> >
> > Signed-off-by: Dennis Zhou <dennis@xxxxxxxxxx>
>
> Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx> albeit one minor nit
> below.
> > ---
> > fs/btrfs/compression.c | 107 +++++++++++-----------------------------
> > fs/btrfs/compression.h | 3 +-
> > fs/btrfs/ioctl.c | 2 +-
> > fs/btrfs/tree-checker.c | 4 +-
> > 4 files changed, 33 insertions(+), 83 deletions(-)
> >
> > diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> > index aced261984e2..bda7e8d2cbc7 100644
> > --- a/fs/btrfs/compression.c
> > +++ b/fs/btrfs/compression.c
> > @@ -37,6 +37,8 @@ const char* btrfs_compress_type2str(enum btrfs_compression_type type)
> > case BTRFS_COMPRESS_ZSTD:
> > case BTRFS_COMPRESS_NONE:
> > return btrfs_compress_types[type];
> > + default:
> > + return NULL;
>
> nit: With this change...
>
> > }
> >
> > return NULL;
>
> This becomes redundant. I doubt the compiler will issue a warning since
> it should be clever enough to figure we will never exit the switch()
> construct.
>
Ah yes. I've removed it for v2.
Thanks,
Dennis