btrfs: put initial index value of a directory in a constant
authorFilipe Manana <fdmanana@suse.com>
Wed, 15 Dec 2021 12:19:59 +0000 (12:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:35 +0000 (17:16 +0200)
commit90b9e489270429877aef8750c4993f54d9744126
treef9e5222ff8d1ba578ed18c5f662811aae1c0a4a5
parent4438d54ce7a854a686b252137ac274d86ac60fd4
btrfs: put initial index value of a directory in a constant

[ Upstream commit 528ee697126fddaff448897c2d649bd756153c79 ]

At btrfs_set_inode_index_count() we refer twice to the number 2 as the
initial index value for a directory (when it's empty), with a proper
comment explaining the reason for that value. In the next patch I'll
have to use that magic value in the directory logging code, so put
the value in a #define at btrfs_inode.h, to avoid hardcoding the
magic value again at tree-log.c.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/btrfs_inode.h
fs/btrfs/inode.c