summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/discard.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-10-23 15:58:07 +0200
committerDavid Sterba <dsterba@suse.com>2020-12-08 15:54:02 +0100
commit66b53bae46c84e00e276ee6e539eedfbcfe78573 (patch)
treecbbacb71a008d1a99804bd97bd59523fa057de15 /fs/btrfs/discard.h
parentbtrfs: explicitly protect ->last_byte_to_unpin in unpin_extent_range (diff)
downloadlinux-66b53bae46c84e00e276ee6e539eedfbcfe78573.tar.xz
linux-66b53bae46c84e00e276ee6e539eedfbcfe78573.zip
btrfs: cleanup btrfs_discard_update_discardable usage
This passes in the block_group and the free_space_ctl, but we can get this from the block group itself. Part of this is because we call it from __load_free_space_cache, which can be called for the inode cache as well. Move that call into the block group specific load section, wrap it in the right lock that we need for the assertion (but otherwise this is safe without the lock because this happens in single-thread context). Fix up the arguments to only take the block group. Add a lockdep_assert as well for good measure to make sure we don't mess up the locking again. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/discard.h')
-rw-r--r--fs/btrfs/discard.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/discard.h b/fs/btrfs/discard.h
index 353228d62f5a..57b9202f427f 100644
--- a/fs/btrfs/discard.h
+++ b/fs/btrfs/discard.h
@@ -28,8 +28,7 @@ bool btrfs_run_discard_work(struct btrfs_discard_ctl *discard_ctl);
/* Update operations */
void btrfs_discard_calc_delay(struct btrfs_discard_ctl *discard_ctl);
-void btrfs_discard_update_discardable(struct btrfs_block_group *block_group,
- struct btrfs_free_space_ctl *ctl);
+void btrfs_discard_update_discardable(struct btrfs_block_group *block_group);
/* Setup/cleanup operations */
void btrfs_discard_punt_unused_bgs_list(struct btrfs_fs_info *fs_info);