summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2020-12-07 17:32:36 +0200
committerDavid Sterba <dsterba@suse.com>2021-02-08 22:58:50 +0100
commit23125104d8485505cd19581025a3d6fc14e9945a (patch)
tree749e513da2f0c46d71fcd6e32c09031bb82663d6 /fs/btrfs/ioctl.c
parent6b8fad576a3c8f822a888873c5acdfb31de53c4c (diff)
downloadlinux-stable-23125104d8485505cd19581025a3d6fc14e9945a.tar.gz
linux-stable-23125104d8485505cd19581025a3d6fc14e9945a.tar.bz2
linux-stable-23125104d8485505cd19581025a3d6fc14e9945a.zip
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>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 2041c4b6fd0e..d8422074da02 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -724,10 +724,6 @@ static noinline int create_subvol(struct inode *dir,
goto fail;
}
- mutex_lock(&new_root->objectid_mutex);
- new_root->free_objectid = new_dirid;
- mutex_unlock(&new_root->objectid_mutex);
-
/*
* insert the directory item
*/