Export new char dev functions
PATCH 1/1 Export new char dev functions
Nobody told me that the failure to export these (like their block counterparts) was anything but an oversight; modules will not be able to use larger device numbers without them. So...this patch exports the new char device functions.
jon
Jonathan Corbet
Executive editor, LWN.net
[email protected]
kernel/ksyms.c +11 -0
@@ -42,6 +42,7 @@#include <linux/highuid.h> #include <linux/fs.h> #include <linux/fs_struct.h> +#include <linux/cdev.h> #include <linux/uio.h> #include <linux/tty.h> #include <linux/in6.h>
@@ -355,6 +356,16 @@EXPORT_SYMBOL (tty_register_driver);EXPORT_SYMBOL (tty_unregister_driver);EXPORT_SYMBOL (tty_std_termios); +EXPORT_SYMBOL (register_chrdev_region); +EXPORT_SYMBOL (unregister_chrdev_region); +EXPORT_SYMBOL (alloc_chrdev_region); +EXPORT_SYMBOL (cdev_init); +EXPORT_SYMBOL (cdev_alloc); +EXPORT_SYMBOL (cdev_get); +EXPORT_SYMBOL (cdev_put); +EXPORT_SYMBOL (cdev_del); +EXPORT_SYMBOL (cdev_add); +EXPORT_SYMBOL (cdev_unmap);/* block device driver support */ EXPORT_SYMBOL (bmap);
Quoted 4 lines · Jonathan Corbet
Nobody told me that the failure to export these (like their block counterparts) was anything but an oversight; modules will not be able to use larger device numbers without them. So...this patch exports the new char device functions.
How about just exporting them in the files where they are declared? I do not think we want the ksyms.c file to grow anymore.
thanks,
greg k-h
Quoted 2 lines
How about just exporting them in the files where they are declared? I do not think we want the
ksyms.cfile to grow anymore.
Hmm, I figured somebody would say something like that...grumble...mutter... ...complain...gripe...moan...new patch appended...
Of course, there are other exports from that file (i.e. register_chrdev()); are we actively trying to shrink ksyms.c?
jon
Jonathan Corbet
Executive editor, LWN.net
[email protected]
fs/char_dev.c +13 -0
@@ -445,3 +445,16 @@kset_register (&kset_dynamic); cdev_map =kobj_map_init (base_probe, &cdev_subsys); } + + +/* Let modules do char dev stuff */ +EXPORT_SYMBOL (register_chrdev_region); +EXPORT_SYMBOL (unregister_chrdev_region); +EXPORT_SYMBOL (alloc_chrdev_region); +EXPORT_SYMBOL (cdev_init); +EXPORT_SYMBOL (cdev_alloc); +EXPORT_SYMBOL (cdev_get); +EXPORT_SYMBOL (cdev_put); +EXPORT_SYMBOL (cdev_del); +EXPORT_SYMBOL (cdev_add); +EXPORT_SYMBOL (cdev_unmap);
Em Tue, Sep 16, 2003 at 08:36:30PM -0600, Jonathan Corbet escreveu:
Quoted 8 lines
Quoted 2 lines
How about just exporting them in the files where they are declared? I do not think we want the
ksyms.cfile to grow anymore.Hmm, I figured somebody would say something like that...grumble...mutter... ...complain...gripe...moan...new patch appended...
Of course, there are other exports from that file (i.e.
register_chrdev()); are we actively trying to shrinkksyms.c?
Linus call, perhaps, but I for one would love to see it just die, having it in the files that actually implement the functions exported is IMHO more maintainer friendly, not that ksyms.c is that much touched but...
- Arnaldo
Quoted 2 lines · Jonathan Corbet
Of course, there are other exports from that file (i.e.
register_chrdev()); are we actively trying to shrinkksyms.c?
I think we are, yes. ksyms.c just makes life harder.
regards
john
Signature · 2 lines
Khendon's Law: If the same point is made twice by the same person, the thread is over.
Quoted 5 lines
John Levon sez:
Quoted 2 lines
Of course, there are other exports from that file (i.e.
register_chrdev()); are we actively trying to shrinkksyms.c?I think we are, yes.
ksyms.cjust makes life harder.
OK, here is a version that evacutates all of fs/char_dev.c's functions out of ksyms.c. And that, probably, is about all the bandwidth this little patch is worth...
jon
fs/char_dev.c +15 -0
@@ -445,3 +445,18 @@kset_register (&kset_dynamic); cdev_map =kobj_map_init (base_probe, &cdev_subsys); } + + +/* Let modules do char dev stuff */ +EXPORT_SYMBOL (register_chrdev_region); +EXPORT_SYMBOL (unregister_chrdev_region); +EXPORT_SYMBOL (alloc_chrdev_region); +EXPORT_SYMBOL (cdev_init); +EXPORT_SYMBOL (cdev_alloc); +EXPORT_SYMBOL (cdev_get); +EXPORT_SYMBOL (cdev_put); +EXPORT_SYMBOL (cdev_del); +EXPORT_SYMBOL (cdev_add); +EXPORT_SYMBOL (cdev_unmap); +EXPORT_SYMBOL (register_chrdev); +EXPORT_SYMBOL (unregister_chrdev);
kernel/ksyms.c +0 -2
@@ -348,8 +348,6 @@EXPORT_SYMBOL (unlock_page);/* device registration */ -EXPORT_SYMBOL (register_chrdev); -EXPORT_SYMBOL (unregister_chrdev);EXPORT_SYMBOL (register_blkdev);EXPORT_SYMBOL (unregister_blkdev);EXPORT_SYMBOL (tty_register_driver);
fs/char_dev.c
Quoted 15 lines · Jonathan Corbet
Quoted 5 lines
John Levon sez:
Quoted 2 lines
Of course, there are other exports from that file (i.e.
register_chrdev()); are we actively trying to shrinkksyms.c?I think we are, yes.
ksyms.cjust makes life harder.OK, here is a version that evacutates all of fs/char_dev.c's functions out of
ksyms.c. And that, probably, is about all the bandwidth this little patch is worth...jon
diff -urN -X dontdiff
test5-vanilla/fs/char_dev.ctest5/fs/char_dev.cfs/char_dev.c +0
-0
Need to modify export-objs line in fs/Makefile too.
Jeff
Quoted 1 line
Need to modify export-objs line in fs/Makefile too.
I do? In 2.5?? I thought that was old, obsolete stuff?
I sure don't find any export-objs lines in -test5...
jon
Quoted 5 lines · Jonathan Corbet
Quoted 1 line
Need to modify export-objs line in fs/Makefile too.
I do? In 2.5?? I thought that was old, obsolete stuff?
I sure don't find any export-objs lines in -test5...
Nope, you're correct. I was looking at 2.4...
Jeff
Quoted 8 lines · Jonathan Corbet
Quoted 2 lines
How about just exporting them in the files where they are declared? I do not think we want the
ksyms.cfile to grow anymore.Hmm, I figured somebody would say something like that...grumble...mutter... ...complain...gripe...moan...new patch appended...
Of course, there are other exports from that file (i.e.
register_chrdev()); are we actively trying to shrinkksyms.c?
I just think we aren't trying to grow it at this time :)
thanks,
greg k-h