[PATCH 08/13] Fix ridr_get_new_above_int()

From: Nadia . Derbey
Date: Fri Apr 11 2008 - 12:22:41 EST


[PATCH 08/13]

This patch only fixes the ridr_get_new_above_int() portion of ridr.c, to make
it RCU based.

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

---
lib/ridr.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

Index: linux-2.6.25-rc8-mm1/lib/ridr.c
===================================================================
--- linux-2.6.25-rc8-mm1.orig/lib/ridr.c 2008-04-11 17:55:37.000000000 +0200
+++ linux-2.6.25-rc8-mm1/lib/ridr.c 2008-04-11 17:58:41.000000000 +0200
@@ -256,7 +256,8 @@ static int ridr_get_new_above_int(struct
* Successfully found an empty slot. Install the user
* pointer and mark the slot full.
*/
- pa[0]->ary[id & IDR_MASK] = (struct ridr_layer *)ptr;
+ rcu_assign_pointer(pa[0]->ary[id & IDR_MASK],
+ (struct ridr_layer *)ptr);
pa[0]->count++;
ridr_mark_full(pa, id);
}
@@ -273,9 +274,9 @@ static int ridr_get_new_above_int(struct
* This is the allocate id function. It should be called with any
* required locks.
*
- * If memory is required, it will return -EAGAIN, you should unlock
- * and go back to the ridr_pre_get() call. If the ridr is full, it will
- * return -ENOSPC.
+ * If memory is required, it will return -EAGAIN, you should unlock, enable
+ * preemption and go back to the ridr_pre_get() call.
+ * If the ridr is full, it will return -ENOSPC.
*
* @id returns a value in the range 0 ... 0x7fffffff
*/

--
--
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/