]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: send: explicitly number commands and attributes
authorOmar Sandoval <osandov@fb.com>
Thu, 17 Mar 2022 17:25:38 +0000 (10:25 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:32 +0000 (17:45 +0200)
commit82200711bfc78f3beb02f037d4bbca09630764de
tree6217601c6178ee3cdf4381232e54a0491058aa4b
parentea7e3e6a2d18b0371d242fd4443539506ecdb9fa
btrfs: send: explicitly number commands and attributes

Commit 8454272510ca ("btrfs: send: prepare for v2 protocol") added
_BTRFS_SEND_C_MAX_V* macros equal to the maximum command number for the
version plus 1, but as written this creates gaps in the number space.

The maximum command number is currently 22, and __BTRFS_SEND_C_MAX_V1 is
accordingly 23. But then __BTRFS_SEND_C_MAX_V2 is 24, suggesting that v2
has a command numbered 23, and __BTRFS_SEND_C_MAX is 25, suggesting that
23 and 24 are valid commands.

Instead, let's explicitly number all of the commands, attributes, and
sentinel MAX constants.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c
fs/btrfs/send.h