2003-09-16 18:18:06

by Jonathan Corbet

[permalink] [raw]
Subject: [PATCH] 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]


--- test5-vanilla/kernel/ksyms.c Wed Sep 17 01:58:05 2003
+++ test5/kernel/ksyms.c Wed Sep 17 02:05:29 2003
@@ -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);


2003-09-16 23:57:11

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

On Tue, Sep 16, 2003 at 12:18:02PM -0600, Jonathan Corbet wrote:
> 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

2003-09-17 02:36:34

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev 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.

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]

--- test5-vanilla/fs/char_dev.c Mon Sep 8 13:50:01 2003
+++ test5/fs/char_dev.c Wed Sep 17 10:19:18 2003
@@ -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);

2003-09-17 02:44:04

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

Em Tue, Sep 16, 2003 at 08:36:30PM -0600, Jonathan Corbet escreveu:
> > 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.
>
> 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?

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

2003-09-17 02:49:15

by John Levon

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

On Tue, Sep 16, 2003 at 08:36:30PM -0600, Jonathan Corbet wrote:

> Of course, there are other exports from that file (i.e. register_chrdev());
> are we actively trying to shrink ksyms.c?

I think we are, yes. ksyms.c just makes life harder.

regards
john

--
Khendon's Law:
If the same point is made twice by the same person, the thread is over.

2003-09-17 16:36:31

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

> John Levon sez:
> > Of course, there are other exports from that file (i.e. register_chrdev());
> > are we actively trying to shrink ksyms.c?
>
> I think we are, yes. ksyms.c just 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.c test5/fs/char_dev.c
--- test5-vanilla/fs/char_dev.c Mon Sep 8 13:50:01 2003
+++ test5/fs/char_dev.c Wed Sep 17 10:45:46 2003
@@ -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);

diff -urN -X dontdiff test5-vanilla/kernel/ksyms.c test5/kernel/ksyms.c
--- test5-vanilla/kernel/ksyms.c Wed Sep 17 01:58:05 2003
+++ test5/kernel/ksyms.c Wed Sep 17 10:45:46 2003
@@ -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);

2003-09-17 17:25:10

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

On Tue, Sep 16, 2003 at 08:36:30PM -0600, Jonathan Corbet wrote:
> > 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.
>
> 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?

I just think we aren't trying to grow it at this time :)

thanks,

greg k-h

2003-09-17 22:49:59

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

On Wed, Sep 17, 2003 at 10:36:28AM -0600, Jonathan Corbet wrote:
> > John Levon sez:
> > > Of course, there are other exports from that file (i.e. register_chrdev());
> > > are we actively trying to shrink ksyms.c?
> >
> > I think we are, yes. ksyms.c just 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.c test5/fs/char_dev.c
> --- test5-vanilla/fs/char_dev.c Mon Sep 8 13:50:01 2003
> +++ test5/fs/char_dev.c Wed Sep 17 10:45:46 2003

Need to modify export-objs line in fs/Makefile too.

Jeff



2003-09-17 23:03:57

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

> 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

2003-09-17 23:09:27

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] Export new char dev functions

On Wed, Sep 17, 2003 at 05:03:53PM -0600, Jonathan Corbet wrote:
> > 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