Commit d0157f0c authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

staging: lustre: opencode LIBCFS_ALLOC_ATOMIC calls.

Just call kzalloc(GFP_ATOMIC) directly.
We don't need the warning on failure.
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c03f554
...@@ -1093,7 +1093,7 @@ int lprocfs_stats_alloc_one(struct lprocfs_stats *stats, unsigned int cpuid) ...@@ -1093,7 +1093,7 @@ int lprocfs_stats_alloc_one(struct lprocfs_stats *stats, unsigned int cpuid)
LASSERT((stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) == 0); LASSERT((stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) == 0);
percpusize = lprocfs_stats_counter_size(stats); percpusize = lprocfs_stats_counter_size(stats);
LIBCFS_ALLOC_ATOMIC(stats->ls_percpu[cpuid], percpusize); stats->ls_percpu[cpuid] = kzalloc(percpusize, GFP_ATOMIC);
if (stats->ls_percpu[cpuid]) { if (stats->ls_percpu[cpuid]) {
rc = 0; rc = 0;
if (unlikely(stats->ls_biggest_alloc_num <= cpuid)) { if (unlikely(stats->ls_biggest_alloc_num <= cpuid)) {
...@@ -1156,7 +1156,7 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num, ...@@ -1156,7 +1156,7 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
if ((flags & LPROCFS_STATS_FLAG_NOPERCPU) != 0) { if ((flags & LPROCFS_STATS_FLAG_NOPERCPU) != 0) {
/* contains only one set counters */ /* contains only one set counters */
percpusize = lprocfs_stats_counter_size(stats); percpusize = lprocfs_stats_counter_size(stats);
LIBCFS_ALLOC_ATOMIC(stats->ls_percpu[0], percpusize); stats->ls_percpu[0] = kzalloc(percpusize, GFP_ATOMIC);
if (!stats->ls_percpu[0]) if (!stats->ls_percpu[0])
goto fail; goto fail;
stats->ls_biggest_alloc_num = 1; stats->ls_biggest_alloc_num = 1;
...@@ -1193,8 +1193,7 @@ void lprocfs_free_stats(struct lprocfs_stats **statsh) ...@@ -1193,8 +1193,7 @@ void lprocfs_free_stats(struct lprocfs_stats **statsh)
percpusize = lprocfs_stats_counter_size(stats); percpusize = lprocfs_stats_counter_size(stats);
for (i = 0; i < num_entry; i++) for (i = 0; i < num_entry; i++)
if (stats->ls_percpu[i]) kfree(stats->ls_percpu[i]);
LIBCFS_FREE(stats->ls_percpu[i], percpusize);
kvfree(stats->ls_cnt_header); kvfree(stats->ls_cnt_header);
kvfree(stats); kvfree(stats);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment