struct btrfs_trim_range *trim_entry;
/* Get the cluster for this block_group if it exists */
- if (block_group && !list_empty(&block_group->cluster_list)) {
+ if (!list_empty(&block_group->cluster_list)) {
cluster = list_first_entry(&block_group->cluster_list,
struct btrfs_free_cluster, block_group_list);
}
struct extent_io_tree *unpin = NULL;
int ret;
- if (!block_group)
- return 0;
-
/*
* We want to add any pinned extents to our free space cache
* so we don't leak the space
if (ret)
return ret;
- if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA)) {
+ if (block_group->flags & BTRFS_BLOCK_GROUP_DATA) {
down_write(&block_group->data_rwsem);
spin_lock(&block_group->lock);
if (block_group->delalloc_bytes) {
goto out_nospc;
}
- if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA))
+ if (block_group->flags & BTRFS_BLOCK_GROUP_DATA)
up_write(&block_group->data_rwsem);
/*
* Release the pages and unlock the extent, we will flush
cleanup_write_cache_enospc(inode, io_ctl, &cached_state);
out_unlock:
- if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA))
+ if (block_group->flags & BTRFS_BLOCK_GROUP_DATA)
up_write(&block_group->data_rwsem);
out: