Skip to content

Commit 8610ba7

Browse files
committed
btrfs: pass a btrfs_inode to is_data_inode()
Pass a struct btrfs_inode to is_data_inode() as it's an internal interface, allowing to remove some use of BTRFS_I. Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent a0d7e98 commit 8610ba7

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

fs/btrfs/bio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct btrfs_failed_bio {
2929
/* Is this a data path I/O that needs storage layer checksum and repair? */
3030
static inline bool is_data_bbio(struct btrfs_bio *bbio)
3131
{
32-
return bbio->inode && is_data_inode(&bbio->inode->vfs_inode);
32+
return bbio->inode && is_data_inode(bbio->inode);
3333
}
3434

3535
static bool bbio_has_ordered_extent(struct btrfs_bio *bbio)

fs/btrfs/btrfs_inode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ static inline bool btrfs_is_free_space_inode(const struct btrfs_inode *inode)
418418
return test_bit(BTRFS_INODE_FREE_SPACE_INODE, &inode->runtime_flags);
419419
}
420420

421-
static inline bool is_data_inode(const struct inode *inode)
421+
static inline bool is_data_inode(const struct btrfs_inode *inode)
422422
{
423-
return btrfs_ino(BTRFS_I(inode)) != BTRFS_BTREE_INODE_OBJECTID;
423+
return btrfs_ino(inode) != BTRFS_BTREE_INODE_OBJECTID;
424424
}
425425

426426
static inline void btrfs_mod_outstanding_extents(struct btrfs_inode *inode,

fs/btrfs/extent_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ static void submit_extent_page(struct btrfs_bio_ctrl *bio_ctrl,
860860
/* Cap to the current ordered extent boundary if there is one. */
861861
if (len > bio_ctrl->len_to_oe_boundary) {
862862
ASSERT(bio_ctrl->compress_type == BTRFS_COMPRESS_NONE);
863-
ASSERT(is_data_inode(&inode->vfs_inode));
863+
ASSERT(is_data_inode(inode));
864864
len = bio_ctrl->len_to_oe_boundary;
865865
}
866866

fs/btrfs/subpage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, struct address_space
7474
* mapping. And if page->mapping->host is data inode, it's subpage.
7575
* As we have ruled our sectorsize >= PAGE_SIZE case already.
7676
*/
77-
if (!mapping || !mapping->host || is_data_inode(mapping->host))
77+
if (!mapping || !mapping->host || is_data_inode(BTRFS_I(mapping->host)))
7878
return true;
7979

8080
/*
@@ -283,7 +283,7 @@ void btrfs_subpage_end_reader(const struct btrfs_fs_info *fs_info,
283283
bool last;
284284

285285
btrfs_subpage_assert(fs_info, folio, start, len);
286-
is_data = is_data_inode(folio->mapping->host);
286+
is_data = is_data_inode(BTRFS_I(folio->mapping->host));
287287

288288
spin_lock_irqsave(&subpage->lock, flags);
289289

fs/btrfs/zoned.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ bool btrfs_use_zone_append(struct btrfs_bio *bbio)
17231723
if (!btrfs_is_zoned(fs_info))
17241724
return false;
17251725

1726-
if (!inode || !is_data_inode(&inode->vfs_inode))
1726+
if (!inode || !is_data_inode(inode))
17271727
return false;
17281728

17291729
if (btrfs_op(&bbio->bio) != BTRFS_MAP_WRITE)

0 commit comments

Comments
 (0)