]> git.ipfire.org Git - thirdparty/linux.git/commit - fs/btrfs/ioctl.c
btrfs: simplify root lookup by id
authorDavid Sterba <dsterba@suse.com>
Fri, 15 May 2020 17:35:55 +0000 (19:35 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:36 +0000 (11:25 +0200)
commit56e9357a1e8167134388d4c70654795353765c7b
treee89265fd992d94c54fffb639cf4ee39bd268cfdb
parent1dae7e0e58b484eaa43d530f211098fdeeb0f404
btrfs: simplify root lookup by id

The main function to lookup a root by its id btrfs_get_fs_root takes the
whole key, while only using the objectid. The value of offset is preset
to (u64)-1 but not actually used until btrfs_find_root that does the
actual search.

Switch btrfs_get_fs_root to use only objectid and remove all local
variables that existed just for the lookup. The actual key for search is
set up in btrfs_get_fs_root, reusing another key variable.

Signed-off-by: David Sterba <dsterba@suse.com>
15 files changed:
fs/btrfs/backref.c
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/export.c
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/relocation.c
fs/btrfs/root-tree.c
fs/btrfs/scrub.c
fs/btrfs/send.c
fs/btrfs/super.c
fs/btrfs/transaction.c
fs/btrfs/tree-log.c
fs/btrfs/uuid-tree.c