Skip to content

Commit 42f620a

Browse files
boryaskdave
authored andcommitted
btrfs: store fs_info in space_info
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. Reviewed-by: Josef Bacik <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Boris Burkov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 243192b commit 42f620a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

fs/btrfs/space-info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags)
232232
if (!space_info)
233233
return -ENOMEM;
234234

235+
space_info->fs_info = info;
235236
for (i = 0; i < BTRFS_NR_RAID_TYPES; i++)
236237
INIT_LIST_HEAD(&space_info->block_groups[i]);
237238
init_rwsem(&space_info->groups_sem);

fs/btrfs/space-info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ enum btrfs_flush_state {
9494
};
9595

9696
struct btrfs_space_info {
97+
struct btrfs_fs_info *fs_info;
9798
spinlock_t lock;
9899

99100
u64 total_bytes; /* total bytes in the space,

0 commit comments

Comments
 (0)