Skip to content

Commit

Permalink
Btrfs: switch to kvfree() helper
Browse files Browse the repository at this point in the history
A new helper kvfree() in mm/utils.c will do this.

Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
  • Loading branch information
Wang Shilong authored and David Sterba committed Feb 16, 2015
1 parent 01d5847 commit f749303
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
5 changes: 1 addition & 4 deletions fs/btrfs/check-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -3241,8 +3241,5 @@ void btrfsic_unmount(struct btrfs_root *root,

mutex_unlock(&btrfsic_mutex);

if (is_vmalloc_addr(state))
vfree(state);
else
kfree(state);
kvfree(state);
}
13 changes: 3 additions & 10 deletions fs/btrfs/raid56.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,8 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)
}

x = cmpxchg(&info->stripe_hash_table, NULL, table);
if (x) {
if (is_vmalloc_addr(x))
vfree(x);
else
kfree(x);
}
if (x)
kvfree(x);
return 0;
}

Expand Down Expand Up @@ -453,10 +449,7 @@ void btrfs_free_stripe_hash_table(struct btrfs_fs_info *info)
if (!info->stripe_hash_table)
return;
btrfs_clear_rbio_cache(info);
if (is_vmalloc_addr(info->stripe_hash_table))
vfree(info->stripe_hash_table);
else
kfree(info->stripe_hash_table);
kvfree(info->stripe_hash_table);
info->stripe_hash_table = NULL;
}

Expand Down

0 comments on commit f749303

Please sign in to comment.