mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
btrfs: unexport btrfs_run_discard_work and make it static
Mark btrfs_run_discard_work static and move it above its callers. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
016f9d0b74
commit
bb5167e619
2 changed files with 17 additions and 18 deletions
|
@ -73,6 +73,23 @@ static struct list_head *get_discard_list(struct btrfs_discard_ctl *discard_ctl,
|
||||||
return &discard_ctl->discard_list[block_group->discard_index];
|
return &discard_ctl->discard_list[block_group->discard_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Determine if async discard should be running.
|
||||||
|
*
|
||||||
|
* @discard_ctl: discard control
|
||||||
|
*
|
||||||
|
* Check if the file system is writeable and BTRFS_FS_DISCARD_RUNNING is set.
|
||||||
|
*/
|
||||||
|
static bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl)
|
||||||
|
{
|
||||||
|
struct btrfs_fs_info *fs_info = container_of(discard_ctl,
|
||||||
|
struct btrfs_fs_info,
|
||||||
|
discard_ctl);
|
||||||
|
|
||||||
|
return (!(fs_info->sb->s_flags & SB_RDONLY) &&
|
||||||
|
test_bit(BTRFS_FS_DISCARD_RUNNING, &fs_info->flags));
|
||||||
|
}
|
||||||
|
|
||||||
static void __add_to_discard_list(struct btrfs_discard_ctl *discard_ctl,
|
static void __add_to_discard_list(struct btrfs_discard_ctl *discard_ctl,
|
||||||
struct btrfs_block_group *block_group)
|
struct btrfs_block_group *block_group)
|
||||||
{
|
{
|
||||||
|
@ -544,23 +561,6 @@ static void btrfs_discard_workfn(struct work_struct *work)
|
||||||
spin_unlock(&discard_ctl->lock);
|
spin_unlock(&discard_ctl->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Determine if async discard should be running.
|
|
||||||
*
|
|
||||||
* @discard_ctl: discard control
|
|
||||||
*
|
|
||||||
* Check if the file system is writeable and BTRFS_FS_DISCARD_RUNNING is set.
|
|
||||||
*/
|
|
||||||
bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl)
|
|
||||||
{
|
|
||||||
struct btrfs_fs_info *fs_info = container_of(discard_ctl,
|
|
||||||
struct btrfs_fs_info,
|
|
||||||
discard_ctl);
|
|
||||||
|
|
||||||
return (!(fs_info->sb->s_flags & SB_RDONLY) &&
|
|
||||||
test_bit(BTRFS_FS_DISCARD_RUNNING, &fs_info->flags));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Recalculate the base delay.
|
* Recalculate the base delay.
|
||||||
*
|
*
|
||||||
|
|
|
@ -24,7 +24,6 @@ void btrfs_discard_queue_work(struct btrfs_discard_ctl *discard_ctl,
|
||||||
struct btrfs_block_group *block_group);
|
struct btrfs_block_group *block_group);
|
||||||
void btrfs_discard_schedule_work(struct btrfs_discard_ctl *discard_ctl,
|
void btrfs_discard_schedule_work(struct btrfs_discard_ctl *discard_ctl,
|
||||||
bool override);
|
bool override);
|
||||||
bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl);
|
|
||||||
|
|
||||||
/* Update operations */
|
/* Update operations */
|
||||||
void btrfs_discard_calc_delay(struct btrfs_discard_ctl *discard_ctl);
|
void btrfs_discard_calc_delay(struct btrfs_discard_ctl *discard_ctl);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue