X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fsrcu.c;h=b0aeeaf22ce49c8c76098aac5224b1f4c44d4c4d;hb=8009f9fb3067fef6c2ca0c16f6bac786ae28639d;hp=7e1979f624ba57c904c706855c04fd64ed625b49;hpb=621934ee7ed5b073c7fd638b347e632c53572761;p=linux-2.6-omap-h63xx.git diff --git a/kernel/srcu.c b/kernel/srcu.c index 7e1979f624b..b0aeeaf22ce 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c @@ -42,11 +42,12 @@ * to any other function. Each srcu_struct represents a separate domain * of SRCU protection. */ -void init_srcu_struct(struct srcu_struct *sp) +int init_srcu_struct(struct srcu_struct *sp) { sp->completed = 0; - sp->per_cpu_ref = alloc_percpu(struct srcu_struct_array); mutex_init(&sp->mutex); + sp->per_cpu_ref = alloc_percpu(struct srcu_struct_array); + return (sp->per_cpu_ref ? 0 : -ENOMEM); } /* @@ -73,7 +74,7 @@ static int srcu_readers_active_idx(struct srcu_struct *sp, int idx) * severe errors when invoked on an active srcu_struct. That said, it * can be useful as an error check at cleanup time. */ -int srcu_readers_active(struct srcu_struct *sp) +static int srcu_readers_active(struct srcu_struct *sp) { return srcu_readers_active_idx(sp, 0) + srcu_readers_active_idx(sp, 1); } @@ -254,4 +255,3 @@ EXPORT_SYMBOL_GPL(srcu_read_lock); EXPORT_SYMBOL_GPL(srcu_read_unlock); EXPORT_SYMBOL_GPL(synchronize_srcu); EXPORT_SYMBOL_GPL(srcu_batches_completed); -EXPORT_SYMBOL_GPL(srcu_readers_active);