Skip to contentSkip to conversation

Take 3 of nuking kernel/ksyms.c

PATCH New Arnaldo Carvalho de Melo 1 participant 1 message Oct 1, 2003

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Take 3 of nuking kernel/ksyms.c

Hi Linus,

Please pull from:

bk://kernel.bkbits.net/acme/ksyms-2.6

Thanks,

- Arnaldo

===================================================================

[email protected], 2003-10-01 20:26:23-03:00, [email protected]
o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/seq_file.c

[email protected], 2003-10-01 20:20:46-03:00, [email protected]
o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/exec.c

[email protected], 2003-10-01 20:12:48-03:00, [email protected]
o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/inode.c

[email protected], 2003-10-01 19:56:11-03:00, [email protected]
o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to kernel/sysctl.c

[email protected], 2003-10-01 19:36:58-03:00, [email protected]
o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/super.c

[email protected], 2003-10-01 19:16:46-03:00, [email protected]
o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/block_dev.c

 fs/block_dev.c  |   32 ++++++++++++++++++++
 fs/exec.c       |   26 ++++++++++++++++
 fs/inode.c      |   43 +++++++++++++++++++++------
 fs/seq_file.c   |   27 +++++++++++++++--
 fs/super.c      |   29 ++++++++++++++++++
 kernel/ksyms.c  |   88 --------------------------------------------------------
 kernel/sysctl.c |   17 ++++++++++
 7 files changed, 162 insertions(+), 100 deletions(-)
fs/block_dev.c +32 -0
diff -Nru a/fs/block_dev.c b/fs/block_dev.c
@@ -70,6 +70,8 @@
 	return 0;
 }
 
+EXPORT_SYMBOL(set_blocksize);
+
 int sb_set_blocksize(struct super_block *sb, int size)
 {
 	int bits;
@@ -82,6 +84,8 @@
 	return sb->s_blocksize;
 }
 
+EXPORT_SYMBOL(sb_set_blocksize);
+
 int sb_min_blocksize(struct super_block *sb, int size)
 {
 	int minsize = bdev_hardsect_size(sb->s_bdev);
@@ -90,6 +94,8 @@
 	return sb_set_blocksize(sb, size);
 }
 
+EXPORT_SYMBOL(sb_min_blocksize);
+
 static int
 blkdev_get_block(struct inode *inode, sector_t iblock,
 		struct buffer_head *bh, int create)
@@ -358,6 +364,8 @@
 	return bdev;
 }
 
+EXPORT_SYMBOL(bdget);
+
 long nr_blockdev_pages(void)
 {
 	struct list_head *p;
@@ -376,6 +384,8 @@
 {
 	iput(bdev->bd_inode);
 }
+
+EXPORT_SYMBOL(bdput);
  
 int bd_acquire(struct inode *inode)
 {
@@ -444,6 +454,8 @@
 	return res;
 }
 
+EXPORT_SYMBOL(bd_claim);
+
 void bd_release(struct block_device *bdev)
 {
 	spin_lock(&bdev_lock);
@@ -454,6 +466,8 @@
 	spin_unlock(&bdev_lock);
 }
 
+EXPORT_SYMBOL(bd_release);
+
 /*
  * Tries to open block device by device number.  Use it ONLY if you
  * really do not have anything better - i.e. when you are behind a
@@ -471,6 +485,8 @@
 	return err ? ERR_PTR(err) : bdev;
 }
 
+EXPORT_SYMBOL(open_by_devnum);
+
 /*
  * This routine checks whether a removable media has been changed,
  * and invalidates all buffer-cache-entries in that case. This
@@ -500,6 +516,8 @@
 	return 1;
 }
 
+EXPORT_SYMBOL(check_disk_change);
+
 static void bd_set_size(struct block_device *bdev, loff_t size)
 {
 	unsigned bsize = bdev_hardsect_size(bdev);
@@ -632,6 +650,8 @@
 	return do_open(bdev, bdev->bd_inode, &fake_file);
 }
 
+EXPORT_SYMBOL(blkdev_get);
+
 int blkdev_open(struct inode * inode, struct file * filp)
 {
 	struct block_device *bdev;
@@ -662,6 +682,8 @@
 	return res;
 }
 
+EXPORT_SYMBOL(blkdev_open);
+
 int blkdev_put(struct block_device *bdev, int kind)
 {
 	int ret = 0;
@@ -710,6 +732,8 @@
 	return ret;
 }
 
+EXPORT_SYMBOL(blkdev_put);
+
 int blkdev_close(struct inode * inode, struct file * filp)
 {
 	if (inode->i_bdev->bd_holder == filp)
@@ -760,6 +784,8 @@
 	.sendfile	= generic_file_sendfile,
 };
 
+EXPORT_SYMBOL(def_blk_fops);
+
 int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg)
 {
 	int res;
@@ -770,6 +796,8 @@
 	return res;
 }
 
+EXPORT_SYMBOL(ioctl_by_bdev);
+
 /**
  * lookup_bdev  - lookup a struct block_device by name
  *
@@ -854,6 +882,8 @@
 	return ERR_PTR(error);
 }
 
+EXPORT_SYMBOL(open_bdev_excl);
+
 /**
  * close_bdev_excl  -  release a blockdevice openen by open_bdev_excl()
  *
@@ -867,3 +897,5 @@
 	bd_release(bdev);
 	blkdev_put(bdev, kind);
 }
+
+EXPORT_SYMBOL(close_bdev_excl);
fs/exec.c +26 -0
diff -Nru a/fs/exec.c b/fs/exec.c
@@ -83,6 +83,8 @@
 	return 0;	
 }
 
+EXPORT_SYMBOL(register_binfmt);
+
 int unregister_binfmt(struct linux_binfmt * fmt)
 {
 	struct linux_binfmt ** tmp = &formats;
@@ -100,6 +102,8 @@
 	return -EINVAL;
 }
 
+EXPORT_SYMBOL(unregister_binfmt);
+
 static inline void put_binfmt(struct linux_binfmt * fmt)
 {
 	module_put(fmt->module);
@@ -281,6 +285,8 @@
 	return r;
 }
 
+EXPORT_SYMBOL(copy_strings_kernel);
+
 #ifdef CONFIG_MMU
 /*
  * This routine is used to map in a page into an address space: needed by
@@ -443,6 +449,8 @@
 	return 0;
 }
 
+EXPORT_SYMBOL(setup_arg_pages);
+
 #define free_arg_pages(bprm) do { } while (0)
 
 #else
@@ -493,6 +501,8 @@
 	goto out;
 }
 
+EXPORT_SYMBOL(open_exec);
+
 int kernel_read(struct file *file, unsigned long offset,
 	char *addr, unsigned long count)
 {
@@ -508,6 +518,8 @@
 	return result;
 }
 
+EXPORT_SYMBOL(kernel_read);
+
 static int exec_mmap(struct mm_struct *mm)
 {
 	struct task_struct *tsk;
@@ -822,6 +834,8 @@
 	return retval;
 }
 
+EXPORT_SYMBOL(flush_old_exec);
+
 /*
  * We mustn't allow tracing of suid binaries, unless
  * the tracer has the capability to trace anything..
@@ -878,6 +892,8 @@
 	return kernel_read(bprm->file,0,bprm->buf,BINPRM_BUF_SIZE);
 }
 
+EXPORT_SYMBOL(prepare_binprm);
+
 /*
  * This function is used to produce the new IDs and capabilities
  * from the old ones and the file's capabilities.
@@ -918,6 +934,8 @@
 	security_bprm_compute_creds(bprm);
 }
 
+EXPORT_SYMBOL(compute_creds);
+
 void remove_arg_zero(struct linux_binprm *bprm)
 {
 	if (bprm->argc) {
@@ -942,6 +960,8 @@
 	}
 }
 
+EXPORT_SYMBOL(remove_arg_zero);
+
 /*
  * cycle the list of binary formats handler, until one recognizes the image
  */
@@ -1037,6 +1057,8 @@
 	return retval;
 }
 
+EXPORT_SYMBOL(search_binary_handler);
+
 /*
  * sys_execve() executes a new program.
  */
@@ -1133,6 +1155,8 @@
 	return retval;
 }
 
+EXPORT_SYMBOL(do_execve);
+
 int set_binfmt(struct linux_binfmt *new)
 {
 	struct linux_binfmt *old = current->binfmt;
@@ -1146,6 +1170,8 @@
 		module_put(old->module);
 	return 0;
 }
+
+EXPORT_SYMBOL(set_binfmt);
 
 #define CORENAME_MAX_SIZE 64
 
fs/inode.c +34 -9

220 lines not on this page · raw message

fs/seq_file.c +24 -3
diff -Nru a/fs/seq_file.c b/fs/seq_file.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/fs.h>
+#include <linux/module.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 
@@ -37,6 +38,8 @@
 	return 0;
 }
 
+EXPORT_SYMBOL(seq_open);
+
 /**
  *	seq_read -	->read() method for sequential files.
  *	@file, @buf, @size, @ppos: see file_operations method
@@ -144,6 +147,8 @@
 	goto Done;
 }
 
+EXPORT_SYMBOL(seq_read);
+
 static int traverse(struct seq_file *m, loff_t offset)
 {
 	loff_t pos = 0;
@@ -228,6 +233,8 @@
 	return retval;
 }
 
+EXPORT_SYMBOL(seq_lseek);
+
 /**
  *	seq_release -	free the structures associated with sequential file.
  *	@file: file in question
@@ -244,6 +251,8 @@
 	return 0;
 }
 
+EXPORT_SYMBOL(seq_release);
+
 /**
  *	seq_escape -	print string into buffer, escaping some characters
  *	@m:	target buffer
@@ -279,6 +288,8 @@
         return 0;
 }
 
+EXPORT_SYMBOL(seq_escape);
+
 int seq_printf(struct seq_file *m, const char *f, ...)
 {
 	va_list args;
@@ -297,9 +308,11 @@
 	return -1;
 }
 
+EXPORT_SYMBOL(seq_printf);
+
 int seq_path(struct seq_file *m,
-		struct vfsmount *mnt, struct dentry *dentry,
-		char *esc)
+	     struct vfsmount *mnt, struct dentry *dentry,
+	     char *esc)
 {
 	if (m->count < m->size) {
 		char *s = m->buf + m->count;
@@ -328,6 +341,8 @@
 	return -1;
 }
 
+EXPORT_SYMBOL(seq_path);
+
 static void *single_start(struct seq_file *p, loff_t *pos)
 {
 	return NULL + (*pos == 0);
@@ -343,7 +358,8 @@
 {
 }
 
-int single_open(struct file *file, int (*show)(struct seq_file *, void*), void *data)
+int single_open(struct file *file, int (*show)(struct seq_file *, void *),
+		void *data)
 {
 	struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL);
 	int res = -ENOMEM;
@@ -362,6 +378,8 @@
 	return res;
 }
 
+EXPORT_SYMBOL(single_open);
+
 int single_release(struct inode *inode, struct file *file)
 {
 	struct seq_operations *op = ((struct seq_file *)file->private_data)->op;
@@ -370,6 +388,8 @@
 	return res;
 }
 
+EXPORT_SYMBOL(single_release);
+
 int seq_release_private(struct inode *inode, struct file *file)
 {
 	struct seq_file *seq = file->private_data;
@@ -379,3 +399,4 @@
 	return seq_release(inode, file);
 }
 
+EXPORT_SYMBOL(seq_release_private);
fs/super.c +29 -0
diff -Nru a/fs/super.c b/fs/super.c
@@ -21,6 +21,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/acct.h>
@@ -134,6 +135,8 @@
 	}
 }
 
+EXPORT_SYMBOL(deactivate_super);
+
 /**
  *	grab_super	- acquire an active reference
  *	@s	- reference we are trying to make active
@@ -214,6 +217,8 @@
 	up_write(&sb->s_umount);
 }
 
+EXPORT_SYMBOL(generic_shutdown_super);
+
 /**
  *	sget	-	find or create a superblock
  *	@type:	filesystem type superblock should belong to
@@ -259,12 +264,16 @@
 	return s;
 }
 
+EXPORT_SYMBOL(sget);
+
 void drop_super(struct super_block *sb)
 {
 	up_read(&sb->s_umount);
 	put_super(sb);
 }
 
+EXPORT_SYMBOL(drop_super);
+
 static inline void write_super(struct super_block *sb)
 {
 	lock_super(sb);
@@ -382,6 +391,8 @@
 	spin_unlock(&sb_lock);
 	return NULL;
 }
+
+EXPORT_SYMBOL(get_super);
  
 struct super_block * user_get_super(dev_t dev)
 {
@@ -405,6 +416,8 @@
 	return NULL;
 }
 
+EXPORT_SYMBOL(user_get_super);
+
 asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf)
 {
         struct super_block *s;
@@ -534,6 +547,8 @@
 	return 0;
 }
 
+EXPORT_SYMBOL(set_anon_super);
+
 void kill_anon_super(struct super_block *sb)
 {
 	int slot = MINOR(sb->s_dev);
@@ -543,6 +558,8 @@
 	spin_unlock(&unnamed_dev_lock);
 }
 
+EXPORT_SYMBOL(kill_anon_super);
+
 void kill_litter_super(struct super_block *sb)
 {
 	if (sb->s_root)
@@ -550,6 +567,8 @@
 	kill_anon_super(sb);
 }
 
+EXPORT_SYMBOL(kill_litter_super);
+
 static int set_bdev_super(struct super_block *s, void *data)
 {
 	s->s_bdev = data;
@@ -608,6 +627,8 @@
 	return s;
 }
 
+EXPORT_SYMBOL(get_sb_bdev);
+
 void kill_block_super(struct super_block *sb)
 {
 	struct block_device *bdev = sb->s_bdev;
@@ -616,6 +637,8 @@
 	close_bdev_excl(bdev, BDEV_FS);
 }
 
+EXPORT_SYMBOL(kill_block_super);
+
 struct super_block *get_sb_nodev(struct file_system_type *fs_type,
 	int flags, void *data,
 	int (*fill_super)(struct super_block *, void *, int))
@@ -638,6 +661,8 @@
 	return s;
 }
 
+EXPORT_SYMBOL(get_sb_nodev);
+
 static int compare_single(struct super_block *s, void *p)
 {
 	return 1;
@@ -667,6 +692,8 @@
 	return s;
 }
 
+EXPORT_SYMBOL(get_sb_single);
+
 struct vfsmount *
 do_kern_mount(const char *fstype, int flags, const char *name, void *data)
 {
@@ -709,3 +736,5 @@
 {
 	return do_kern_mount(type->name, 0, type->name, NULL);
 }
+
+EXPORT_SYMBOL(kern_mount);
kernel/ksyms.c +0 -88

154 lines not on this page · raw message

kernel/sysctl.c +17 -0
diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c
@@ -19,6 +19,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
@@ -1994,3 +1995,19 @@
 }
 
 #endif /* CONFIG_SYSCTL */
+
+/*
+ * No sense putting this after each symbol definition, twice,
+ * exception granted :-)
+ */
+EXPORT_SYMBOL(proc_dointvec);
+EXPORT_SYMBOL(proc_dointvec_jiffies);
+EXPORT_SYMBOL(proc_dointvec_minmax);
+EXPORT_SYMBOL(proc_dostring);
+EXPORT_SYMBOL(proc_doulongvec_minmax);
+EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
+EXPORT_SYMBOL(register_sysctl_table);
+EXPORT_SYMBOL(sysctl_intvec);
+EXPORT_SYMBOL(sysctl_jiffies);
+EXPORT_SYMBOL(sysctl_string);
+EXPORT_SYMBOL(unregister_sysctl_table);