summaryrefslogtreecommitdiff
path: root/fs/btrfs/ioctl.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/ioctl.c
parentb9b1a53e180e2ab4cea42c95bf344e4bf7f524e7 (diff)
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/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index d7a1bd74bb71..5892fa9398c3 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1409,7 +1409,7 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
return -EINVAL;
if (do_compress) {
- if (range->compress_type > BTRFS_COMPRESS_TYPES)
+ if (range->compress_type >= BTRFS_NR_COMPRESS_TYPES)
return -EINVAL;
if (range->compress_type)
compress_type = range->compress_type;