btrfs: change root->root_key.objectid to btrfs_root_id()
authorJosef Bacik <josef@toxicpanda.com>
Mon, 15 Apr 2024 20:16:23 +0000 (16:16 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:06 +0000 (21:31 +0200)
commite094f48040cda67622060857ad43dad9e418fbd7
tree3ec00cdc01ff8d9ab4fb8edf2a62bab09245f3b7
parent53e24158684b527d013b5b2204ccb34d1f94c248
btrfs: change root->root_key.objectid to btrfs_root_id()

A comment from Filipe on one of my previous cleanups brought my
attention to a new helper we have for getting the root id of a root,
which makes it easier to read in the code.

The changes where made with the following Coccinelle semantic patch:

// <smpl>
@@
expression E,E1;
@@
(
 E->root_key.objectid = E1
|
- E->root_key.objectid
+ btrfs_root_id(E)
)
// </smpl>

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ minor style fixups ]
Signed-off-by: David Sterba <dsterba@suse.com>
26 files changed:
fs/btrfs/backref.c
fs/btrfs/block-rsv.c
fs/btrfs/compression.c
fs/btrfs/ctree.c
fs/btrfs/defrag.c
fs/btrfs/delayed-inode.c
fs/btrfs/disk-io.c
fs/btrfs/export.c
fs/btrfs/extent-tree.c
fs/btrfs/file-item.c
fs/btrfs/file.c
fs/btrfs/inode-item.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/locking.c
fs/btrfs/ordered-data.c
fs/btrfs/props.c
fs/btrfs/qgroup.c
fs/btrfs/reflink.c
fs/btrfs/relocation.c
fs/btrfs/root-tree.c
fs/btrfs/send.c
fs/btrfs/super.c
fs/btrfs/transaction.c
fs/btrfs/tree-log.c
fs/btrfs/tree-mod-log.c