rcu: Export init_rcu_head() and destroy_rcu_head() to GPL modules
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 7 Dec 2017 17:40:38 +0000 (09:40 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 8 Dec 2017 00:51:49 +0000 (19:51 -0500)
Use of init_rcu_head() and destroy_rcu_head() from modules results in
the following build-time error with CONFIG_DEBUG_OBJECTS_RCU_HEAD=y:

ERROR: "init_rcu_head" [drivers/scsi/scsi_mod.ko] undefined!
ERROR: "destroy_rcu_head" [drivers/scsi/scsi_mod.ko] undefined!

This commit therefore adds EXPORT_SYMBOL_GPL() for each to allow them to
be used by GPL-licensed kernel modules.

Reported-by: Bart Van Assche <Bart.VanAssche@wdc.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
kernel/rcu/update.c

index fbd56d6e575b2b0eaa5a653c7919fe596ee1b8f5..68fa19a5e7bd9a63dcf1e0d3f4b1e59b9113000b 100644 (file)
@@ -422,11 +422,13 @@ void init_rcu_head(struct rcu_head *head)
 {
        debug_object_init(head, &rcuhead_debug_descr);
 }
+EXPORT_SYMBOL_GPL(init_rcu_head);
 
 void destroy_rcu_head(struct rcu_head *head)
 {
        debug_object_free(head, &rcuhead_debug_descr);
 }
+EXPORT_SYMBOL_GPL(destroy_rcu_head);
 
 static bool rcuhead_is_static_object(void *addr)
 {