[patch] Exported some extra symbols for modules

Arjan van de Ven (arjan@fenrus.demon.nl)
Fri, 4 Jun 1999 20:29:25 +0200 (CEST)


Hi,

This patch exports the symbols (patch agains 2.2.9 at the end of the
message)

do_generic_file_read
tcp_reset_xmit_timer
tcp_write_xmit

for modules. I need "do_generic_file_read" to build my own "sendfile from
struct file to struct socket". The later two are for a module-version of
"TCP_CORK". Using these symbols increases the number of
http-requests/second by over 20% (to over 1400 for 1K files, 900 for 8K
files; this is more than the C'T guy benchmarked for a quad Xeon
machine using NT; I use only a K6-2 350Mhz).

One more question:

"sendfile" holds the global kernel-lock. Is it possible to remove this
somehow?

Greetings,
Arjan van de Ven

diff -u -r linux/include/linux/fs.h /nfs/usr/src/linux/include/linux/fs.h
--- linux/include/linux/fs.h Sun Jun 6 00:42:16 1999
+++ /nfs/usr/src/linux/include/linux/fs.h Sun May 30 10:05:49 1999
@@ -822,6 +824,17 @@
#define LOOKUP_SLASHOK (4)
#define LOOKUP_CONTINUE (8)

+
+typedef struct {
+ size_t written;
+ size_t count;
+ char * buf;
+ int error;
+} read_descriptor_t;
+
+typedef int (*read_actor_t)(read_descriptor_t *, const char *, unsigned long);
+
+
extern struct dentry * lookup_dentry(const char *, struct dentry *, unsigned int);
extern struct dentry * __namei(const char *, unsigned int);

@@ -865,6 +878,8 @@
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*);
+extern void do_generic_file_read(struct file * filp, loff_t *ppos, read_descriptor_t * desc, read_actor_t actor);
+

extern struct super_block *get_super(kdev_t dev);
extern void put_super(kdev_t dev);
diff -u -r linux/kernel/ksyms.c /nfs/usr/src/linux/kernel/ksyms.c
--- linux/kernel/ksyms.c Sun Jun 6 00:41:19 1999
+++ /nfs/usr/src/linux/kernel/ksyms.c Sun May 30 10:03:21 1999
@@ -162,6 +162,7 @@
EXPORT_SYMBOL(mark_buffer_uptodate);
EXPORT_SYMBOL(add_blkdev_randomness);
EXPORT_SYMBOL(generic_file_read);
+EXPORT_SYMBOL(do_generic_file_read);
EXPORT_SYMBOL(generic_file_write);
EXPORT_SYMBOL(generic_file_mmap);
EXPORT_SYMBOL(generic_readpage);
diff -u -r linux/mm/filemap.c /nfs/usr/src/linux/mm/filemap.c
--- linux/mm/filemap.c Sun Jun 6 00:42:16 1999
+++ /nfs/usr/src/linux/mm/filemap.c Sun May 30 10:07:54 1999
@@ -556,14 +556,6 @@
* The simplest case just copies the data to user
* mode.
*/
-typedef struct {
- size_t written;
- size_t count;
- char * buf;
- int error;
-} read_descriptor_t;
-
-typedef int (*read_actor_t)(read_descriptor_t *, const char *, unsigned long);

/*
* This is a generic file read routine, and uses the
@@ -573,7 +565,7 @@
* This is really ugly. But the goto's actually try to clarify some
* of the logic when it comes to error handling etc.
*/
-static void do_generic_file_read(struct file * filp, loff_t *ppos, read_descriptor_t * desc, read_actor_t actor)
+void do_generic_file_read(struct file * filp, loff_t *ppos, read_descriptor_t * desc, read_actor_t actor)
{
struct dentry *dentry = filp->f_dentry;
struct inode *inode = dentry->d_inode;
@@ -1726,3 +1718,4 @@
}
}
}
+
diff -u -r linux/net/netsyms.c /nfs/usr/src/linux/net/netsyms.c
--- linux/net/netsyms.c Sun Jun 6 00:41:57 1999
+++ /nfs/usr/src/linux/net/netsyms.c Thu Jun 3 18:30:33 1999
@@ -224,6 +224,8 @@

#ifdef CONFIG_INET
/* Internet layer registration */
+EXPORT_SYMBOL(tcp_reset_xmit_timer);
+EXPORT_SYMBOL(tcp_write_xmit);
EXPORT_SYMBOL(inet_add_protocol);
EXPORT_SYMBOL(inet_del_protocol);
EXPORT_SYMBOL(rarp_ioctl_hook);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/