Messages in this thread Patch in this message | | | Date | Fri, 11 Apr 2008 18:17:10 +0200 | From | Nadia.Derbey@bull ... | Subject | [PATCH 08/13] Fix ridr_get_new_above_int() |
| |
[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@bull.net>
--- 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 */ --
| |