mirror of
https://github.com/torvalds/linux
synced 2024-09-20 02:57:25 +00:00
Btrfs: switch to kvfree() helper
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>
This commit is contained in:
parent
01d58472a8
commit
f749303bda
|
@ -3241,8 +3241,5 @@ void btrfsic_unmount(struct btrfs_root *root,
|
||||||
|
|
||||||
mutex_unlock(&btrfsic_mutex);
|
mutex_unlock(&btrfsic_mutex);
|
||||||
|
|
||||||
if (is_vmalloc_addr(state))
|
kvfree(state);
|
||||||
vfree(state);
|
|
||||||
else
|
|
||||||
kfree(state);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,12 +237,8 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
x = cmpxchg(&info->stripe_hash_table, NULL, table);
|
x = cmpxchg(&info->stripe_hash_table, NULL, table);
|
||||||
if (x) {
|
if (x)
|
||||||
if (is_vmalloc_addr(x))
|
kvfree(x);
|
||||||
vfree(x);
|
|
||||||
else
|
|
||||||
kfree(x);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,10 +449,7 @@ void btrfs_free_stripe_hash_table(struct btrfs_fs_info *info)
|
||||||
if (!info->stripe_hash_table)
|
if (!info->stripe_hash_table)
|
||||||
return;
|
return;
|
||||||
btrfs_clear_rbio_cache(info);
|
btrfs_clear_rbio_cache(info);
|
||||||
if (is_vmalloc_addr(info->stripe_hash_table))
|
kvfree(info->stripe_hash_table);
|
||||||
vfree(info->stripe_hash_table);
|
|
||||||
else
|
|
||||||
kfree(info->stripe_hash_table);
|
|
||||||
info->stripe_hash_table = NULL;
|
info->stripe_hash_table = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue