Skip to content

Commit bd0ffde

Browse files
morbidrsakdave
authored andcommitted
btrfs: create btrfs_reclaim_block_groups()
Create a function btrfs_reclaim_block_groups() that gets called from the block-group reclaim worker. This allows creating synchronous block_group reclaim later on. Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent b619185 commit bd0ffde

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

fs/btrfs/block-group.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,10 +2040,8 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg)
20402040
return ret;
20412041
}
20422042

2043-
void btrfs_reclaim_bgs_work(struct work_struct *work)
2043+
static void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info)
20442044
{
2045-
struct btrfs_fs_info *fs_info =
2046-
container_of(work, struct btrfs_fs_info, reclaim_bgs_work);
20472045
struct btrfs_block_group *bg;
20482046
struct btrfs_space_info *space_info;
20492047
LIST_HEAD(retry_list);
@@ -2111,6 +2109,14 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
21112109
btrfs_exclop_finish(fs_info);
21122110
}
21132111

2112+
void btrfs_reclaim_bgs_work(struct work_struct *work)
2113+
{
2114+
struct btrfs_fs_info *fs_info =
2115+
container_of(work, struct btrfs_fs_info, reclaim_bgs_work);
2116+
2117+
btrfs_reclaim_block_groups(fs_info);
2118+
}
2119+
21142120
void btrfs_reclaim_bgs(struct btrfs_fs_info *fs_info)
21152121
{
21162122
btrfs_reclaim_sweep(fs_info);

0 commit comments

Comments
 (0)