aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2019-10-10 15:59:57 +0800
committerDavid Sterba <dsterba@suse.com>2019-11-18 12:46:55 +0100
commitce96b7ffd11e261ef2ecd6817b7572a77750170d (patch)
tree653bc44cc799199b3d61d161689b320ae41b9858 /fs/btrfs/compression.c
parentbtrfs: use enum for extent type defines (diff)
downloadlinux-dev-ce96b7ffd11e261ef2ecd6817b7572a77750170d.tar.xz
linux-dev-ce96b7ffd11e261ef2ecd6817b7572a77750170d.zip
btrfs: use better definition of number of compression type
The compression type upper limit constant is the same as the last value and this is confusing. In order to keep coding style consistent, use BTRFS_NR_COMPRESS_TYPES as the total number that follows the idom of 'NR' being one more than the last value. Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r--fs/btrfs/compression.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index d70c46407420..93deaf0cc2b8 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -39,6 +39,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:
+ break;
}
return NULL;