[PATCH 04/10] Introduce ridr_init()

From: Nadia . Derbey
Date: Tue Apr 29 2008 - 10:39:00 EST


[PATCH 04/10]

This patch introduces the ridr_init() routine.

Signed-off-by: Nadia Derbey <Nadia.Derbey@xxxxxxxx>

---
include/linux/ridr.h | 1 +
lib/ridr.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)

Index: linux-2.6.25-mm1/include/linux/ridr.h
===================================================================
--- linux-2.6.25-mm1.orig/include/linux/ridr.h 2008-04-29 13:14:56.000000000 +0200
+++ linux-2.6.25-mm1/include/linux/ridr.h 2008-04-29 13:21:56.000000000 +0200
@@ -44,6 +44,7 @@ struct ridr {
* This is what we export.
*/
int ridr_pre_get(struct ridr *, gfp_t);
+void ridr_init(struct ridr *);


void __init ridr_init_cache(void);
Index: linux-2.6.25-mm1/lib/ridr.c
===================================================================
--- linux-2.6.25-mm1.orig/lib/ridr.c 2008-04-29 13:17:59.000000000 +0200
+++ linux-2.6.25-mm1/lib/ridr.c 2008-04-29 13:23:17.000000000 +0200
@@ -70,3 +70,17 @@ void __init ridr_init_cache(void)
ridr_cache_ctor);
}

+/**
+ * ridr_init - initialize ridr handle
+ * @idp: ridr handle
+ *
+ * This function is used to set up the handle (@idp) that you will pass
+ * to the rest of the functions.
+ */
+void ridr_init(struct ridr *idp)
+{
+ memset(idp, 0, sizeof(struct ridr));
+ spin_lock_init(&idp->lock);
+}
+EXPORT_SYMBOL(ridr_init);
+

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