From 6b378382396feb02c79ad562a01955df0529df45 Mon Sep 17 00:00:00 2001 From: Nick Swenson Date: Wed, 2 Oct 2013 17:55:45 -0700 Subject: percpu_ida: Removing unused arguement from alloc_local_tag Removing unused struct percpu_ida *pool from arguements of alloc_local_tag, changed it's one use in percpu_ida.c (nab: Fixed reference of idr.c -> percpu_ida.c) Signed-Off-By: Nick Swenson Signed-off-by: Nicholas Bellinger --- lib/percpu_ida.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c index bab1ba2a4c71..e315903ec63a 100644 --- a/lib/percpu_ida.c +++ b/lib/percpu_ida.c @@ -126,8 +126,7 @@ static inline void alloc_global_tags(struct percpu_ida *pool, min(pool->nr_free, IDA_PCPU_BATCH_MOVE)); } -static inline unsigned alloc_local_tag(struct percpu_ida *pool, - struct percpu_ida_cpu *tags) +static inline unsigned alloc_local_tag(struct percpu_ida_cpu *tags) { int tag = -ENOSPC; @@ -168,7 +167,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, gfp_t gfp) tags = this_cpu_ptr(pool->tag_cpu); /* Fastpath */ - tag = alloc_local_tag(pool, tags); + tag = alloc_local_tag(tags); if (likely(tag >= 0)) { local_irq_restore(flags); return tag; -- cgit v1.2.3-59-g8ed1b From c9e8d128fe316751230ee0c53478740c64f58436 Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Thu, 7 Nov 2013 10:45:35 -0800 Subject: percpu-refcount: Add EXPORT_SYMBOL to use percpu_ref from modules This patch adds EXPORT_SYMBOL() for percpu_ref_init(), percpu_ref_cancel_init() and percpu_ref_kill_and_confirm() so that percpu refcounting can be used by external modules. Cc: Kent Overstreet Signed-off-by: Nicholas Bellinger --- lib/percpu-refcount.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c index 7deeb6297a48..25b9ac7b93e5 100644 --- a/lib/percpu-refcount.c +++ b/lib/percpu-refcount.c @@ -53,6 +53,7 @@ int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release) ref->release = release; return 0; } +EXPORT_SYMBOL(percpu_ref_init); /** * percpu_ref_cancel_init - cancel percpu_ref_init() @@ -84,6 +85,7 @@ void percpu_ref_cancel_init(struct percpu_ref *ref) free_percpu(ref->pcpu_count); } } +EXPORT_SYMBOL(percpu_ref_cancel_init); static void percpu_ref_kill_rcu(struct rcu_head *rcu) { @@ -156,3 +158,4 @@ void percpu_ref_kill_and_confirm(struct percpu_ref *ref, call_rcu_sched(&ref->rcu, percpu_ref_kill_rcu); } +EXPORT_SYMBOL(percpu_ref_kill_and_confirm); -- cgit v1.2.3-59-g8ed1b From fcd40d69afea8700eda8cbf381f6d160cf757ebf Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 19 Nov 2013 10:08:13 -0800 Subject: percpu-refcount: Add percpu-refcount.o to obj-y Drop percpu_ida.o from lib-y since it is also listed in obj-y and it doesn't need to be listed in both places. Move percpu-refcount.o from lib-y to obj-y to fix build errors in target_core_mod: ERROR: "percpu_ref_cancel_init" [drivers/target/target_core_mod.ko] undefined! ERROR: "percpu_ref_kill_and_confirm" [drivers/target/target_core_mod.ko] undefined! ERROR: "percpu_ref_init" [drivers/target/target_core_mod.ko] undefined! Signed-off-by: Randy Dunlap Signed-off-by: Nicholas Bellinger --- lib/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Makefile b/lib/Makefile index f3bb2cb98adf..8ed321179849 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -13,7 +13,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ sha1.o md5.o irq_regs.o reciprocal_div.o argv_split.o \ proportions.o flex_proportions.o prio_heap.o ratelimit.o show_mem.o \ is_single_threaded.o plist.o decompress.o kobject_uevent.o \ - earlycpio.o percpu-refcount.o percpu_ida.o + earlycpio.o obj-$(CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS) += usercopy.o lib-$(CONFIG_MMU) += ioremap.o @@ -26,7 +26,7 @@ obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \ bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \ - percpu_ida.o + percpu-refcount.o percpu_ida.o obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o -- cgit v1.2.3-59-g8ed1b