btrfs: make btrfs_root::free_objectid hold the next available objectid
authorNikolay Borisov <nborisov@suse.com>
Mon, 7 Dec 2020 15:32:36 +0000 (17:32 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Feb 2021 21:58:50 +0000 (22:58 +0100)
commit23125104d8485505cd19581025a3d6fc14e9945a
tree749e513da2f0c46d71fcd6e32c09031bb82663d6
parent6b8fad576a3c8f822a888873c5acdfb31de53c4c
btrfs: make btrfs_root::free_objectid hold the next available objectid

Adjust the way free_objectid is being initialized, it now stores
BTRFS_FIRST_FREE_OBJECTID rather than the, somewhat arbitrary,
BTRFS_FIRST_FREE_OBJECTID - 1. This change also has the added benefit
that now it becomes unnecessary to explicitly initialize free_objectid
for a newly create fs root.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c