mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	lustre <lustre-devel@lists.lustre.org>
Subject: [PATCH 12/14] staging: lustre: opencode LIBCFS_ALLOC_ATOMIC calls.
Date: Tue, 09 Jan 2018 12:19:38 +1100	[thread overview]
Message-ID: <151546077859.9776.5353432944670337893.stgit@noble> (raw)
In-Reply-To: <151546052331.9776.7408338350463291753.stgit@noble>

Just call kzalloc(GFP_ATOMIC) directly.
We don't need the warning on failure.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 .../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);
 }

  reply	other threads:[~2018-01-09  1:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09  1:19 [PATCH 00/14] staging:lustre: convert most LIBCFS*ALLOC to k*malloc - V2 NeilBrown
2018-01-09  1:19 ` NeilBrown [this message]
2018-01-09  1:19 ` [PATCH 03/14] staging: lustre: lnet: selftest: don't allocate small strings NeilBrown
2018-01-09  1:19 ` [PATCH 04/14] staging: lustre: lnet: use kmalloc/kvmalloc in router_proc NeilBrown
2018-01-09  1:19 ` [PATCH 01/14] staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc NeilBrown
2018-01-09  1:19 ` [PATCH 02/14] staging: lustre: lnet: switch to cpumask_var_t NeilBrown
2018-01-09  1:19 ` [PATCH 05/14] staging: lustre: change some LIBCFS_ALLOC calls to k?alloc(GFP_KERNEL) NeilBrown
2018-01-09  1:19 ` [PATCH 10/14] staging: lustre: use kmalloc for allocating ksock_tx NeilBrown
2018-01-09  1:19 ` [PATCH 06/14] staging: lustre: Convert more LIBCFS_ALLOC allocation to direct GFP_KERNEL NeilBrown
2018-01-09  1:19 ` [PATCH 08/14] staging: lustre: more conversions to GFP_KERNEL allocations NeilBrown
2018-01-09  1:19 ` [PATCH 07/14] staging: lustre: more LIBCFS_ALLOC " NeilBrown
2018-01-09  1:19 ` [PATCH 11/14] staging: lustre: cfs_percpt_alloc: use kvmalloc(GFP_KERNEL) NeilBrown
2018-01-09  1:19 ` [PATCH 09/14] staging: lustre: lnet-route: use kmalloc for small allocation NeilBrown
2018-01-09  1:19 ` [PATCH 14/14] staging: lustre: remove LIBCFS_ALLOC, LIBCFS_FREE and related macros NeilBrown
2018-01-09  1:19 ` [PATCH 13/14] staging: lustre: replace LIBCFS_CPT_ALLOC() NeilBrown
2018-01-09 15:00 ` [PATCH 00/14] staging:lustre: convert most LIBCFS*ALLOC to k*malloc - V2 Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151546077859.9776.5353432944670337893.stgit@noble \
    --to=neilb@suse.com \
    --cc=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®