From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934275AbeAIBVX (ORCPT + 1 other); Mon, 8 Jan 2018 20:21:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:34967 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932876AbeAIBVU (ORCPT ); Mon, 8 Jan 2018 20:21:20 -0500 From: NeilBrown To: Oleg Drokin , Andreas Dilger , James Simmons , Greg Kroah-Hartman Date: Tue, 09 Jan 2018 12:19:38 +1100 Subject: [PATCH 12/14] staging: lustre: opencode LIBCFS_ALLOC_ATOMIC calls. Cc: lkml , lustre Message-ID: <151546077859.9776.5353432944670337893.stgit@noble> In-Reply-To: <151546052331.9776.7408338350463291753.stgit@noble> References: <151546052331.9776.7408338350463291753.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Just call kzalloc(GFP_ATOMIC) directly. We don't need the warning on failure. Signed-off-by: NeilBrown --- .../lustre/lustre/obdclass/lprocfs_status.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 85483a38c6c4..e1f4ef2bddd4 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -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); 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]) { rc = 0; if (unlikely(stats->ls_biggest_alloc_num <= cpuid)) { @@ -1156,7 +1156,7 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num, if ((flags & LPROCFS_STATS_FLAG_NOPERCPU) != 0) { /* contains only one set counters */ 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]) goto fail; stats->ls_biggest_alloc_num = 1; @@ -1193,8 +1193,7 @@ void lprocfs_free_stats(struct lprocfs_stats **statsh) percpusize = lprocfs_stats_counter_size(stats); for (i = 0; i < num_entry; i++) - if (stats->ls_percpu[i]) - LIBCFS_FREE(stats->ls_percpu[i], percpusize); + kfree(stats->ls_percpu[i]); kvfree(stats->ls_cnt_header); kvfree(stats); }