All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 2/6] btrfs: store fs_info on space_info
Date: Wed,  3 Apr 2024 12:38:48 -0700	[thread overview]
Message-ID: <6f56853ca8437b8dd7d343adff2982ad9b099543.1712168477.git.boris@bur.io> (raw)
In-Reply-To: <cover.1712168477.git.boris@bur.io>

This is handy when computing space_info dynamic reclaim thresholds where
we do not have access to a block group. We could add it to the various
functions as a parameter, but it seems reasonable for space_info to have
an fs_info pointer.

Signed-off-by: Boris Burkov <boris@bur.io>
---
 fs/btrfs/space-info.c | 1 +
 fs/btrfs/space-info.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index d620323d08ea..d20a27f293e9 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -232,6 +232,7 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags)
 	if (!space_info)
 		return -ENOMEM;
 
+	space_info->fs_info = info;
 	for (i = 0; i < BTRFS_NR_RAID_TYPES; i++)
 		INIT_LIST_HEAD(&space_info->block_groups[i]);
 	init_rwsem(&space_info->groups_sem);
diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
index b42db020eba6..2eb7f74070b2 100644
--- a/fs/btrfs/space-info.h
+++ b/fs/btrfs/space-info.h
@@ -94,6 +94,7 @@ enum btrfs_flush_state {
 };
 
 struct btrfs_space_info {
+	struct btrfs_fs_info *fs_info;
 	spinlock_t lock;
 
 	u64 total_bytes;	/* total bytes in the space,
-- 
2.44.0


  parent reply	other threads:[~2024-04-03 19:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 19:38 [PATCH 0/6] btrfs: dynamic and periodic block_group reclaim Boris Burkov
2024-04-03 19:38 ` [PATCH 1/6] btrfs: report reclaim stats in sysfs Boris Burkov
2024-04-09 11:24   ` Johannes Thumshirn
2024-04-03 19:38 ` Boris Burkov [this message]
2024-04-09 11:25   ` [PATCH 2/6] btrfs: store fs_info on space_info Johannes Thumshirn
2024-04-03 19:38 ` [PATCH 3/6] btrfs: dynamic block_group reclaim threshold Boris Burkov
2024-04-09 11:52   ` Johannes Thumshirn
2024-04-03 19:38 ` [PATCH 4/6] btrfs: periodic block_group reclaim Boris Burkov
2024-04-03 19:38 ` [PATCH 5/6] btrfs: prevent pathological periodic reclaim loops Boris Burkov
2024-04-03 19:38 ` [PATCH 6/6] btrfs: urgent periodic reclaim pass Boris Burkov
  -- strict thread matches above, loose matches on Subject: below --
2024-02-02 23:12 [RFC PATCH 0/6] btrfs: dynamic and periodic block_group reclaim Boris Burkov
2024-02-02 23:12 ` [PATCH 2/6] btrfs: store fs_info on space_info Boris Burkov

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=6f56853ca8437b8dd7d343adff2982ad9b099543.1712168477.git.boris@bur.io \
    --to=boris@bur.io \
    --cc=kernel-team@fb.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.