Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 04/11] btrfs: switch btrfs_block_group::inode to struct btrfs_inode
Date: Mon, 24 Jun 2024 18:23:10 +0200	[thread overview]
Message-ID: <bf12a6ddd428a2bee3988fed0c5de38d4399f581.1719246104.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1719246104.git.dsterba@suse.com>

The structure is internal so we should use struct btrfs_inode for that.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/block-group.c      | 4 ++--
 fs/btrfs/block-group.h      | 2 +-
 fs/btrfs/free-space-cache.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 9f1d328b603e..6a9d895add25 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -4327,13 +4327,13 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info *info)
 		spin_lock(&block_group->lock);
 		if (test_and_clear_bit(BLOCK_GROUP_FLAG_IREF,
 				       &block_group->runtime_flags)) {
-			struct inode *inode = block_group->inode;
+			struct btrfs_inode *inode = block_group->inode;
 
 			block_group->inode = NULL;
 			spin_unlock(&block_group->lock);
 
 			ASSERT(block_group->io_ctl.inode == NULL);
-			iput(inode);
+			iput(&inode->vfs_inode);
 		} else {
 			spin_unlock(&block_group->lock);
 		}
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
index 85e2d4cd12dc..084f117550f8 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -115,7 +115,7 @@ struct btrfs_caching_control {
 
 struct btrfs_block_group {
 	struct btrfs_fs_info *fs_info;
-	struct inode *inode;
+	struct btrfs_inode *inode;
 	spinlock_t lock;
 	u64 start;
 	u64 length;
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index ae1a987fe518..c29c8ef9bd6a 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -137,7 +137,7 @@ struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group,
 
 	spin_lock(&block_group->lock);
 	if (block_group->inode)
-		inode = igrab(block_group->inode);
+		inode = igrab(&block_group->inode->vfs_inode);
 	spin_unlock(&block_group->lock);
 	if (inode)
 		return inode;
@@ -156,7 +156,7 @@ struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group,
 	}
 
 	if (!test_and_set_bit(BLOCK_GROUP_FLAG_IREF, &block_group->runtime_flags))
-		block_group->inode = igrab(inode);
+		block_group->inode = BTRFS_I(igrab(inode));
 	spin_unlock(&block_group->lock);
 
 	return inode;
-- 
2.45.0


  parent reply	other threads:[~2024-06-24 16:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 16:22 [PATCH 00/11] Inode type conversion David Sterba
2024-06-24 16:23 ` [PATCH 01/11] btrfs: pass a btrfs_inode to btrfs_readdir_put_delayed_items() David Sterba
2024-06-24 16:23 ` [PATCH 02/11] btrfs: pass a btrfs_inode to btrfs_readdir_get_delayed_items() David Sterba
2024-06-24 16:23 ` [PATCH 03/11] btrfs: pass a btrfs_inode to is_data_inode() David Sterba
2024-06-24 16:23 ` David Sterba [this message]
2024-06-24 16:23 ` [PATCH 05/11] btrfs: pass a btrfs_inode to btrfs_ioctl_send() David Sterba
2024-06-24 16:23 ` [PATCH 06/11] btrfs: switch btrfs_pending_snapshot::dir to btrfs_inode David Sterba
2024-06-24 16:23 ` [PATCH 07/11] btrfs: switch btrfs_ordered_extent::inode to struct btrfs_inode David Sterba
2024-06-24 16:23 ` [PATCH 08/11] btrfs: pass a btrfs_inode to btrfs_compress_heuristic() David Sterba
2024-06-24 16:23 ` [PATCH 09/11] btrfs: pass a btrfs_inode to btrfs_set_prop() David Sterba
2024-06-24 16:23 ` [PATCH 10/11] btrfs: pass a btrfs_inode to btrfs_load_inode_props() David Sterba
2024-06-24 16:23 ` [PATCH 11/11] btrfs: pass a btrfs_inode to btrfs_inode_inherit_props() David Sterba
2024-06-24 18:41 ` [PATCH 00/11] Inode type conversion Boris Burkov
2024-06-26 14:06 ` Filipe Manana
2024-06-26 14:39   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf12a6ddd428a2bee3988fed0c5de38d4399f581.1719246104.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox