Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5598e900 authored by Kinglong Mee's avatar Kinglong Mee Committed by David Sterba
Browse files

btrfs: drop null testing before destroy functions



Cleanup.

kmem_cache_destroy has support NULL argument checking,
so drop the double null testing before calling it.

Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 89771cc9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -148,7 +148,6 @@ int __init btrfs_prelim_ref_init(void)

void btrfs_prelim_ref_exit(void)
{
	if (btrfs_prelim_ref_cache)
	kmem_cache_destroy(btrfs_prelim_ref_cache);
}

+1 −2
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ int __init btrfs_delayed_inode_init(void)

void btrfs_delayed_inode_exit(void)
{
	if (delayed_node_cache)
	kmem_cache_destroy(delayed_node_cache);
}

+4 −8
Original line number Diff line number Diff line
@@ -929,13 +929,9 @@ btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr)

void btrfs_delayed_ref_exit(void)
{
	if (btrfs_delayed_ref_head_cachep)
	kmem_cache_destroy(btrfs_delayed_ref_head_cachep);
	if (btrfs_delayed_tree_ref_cachep)
	kmem_cache_destroy(btrfs_delayed_tree_ref_cachep);
	if (btrfs_delayed_data_ref_cachep)
	kmem_cache_destroy(btrfs_delayed_data_ref_cachep);
	if (btrfs_delayed_extent_op_cachep)
	kmem_cache_destroy(btrfs_delayed_extent_op_cachep);
}

+1 −2
Original line number Diff line number Diff line
@@ -110,7 +110,6 @@ int __init btrfs_end_io_wq_init(void)

void btrfs_end_io_wq_exit(void)
{
	if (btrfs_end_io_wq_cache)
	kmem_cache_destroy(btrfs_end_io_wq_cache);
}

+2 −4
Original line number Diff line number Diff line
@@ -206,9 +206,7 @@ void extent_io_exit(void)
	 * destroy caches.
	 */
	rcu_barrier();
	if (extent_state_cache)
	kmem_cache_destroy(extent_state_cache);
	if (extent_buffer_cache)
	kmem_cache_destroy(extent_buffer_cache);
	if (btrfs_bioset)
		bioset_free(btrfs_bioset);
Loading