aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.rootkeys4
-rw-r--r--tools/control/src/org/xenoserver/control/PartitionManager.java14
-rw-r--r--tools/control/src/org/xenoserver/control/Settings.java2
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c12
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile2
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c111
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c12
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c10
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c12
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c5
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile2
-rw-r--r--xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c18
-rw-r--r--xenolinux-2.4.22-sparse/drivers/block/genhd.c258
-rw-r--r--xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c2
-rw-r--r--xenolinux-2.4.22-sparse/drivers/char/tty_io.c8
-rw-r--r--xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h13
16 files changed, 187 insertions, 298 deletions
diff --git a/.rootkeys b/.rootkeys
index 3f76111e8f..d8010aea92 100644
--- a/.rootkeys
+++ b/.rootkeys
@@ -524,6 +524,7 @@
3e6377f8Me8IqtvEhb70XFgOvqQH7A xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c
3e6377fbMjXWAQd0XN0FWv4fDEo6fg xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/dom_mem_ops.h
3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile
+3f689056Vxx_8K8DQTRysOxx_ikmLg xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c
3e67f822FOPwqHiaRKbrskgWgoNL5g xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.h
3e677190SjkzJIvFifRVeYpIZOCtYA xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_ide.c
@@ -552,13 +553,13 @@
3e5a4e66aHCbQ_F5QZ8VeyikLmuRZQ xenolinux-2.4.22-sparse/arch/xeno/kernel/traps.c
3e5a4e66-9_NczrVMbuQkoSLyXckIw xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile
3e5a4e6637ZDk0BvFEC-aFQs599-ng xenolinux-2.4.22-sparse/arch/xeno/lib/delay.c
+3f68905cF5i8-NYpIhGjKmh0y8Gu5g xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c
3e5a4e66croVgpcJyJuF2ycQw0HuJw xenolinux-2.4.22-sparse/arch/xeno/mm/Makefile
3e5a4e66l8Q5Tv-6B3lQIRmaVbFPzg xenolinux-2.4.22-sparse/arch/xeno/mm/fault.c
3e5a4e668SE9rixq4ahho9rNhLUUFQ xenolinux-2.4.22-sparse/arch/xeno/mm/hypervisor.c
3e5a4e661gLzzff25pJooKIIWe7IWg xenolinux-2.4.22-sparse/arch/xeno/mm/init.c
3f0bed43UUdQichXAiVNrjV-y2Kzcg xenolinux-2.4.22-sparse/arch/xeno/mm/ioremap.c
3e5a4e66qRlSTcjafidMB6ulECADvg xenolinux-2.4.22-sparse/arch/xeno/vmlinux.lds
-3ea53c6em6uzVHSiGqrbbAVofyRY_g xenolinux-2.4.22-sparse/drivers/block/genhd.c
3e5a4e66mrtlmV75L1tjKDg8RaM5gA xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c
3f108aeaLcGDgQdFAANLTUEid0a05w xenolinux-2.4.22-sparse/drivers/char/mem.c
3e5a4e66rw65CxyolW9PKz4GG42RcA xenolinux-2.4.22-sparse/drivers/char/tty_io.c
@@ -589,6 +590,7 @@
3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA xenolinux-2.4.22-sparse/include/asm-xeno/smp.h
3e5a4e68mTr0zcp9SXDbnd-XLrrfxw xenolinux-2.4.22-sparse/include/asm-xeno/system.h
3f1056a9L_kqHcFheV00KbKBzv9j5w xenolinux-2.4.22-sparse/include/asm-xeno/vga.h
+3f689063nhrIRsMMZjZxMFk7iEINqQ xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h
3f056927gMHl7mWB89rb73JahbhQIA xenolinux-2.4.22-sparse/include/linux/blk.h
3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux-2.4.22-sparse/include/linux/major.h
3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.22-sparse/include/linux/sunrpc/debug.h
diff --git a/tools/control/src/org/xenoserver/control/PartitionManager.java b/tools/control/src/org/xenoserver/control/PartitionManager.java
index b638e14922..6180a18f44 100644
--- a/tools/control/src/org/xenoserver/control/PartitionManager.java
+++ b/tools/control/src/org/xenoserver/control/PartitionManager.java
@@ -20,7 +20,7 @@ import java.util.Vector;
public class PartitionManager {
/** The proc header string, used to check that this is a suitable proc file. */
private static final String PROC_TEMPLATE =
- "major minor #blocks start_sect nr_sects name";
+ "major minor start_sector num_sectors name";
/** The single PartitionManager reference. */
public static final PartitionManager IT =
@@ -59,12 +59,12 @@ public class PartitionManager {
while (str != null) {
Partition partition =
new Partition(
- Integer.parseInt(str.substring(0, 5).trim()),
- Integer.parseInt(str.substring(5, 10).trim()),
- Integer.parseInt(str.substring(10, 21).trim()),
- Integer.parseInt(str.substring(21, 32).trim()),
- Integer.parseInt(str.substring(32, 43).trim()),
- str.substring(43).trim(),
+ Integer.parseInt(str.substring( 0, 5).trim()),
+ Integer.parseInt(str.substring( 6, 11).trim()),
+ Integer.parseInt(str.substring(25, 37).trim())/2,
+ Integer.parseInt(str.substring(12, 24).trim()),
+ Integer.parseInt(str.substring(25, 37).trim()),
+ str.substring(38).trim(),
false);
partition_map.add(partition);
diff --git a/tools/control/src/org/xenoserver/control/Settings.java b/tools/control/src/org/xenoserver/control/Settings.java
index 317bdb1c77..6f8d97c99f 100644
--- a/tools/control/src/org/xenoserver/control/Settings.java
+++ b/tools/control/src/org/xenoserver/control/Settings.java
@@ -21,7 +21,7 @@ public final class Settings {
System.getProperty("XI_HELPER", "xi_helper");
/** File to parse to get partition info. */
public static final String PARTITIONS_FILE =
- System.getProperty("PARTITIONS_FILE", "/proc/partitions");
+ System.getProperty("PARTITIONS_FILE", "/proc/xeno/blkdev_info");
/** File to load virtual disk state from. */
public static final String STATE_INPUT_FILE =
System.getProperty("STATE_INPUT_FILE", "/var/lib/xen/vdstate.xml");
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c
index e1a6d30374..b54b8ff1b4 100644
--- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c
+++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c
@@ -11,7 +11,7 @@
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
-#include <linux/proc_fs.h>
+#include <asm/xeno_proc.h>
#include <linux/mm.h>
#include <linux/mman.h>
@@ -38,9 +38,6 @@ typedef struct user_balloon_op {
/* Dead entry written into ballon-owned entries in the PMT. */
#define DEAD 0xdeadbeef
-#define BALLOON_ENTRY "balloon"
-extern struct proc_dir_entry *xeno_base;
-
static struct proc_dir_entry *balloon_pde;
unsigned long credit;
@@ -260,7 +257,7 @@ static int __init init_module(void)
credit = 0;
- balloon_pde = create_proc_entry(BALLOON_ENTRY, 0600, xeno_base);
+ balloon_pde = create_xeno_proc_entry("balloon", 0600);
if ( balloon_pde == NULL )
{
printk(KERN_ALERT "Unable to create balloon driver proc entry!");
@@ -274,6 +271,11 @@ static int __init init_module(void)
static void __exit cleanup_module(void)
{
+ if ( balloon_pde != NULL )
+ {
+ remove_xeno_proc_entry("balloon");
+ balloon_pde = NULL;
+ }
}
module_init(init_module);
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile
index 6423104172..22c471282b 100644
--- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile
+++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile
@@ -1,3 +1,3 @@
O_TARGET := blk.o
-obj-y := xl_block.o xl_ide.o xl_scsi.o xl_segment.o xl_segment_proc.o
+obj-y := xl_block.o xl_ide.o xl_scsi.o xl_segment.o xl_segment_proc.o info.o
include $(TOPDIR)/Rules.make
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
new file mode 100644
index 0000000000..e9bf618a62
--- /dev/null
+++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
@@ -0,0 +1,111 @@
+
+#include "xl_block.h"
+#include <linux/blk.h>
+#include <linux/cdrom.h>
+#include <linux/genhd.h>
+#include <linux/seq_file.h>
+#include <asm/xeno_proc.h>
+
+static struct proc_dir_entry *info_pde;
+
+static void *info_start(struct seq_file *s, loff_t *ppos)
+{
+ struct gendisk *gp;
+ loff_t pos = *ppos;
+ int major;
+
+ if ( pos == 0 )
+ seq_puts(s, "major minor start_sector num_sectors name\n\n");
+
+ for ( major = 0; major < MAX_BLKDEV; major++ )
+ {
+ if ( (gp = get_gendisk(MKDEV(major, 0))) != 0 )
+ if ( !pos-- )
+ return gp;
+ }
+
+ return NULL;
+}
+
+static void *info_next(struct seq_file *s, void *v, loff_t *ppos)
+{
+ ++*ppos;
+ return info_start(s, ppos);
+}
+
+static void info_stop(struct seq_file *s, void *v)
+{
+}
+
+static int info_show(struct seq_file *s, void *v)
+{
+ struct gendisk *gp = v;
+ char buf[64];
+ int n, disk;
+
+ for ( n = 0; n < (gp->nr_real << gp->minor_shift); n++ )
+ {
+ disk = n >> gp->minor_shift;
+ if ( gp->part[n].nr_sects != 0 )
+ {
+ seq_printf(s, "%5d %5d %12ld %12ld %s\n",
+ gp->major, n,
+ gp->part[n].start_sect,
+ gp->part[n].nr_sects,
+ disk_name(gp, n, buf));
+ }
+ else if ( ((disk << gp->minor_shift) == n) &&
+ ((((xl_disk_t *)gp->real_devices)[disk].capacity) != 0) )
+ {
+ seq_printf(s, "%5d %5d %12d %12ld %s\n",
+ gp->major, n, 0,
+ ((xl_disk_t *)gp->real_devices)[disk].capacity,
+ disk_name(gp, n, buf));
+ }
+ }
+
+ return 0;
+}
+
+static struct seq_operations info_op = {
+ .start = info_start,
+ .next = info_next,
+ .stop = info_stop,
+ .show = info_show,
+};
+
+static int info_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &info_op);
+}
+
+static struct file_operations proc_info_operations =
+{
+ open: info_open,
+ read: seq_read,
+ llseek: seq_lseek,
+ release: seq_release,
+};
+
+int __init info_init(void)
+{
+ info_pde = create_xeno_proc_entry("blkdev_info", 0444);
+ if ( info_pde == NULL )
+ panic ("Couldn't create /proc/xeno/blkdev_info");
+
+ info_pde->data = NULL;
+ info_pde->proc_fops = &proc_info_operations;
+ info_pde->owner = THIS_MODULE;
+
+ return 0;
+}
+
+static void __exit info_exit(void)
+{
+ if ( info_pde == NULL ) return;
+ remove_xeno_proc_entry("blkdev_info");
+ info_pde = NULL;
+}
+
+module_init(info_init);
+module_exit(info_exit);
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c
index 464707362a..f121860a90 100644
--- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c
+++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_segment_proc.c
@@ -5,7 +5,7 @@
*/
#include "xl_block.h"
-#include <linux/proc_fs.h>
+#include <asm/xeno_proc.h>
#include <linux/delay.h>
#include <linux/seq_file.h>
#include <asm/hypervisor-ifs/segment.h>
@@ -133,6 +133,9 @@ static int proc_write_vhd(struct file *file, const char *buffer,
xv_disk_t xvd;
int res;
+ if( !(start_info.flags & SIF_PRIVILEGED) )
+ return -EPERM;
+
if (!local)
return -ENOMEM;
@@ -310,7 +313,7 @@ int __init xlseg_proc_init(void)
if ( !(start_info.flags & SIF_PRIVILEGED) )
return 0;
- vhd = create_proc_entry("xeno/vhd", 0600, NULL);
+ vhd = create_xeno_proc_entry("vhd", 0600);
if ( vhd == NULL )
panic ("xlseg_init: unable to create vhd proc entry\n");
@@ -318,13 +321,14 @@ int __init xlseg_proc_init(void)
vhd->proc_fops = &proc_vhd_operations;
vhd->owner = THIS_MODULE;
- printk(KERN_ALERT "XenoLinux Virtual Disk Device Monitor installed\n");
return 0;
}
static void __exit xlseg_proc_cleanup(void)
{
- printk(KERN_ALERT "XenoLinux Virtual Disk Device Monitor uninstalled\n");
+ if ( vhd == NULL ) return;
+ remove_xeno_proc_entry("vhd");
+ vhd = NULL;
}
#ifdef MODULE
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c
index 20db18af74..3f0bbd6102 100644
--- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c
+++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/dom0_core.c
@@ -13,7 +13,6 @@
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/errno.h>
-#include <linux/proc_fs.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/swap.h>
@@ -30,10 +29,10 @@
#include <asm/tlb.h>
#include <asm/proc_cmd.h>
#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xeno_proc.h>
#include "../block/xl_block.h"
-struct proc_dir_entry *xeno_base;
static struct proc_dir_entry *privcmd_intf;
@@ -133,11 +132,8 @@ static int __init init_module(void)
if ( !(start_info.flags & SIF_PRIVILEGED) )
return 0;
- /* xeno proc root setup */
- xeno_base = proc_mkdir("xeno", &proc_root);
-
/* xeno control interface */
- privcmd_intf = create_proc_entry("privcmd", 0400, xeno_base);
+ privcmd_intf = create_xeno_proc_entry("privcmd", 0400);
if ( privcmd_intf != NULL )
{
privcmd_intf->owner = THIS_MODULE;
@@ -152,7 +148,7 @@ static int __init init_module(void)
static void __exit cleanup_module(void)
{
if ( privcmd_intf == NULL ) return;
- remove_proc_entry("xeno", &proc_root);
+ remove_xeno_proc_entry("privcmd");
privcmd_intf = NULL;
}
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c
index 8c9f6530e7..f3725db6c1 100644
--- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c
+++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/dom0/vfr.c
@@ -12,16 +12,13 @@
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/errno.h>
-#include <linux/proc_fs.h>
-
+#include <asm/xeno_proc.h>
#include <asm/hypervisor-ifs/network.h>
static struct proc_dir_entry *proc_vfr;
static unsigned char readbuf[1024];
-extern struct proc_dir_entry *xeno_base;
-
/* Helpers, implemented at the bottom. */
u32 getipaddr(const char *buff, unsigned int len);
u16 antous(const char *buff, int len);
@@ -225,8 +222,11 @@ static int vfr_write_proc(struct file *file, const char *buffer,
static int __init init_module(void)
{
+ if ( !(start_info.flags & SIF_PRIVILEGED) )
+ return 0;
+
*readbuf = '\0';
- proc_vfr = create_proc_entry ("vfr", 0600, xeno_base);
+ proc_vfr = create_xeno_proc_entry("vfr", 0600);
if ( proc_vfr != NULL )
{
proc_vfr->owner = THIS_MODULE;
@@ -241,7 +241,7 @@ static int __init init_module(void)
static void __exit cleanup_module(void)
{
if ( proc_vfr == NULL ) return;
- remove_proc_entry("vfr", xeno_base);
+ remove_xeno_proc_entry("vfr");
proc_vfr = NULL;
}
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c b/xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c
index b62c171b3c..ba492ed80d 100644
--- a/xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c
+++ b/xenolinux-2.4.22-sparse/arch/xeno/kernel/i386_ksyms.c
@@ -152,3 +152,8 @@ EXPORT_SYMBOL(atomic_dec_and_lock);
#ifdef CONFIG_MULTIQUAD
EXPORT_SYMBOL(xquad_portio);
#endif
+
+#include <asm/xeno_proc.h>
+EXPORT_SYMBOL(create_xeno_proc_entry);
+EXPORT_SYMBOL(remove_xeno_proc_entry);
+
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile b/xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile
index 2224f0312c..3bbf40148e 100644
--- a/xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile
+++ b/xenolinux-2.4.22-sparse/arch/xeno/lib/Makefile
@@ -6,7 +6,7 @@ L_TARGET = lib.a
obj-y = checksum.o old-checksum.o delay.o \
usercopy.o getuser.o \
- memcpy.o strstr.o
+ memcpy.o strstr.o xeno_proc.o
obj-$(CONFIG_X86_USE_3DNOW) += mmx.o
obj-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c b/xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c
new file mode 100644
index 0000000000..40b0d6086f
--- /dev/null
+++ b/xenolinux-2.4.22-sparse/arch/xeno/lib/xeno_proc.c
@@ -0,0 +1,18 @@
+
+#include <linux/config.h>
+#include <linux/proc_fs.h>
+
+static struct proc_dir_entry *xeno_base;
+
+struct proc_dir_entry *create_xeno_proc_entry(const char *name, mode_t mode)
+{
+ if ( xeno_base == NULL )
+ if ( (xeno_base = proc_mkdir("xeno", &proc_root)) == NULL )
+ panic("Couldn't create /proc/xeno");
+ return create_proc_entry(name, mode, xeno_base);
+}
+
+void remove_xeno_proc_entry(const char *name)
+{
+ remove_proc_entry(name, xeno_base);
+}
diff --git a/xenolinux-2.4.22-sparse/drivers/block/genhd.c b/xenolinux-2.4.22-sparse/drivers/block/genhd.c
deleted file mode 100644
index 403d52e0a1..0000000000
--- a/xenolinux-2.4.22-sparse/drivers/block/genhd.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Code extracted from
- * linux/kernel/hd.c
- *
- * Copyright (C) 1991-1998 Linus Torvalds
- *
- * devfs support - jj, rgooch, 980122
- *
- * Moved partition checking code to fs/partitions* - Russell King
- * (linux@arm.uk.linux.org)
- */
-
-/*
- * TODO: rip out the remaining init crap from this file --hch
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/genhd.h>
-#include <linux/kernel.h>
-#include <linux/blk.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <linux/seq_file.h>
-
-
-/*
- * Global kernel list of partitioning information.
- *
- * XXX: you should _never_ access this directly.
- * the only reason this is exported is source compatiblity.
- */
-/*static*/ struct gendisk *gendisk_head;
-static struct gendisk *gendisk_array[MAX_BLKDEV];
-static rwlock_t gendisk_lock = RW_LOCK_UNLOCKED;
-
-EXPORT_SYMBOL(gendisk_head);
-
-
-/**
- * add_gendisk - add partitioning information to kernel list
- * @gp: per-device partitioning information
- *
- * This function registers the partitioning information in @gp
- * with the kernel.
- */
-void
-add_gendisk(struct gendisk *gp)
-{
- struct gendisk *sgp;
-
- write_lock(&gendisk_lock);
-
- /*
- * In 2.5 this will go away. Fix the drivers who rely on
- * old behaviour.
- */
-
- for (sgp = gendisk_head; sgp; sgp = sgp->next)
- {
- if (sgp == gp)
- {
-// printk(KERN_ERR "add_gendisk: device major %d is buggy and added a live gendisk!\n",
-// sgp->major)
- goto out;
- }
- }
- gendisk_array[gp->major] = gp;
- gp->next = gendisk_head;
- gendisk_head = gp;
-out:
- write_unlock(&gendisk_lock);
-}
-
-EXPORT_SYMBOL(add_gendisk);
-
-
-/**
- * del_gendisk - remove partitioning information from kernel list
- * @gp: per-device partitioning information
- *
- * This function unregisters the partitioning information in @gp
- * with the kernel.
- */
-void
-del_gendisk(struct gendisk *gp)
-{
- struct gendisk **gpp;
-
- write_lock(&gendisk_lock);
- gendisk_array[gp->major] = NULL;
- for (gpp = &gendisk_head; *gpp; gpp = &((*gpp)->next))
- if (*gpp == gp)
- break;
- if (*gpp)
- *gpp = (*gpp)->next;
- write_unlock(&gendisk_lock);
-}
-
-EXPORT_SYMBOL(del_gendisk);
-
-
-/**
- * get_gendisk - get partitioning information for a given device
- * @dev: device to get partitioning information for
- *
- * This function gets the structure containing partitioning
- * information for the given device @dev.
- */
-struct gendisk *
-get_gendisk(kdev_t dev)
-{
- struct gendisk *gp = NULL;
- int maj = MAJOR(dev);
-
- read_lock(&gendisk_lock);
- if ((gp = gendisk_array[maj]))
- goto out;
-
- /* This is needed for early 2.4 source compatiblity. --hch */
- for (gp = gendisk_head; gp; gp = gp->next)
- if (gp->major == maj)
- break;
-out:
- read_unlock(&gendisk_lock);
- return gp;
-}
-
-EXPORT_SYMBOL(get_gendisk);
-
-
-/**
- * walk_gendisk - issue a command for every registered gendisk
- * @walk: user-specified callback
- * @data: opaque data for the callback
- *
- * This function walks through the gendisk chain and calls back
- * into @walk for every element.
- */
-int
-walk_gendisk(int (*walk)(struct gendisk *, void *), void *data)
-{
- struct gendisk *gp;
- int error = 0;
-
- read_lock(&gendisk_lock);
- for (gp = gendisk_head; gp; gp = gp->next)
- if ((error = walk(gp, data)))
- break;
- read_unlock(&gendisk_lock);
-
- return error;
-}
-
-#ifdef CONFIG_PROC_FS
-/* iterator */
-static void *part_start(struct seq_file *s, loff_t *ppos)
-{
- struct gendisk *gp;
- loff_t pos = *ppos;
-
- read_lock(&gendisk_lock);
- for (gp = gendisk_head; gp; gp = gp->next)
- if (!pos--)
- return gp;
- return NULL;
-}
-
-static void *part_next(struct seq_file *s, void *v, loff_t *pos)
-{
- ++*pos;
- return ((struct gendisk *)v)->next;
-}
-
-static void part_stop(struct seq_file *s, void *v)
-{
- read_unlock(&gendisk_lock);
-}
-
-static int part_show(struct seq_file *s, void *v)
-{
- struct gendisk *gp = v;
- char buf[64];
- int n;
-
- if (gp == gendisk_head) {
- seq_puts(s, "major minor #blocks start_sect nr_sects name"
-#ifdef CONFIG_BLK_STATS
- " rio rmerge rsect ruse wio wmerge "
- "wsect wuse running use aveq"
-#endif
- "\n\n");
- }
-
- /* show the full disk and all non-0 size partitions of it */
- for (n = 0; n < (gp->nr_real << gp->minor_shift); n++) {
- if (gp->part[n].nr_sects) {
-#ifdef CONFIG_BLK_STATS
- struct hd_struct *hd = &gp->part[n];
-
- disk_round_stats(hd);
- seq_printf(s, "%4d %4d %10d %10ld %s "
- "%d %d %d %d %d %d %d %d %d %d %d\n",
- gp->major, n, gp->sizes[n],
- gp->part[n].start_sect,
- gp->part[n].nr_sects,
- disk_name(gp, n, buf),
- hd->rd_ios, hd->rd_merges,
-#define MSEC(x) ((x) * 1000 / HZ)
- hd->rd_sectors, MSEC(hd->rd_ticks),
- hd->wr_ios, hd->wr_merges,
- hd->wr_sectors, MSEC(hd->wr_ticks),
- hd->ios_in_flight, MSEC(hd->io_ticks),
- MSEC(hd->aveq));
-#else
- seq_printf(s, "%4d %4d %10d %10ld %10ld %s\n",
- gp->major, n, gp->sizes[n],
- gp->part[n].start_sect,
- gp->part[n].nr_sects,
- disk_name(gp, n, buf));
-#endif /* CONFIG_BLK_STATS */
- }
- }
-
- return 0;
-}
-
-struct seq_operations partitions_op = {
- .start = part_start,
- .next = part_next,
- .stop = part_stop,
- .show = part_show,
-};
-#endif
-
-extern int blk_dev_init(void);
-extern int net_dev_init(void);
-extern void console_map_init(void);
-extern int atmdev_init(void);
-
-int __init device_init(void)
-{
- blk_dev_init();
- sti();
-#ifdef CONFIG_NET
- net_dev_init();
-#endif
-#ifdef CONFIG_ATM
- (void) atmdev_init();
-#endif
-#ifdef CONFIG_VT
- console_map_init();
-#endif
- return 0;
-}
-
-__initcall(device_init);
diff --git a/xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c b/xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c
index 17bc32bfb1..34cda43545 100644
--- a/xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c
+++ b/xenolinux-2.4.22-sparse/drivers/block/ll_rw_blk.c
@@ -859,8 +859,6 @@ static inline void add_request(request_queue_t * q, struct request * req,
if (!q->plugged && q->head_active && insert_here == &q->queue_head) {
spin_unlock_irq(&io_request_lock);
- printk("list_empty(&q->queue_head) is %d\n",
- list_empty(&q->queue_head));
BUG();
}
diff --git a/xenolinux-2.4.22-sparse/drivers/char/tty_io.c b/xenolinux-2.4.22-sparse/drivers/char/tty_io.c
index 741fa85b26..60d122e353 100644
--- a/xenolinux-2.4.22-sparse/drivers/char/tty_io.c
+++ b/xenolinux-2.4.22-sparse/drivers/char/tty_io.c
@@ -842,9 +842,8 @@ static int init_dev(kdev_t device, struct tty_struct **ret_tty)
int idx;
driver = get_tty_driver(device);
- if (!driver) {
- return -ENODEV;
- }
+ if (!driver)
+ return -ENODEV;
idx = MINOR(device) - driver->minor_start;
@@ -2219,7 +2218,7 @@ int tty_unregister_driver(struct tty_driver *driver)
*/
void __init console_init(void)
{
- /* Setup the default TTY line discipline. */
+ /* Setup the default TTY line discipline. */
memset(ldiscs, 0, sizeof(ldiscs));
(void) tty_register_ldisc(N_TTY, &tty_ldisc_N_TTY);
@@ -2250,7 +2249,6 @@ void __init console_init(void)
#ifdef CONFIG_VT
con_init();
#endif
-
#ifdef CONFIG_AU1X00_SERIAL_CONSOLE
au1x00_serial_console_init();
#endif
diff --git a/xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h b/xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h
new file mode 100644
index 0000000000..d794b733f5
--- /dev/null
+++ b/xenolinux-2.4.22-sparse/include/asm-xeno/xeno_proc.h
@@ -0,0 +1,13 @@
+
+#ifndef __ASM_XENO_PROC_H__
+#define __ASM_XENO_PROC_H__
+
+#include <linux/config.h>
+#include <linux/proc_fs.h>
+
+extern struct proc_dir_entry *create_xeno_proc_entry(
+ const char *name, mode_t mode);
+extern void remove_xeno_proc_entry(
+ const char *name);
+
+#endif /* __ASM_XENO_PROC_H__ */