btrfs: use btrfs_root_id() where not done yet
authorDavid Sterba <dsterba@suse.com>
Fri, 6 Jun 2025 17:50:14 +0000 (19:50 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:53:31 +0000 (23:53 +0200)
A few more remaining cases where we can use the helper.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c

index 46d4963a82413575ce933fdd498b2475e91cb1a2..f1ac6a8dd9f455a2e87dfe4b0d74df3afc75edb1 100644 (file)
@@ -5554,7 +5554,7 @@ again:
                goto again;
        }
 
-       exists = btrfs_find_delayed_tree_ref(head, root->root_key.objectid, parent);
+       exists = btrfs_find_delayed_tree_ref(head, btrfs_root_id(root), parent);
        mutex_unlock(&head->mutex);
 out:
        spin_unlock(&delayed_refs->lock);
index ac639d50706ab74df82af70c6e2558ff6e14f637..f869309c8aa1aca72e5168adc0e1fba119062417 100644 (file)
@@ -1704,7 +1704,7 @@ static int extent_writepage(struct folio *folio, struct btrfs_bio_ctrl *bio_ctrl
                WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG));
                btrfs_err_rl(fs_info,
        "root %lld ino %llu folio %llu is marked dirty without notifying the fs",
-                            inode->root->root_key.objectid,
+                            btrfs_root_id(inode->root),
                             btrfs_ino(inode), folio_pos(folio));
                ret = -EUCLEAN;
                goto done;
index c2accf631f347720d2edfb9a6b08b9060c9ac1f7..cc176950e7195354dbc795ff3bf55d62d29b0008 100644 (file)
@@ -2881,7 +2881,7 @@ int btrfs_writepage_cow_fixup(struct folio *folio)
                DEBUG_WARN();
                btrfs_err_rl(fs_info,
        "root %lld ino %llu folio %llu is marked dirty without notifying the fs",
-                            BTRFS_I(inode)->root->root_key.objectid,
+                            btrfs_root_id(BTRFS_I(inode)->root),
                             btrfs_ino(BTRFS_I(inode)),
                             folio_pos(folio));
                return -EUCLEAN;
@@ -8023,7 +8023,7 @@ static int btrfs_getattr(struct mnt_idmap *idmap,
        generic_fillattr(idmap, request_mask, inode, stat);
        stat->dev = BTRFS_I(inode)->root->anon_dev;
 
-       stat->subvol = BTRFS_I(inode)->root->root_key.objectid;
+       stat->subvol = btrfs_root_id(BTRFS_I(inode)->root);
        stat->result_mask |= STATX_SUBVOL;
 
        spin_lock(&BTRFS_I(inode)->lock);