Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752585AbbECOQ1 (ORCPT ); Sun, 3 May 2015 10:16:27 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:47583 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbbECOP7 (ORCPT ); Sun, 3 May 2015 10:15:59 -0400 X-IronPort-AV: E=Sophos;i="5.13,360,1427752800"; d="scan'208";a="138719315" From: Julia Lawall To: Oleg Drokin Cc: kernel-janitors@vger.kernel.org, Andreas Dilger , Greg Kroah-Hartman , HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3 v2] staging: lustre: ptlrpc: nrs_fifo: Replace OBD_CPT_ALLOC etc by kzalloc_node Date: Sun, 3 May 2015 16:07:18 +0200 Message-Id: <1430662039-26557-3-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1430662039-26557-1-git-send-email-Julia.Lawall@lip6.fr> References: <1430662039-26557-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1734 Lines: 46 Replace OBD_CPT_ALLOC, OBD_CPT_ALLOC_PTR, and OBD_CPT_ALLOC_GFP by corresponding calls to kzalloc_node. The semantic patch for the OBD_CPT_ALLOC case is as follows: (http://coccinelle.lip6.fr/). // @@ expression ptr,cptab,cpt,size; @@ - OBD_CPT_ALLOC(ptr, cptab, cpt, size) + ptr = kzalloc_node(size, GFP_NOFS, cfs_cpt_spread_node(cptab, cpt)) // Note that the original OBD macros would check if the cptab argument was NULL and fall back on kzalloc in that case. Oleg Drokin argues that this test is not needed because the code containing these calls is only invoked after initialization has been completed, in which case the possible cptab arguments are not NULL. Signed-off-by: Julia Lawall --- v2: improve the subject line drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c index 2eefa25..6a61c85 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c @@ -80,7 +80,9 @@ static int nrs_fifo_start(struct ptlrpc_nrs_policy *policy) { struct nrs_fifo_head *head; - OBD_CPT_ALLOC_PTR(head, nrs_pol2cptab(policy), nrs_pol2cptid(policy)); + head = kzalloc_node(sizeof(*head), GFP_NOFS, + cfs_cpt_spread_node(nrs_pol2cptab(policy), + nrs_pol2cptid(policy))); if (head == NULL) return -ENOMEM; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/