lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1430601408-12847-1-git-send-email-Julia.Lawall@lip6.fr>
Date:	Sat,  2 May 2015 23:16:48 +0200
From:	Julia Lawall <Julia.Lawall@...6.fr>
To:	Oleg Drokin <oleg.drokin@...el.com>
Cc:	kernel-janitors@...r.kernel.org,
	Andreas Dilger <andreas.dilger@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	HPDD-discuss@...ts.01.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] staging: lustre: obd_support: Add obd_cpt_alloc function

Summarize OBD_CPT_ALLOC_GFP, OBD_CPT_ALLOC, and OBD_CPT_ALLOC_PTR as a
function, obd_cpt_alloc.

Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>

---

Some questions: Is the name OK?  Is the NULL test needed?  If not, should
the call to kzalloc_node with the call to cfs_cpt_spread_node just be
inlined into the call sites?

 drivers/staging/lustre/lustre/include/obd_support.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index 2991d2e..3d380f0 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -655,6 +655,15 @@ do {									      \
 #define OBD_CPT_ALLOC_PTR(ptr, cptab, cpt)				      \
 	OBD_CPT_ALLOC(ptr, cptab, cpt, sizeof(*(ptr)))
 
+static inline void *obd_cpt_alloc(struct cfs_cpt_table *cptab, int cpt,
+				  size_t size, gfp_t flags)
+{
+	return (cptab) == NULL ?
+		kzalloc(size, flags) :
+		kzalloc_node(size, flags, cfs_cpt_spread_node(cptab, cpt));
+}
+
+
 # define __OBD_VMALLOC_VEROBSE(ptr, cptab, cpt, size)			      \
 do {									      \
 	(ptr) = cptab == NULL ?						      \

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ