linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.1-rc1-tiny1 tree for small systems
@ 2004-01-03  3:08 Matt Mackall
  2004-01-04  7:42 ` Eric W. Biederman
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2004-01-03  3:08 UTC (permalink / raw)
  To: linux-kernel

This is the third release of the -tiny kernel tree. The aim of this
tree is to collect patches that reduce kernel disk and memory
footprint as well as tools for working on small systems. Target users
are things like embedded systems, small or legacy desktop folks, and
handhelds.

Latest release includes:
 - sync against 2.6.1-rc1
 - latest netdrvr patchkit 
 - SLOB allocator
 - Andi Kleen's bloat-o-meter
 - configurable tcpdiag, inetpeer, dnotify, ptrace, sysenter/vsyscall
 - configurable X86 CPU feature detection
 - ability to override arch CFLAGS from Kconfig
 - optional uninlining of current and thread_info
 - other minor tweaks

The big bit here is SLOB, which optionally replaces the SLAB allocator
and kmalloc wrappers with a traditional malloc arena and a SLAB
emulation layer. SLOB is less than a tenth the size of the SLAB code
and is considerably more space efficient with its allocations, but is
not as fast and may prove less resistant to long-term fragmentation.

Thanks to Andi Kleen, Magnus Naeslund, and various others for their
contributions and suggestions.

The patch can be found at:

 http://selenic.com/tiny/2.6.1-rc1-tiny1.patch.bz2
 http://selenic.com/tiny/2.6.1-rc1-tiny1-broken-out.tar.bz2

Contributions and suggestions are encouraged. In particular, it would
be helpful if people with non-x86 hardware could take a stab at
extending some of the stuff that's currently only been done for X86 to
other architectures.


-- 
Matt Mackall : http://www.selenic.com : Linux development and consulting

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-03  3:08 2.6.1-rc1-tiny1 tree for small systems Matt Mackall
@ 2004-01-04  7:42 ` Eric W. Biederman
  2004-01-04  8:40   ` Matt Mackall
  0 siblings, 1 reply; 11+ messages in thread
From: Eric W. Biederman @ 2004-01-04  7:42 UTC (permalink / raw)
  To: Matt Mackall; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

Matt Mackall <mpm@selenic.com> writes:

> Contributions and suggestions are encouraged. In particular, it would
> be helpful if people with non-x86 hardware could take a stab at
> extending some of the stuff that's currently only been done for X86 to
> other architectures.

I just tried a kernel build with as much as possible turned off.  This
uncovered a couple of bugs, which I fixed with the attached diff.  But
it looks like there finally is a light at the end of the rainbow.

220K compressed and 371K uncompressed.  This is a serious reduction from
previous versions.  There is still a huge amount of code I can't compile
out but this is certainly progress.  Thank you.

Eric

$ size vmlinux 
   text	   data	    bss	    dec	    hex	filename
 371813	  29914	  24620	 426347	  6816b	vmlinux

$ ls -l arch/i386/boot/bzImage 
-rw-r--r--    1 eric     eric       220348 Jan  4 00:22 arch/i386/boot/bzImage


gcc-3.3 --version
gcc-3.3 (GCC) 3.3.2 20030908 (Debian prerelease)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


[-- Attachment #2: .config --]
[-- Type: text/plain, Size: 8454 bytes --]

#
# Automatically generated make config: don't edit
#
CONFIG_X86=y
CONFIG_MMU=y
CONFIG_UID16=y
CONFIG_GENERIC_ISA_DMA=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
CONFIG_BROKEN_ON_SMP=y

#
# General setup
#
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_SYSCTL is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_IKCONFIG is not set
CONFIG_EMBEDDED=y
CONFIG_CORE_SMALL=y
CONFIG_NET_SMALL=y
CONFIG_CONSOLE_SMALL=y
CONFIG_PROCESSOR_SELECT=y
# CONFIG_CPU_SUP_INTEL is not set
# CONFIG_CPU_SUP_CYRIX is not set
# CONFIG_CPU_SUP_NSC is not set
# CONFIG_CPU_SUP_AMD is not set
# CONFIG_CPU_SUP_CENTAUR is not set
# CONFIG_CPU_SUP_TRANSMETA is not set
# CONFIG_CPU_SUP_RISE is not set
# CONFIG_CPU_SUP_NEXGEN is not set
# CONFIG_CPU_SUP_UMC is not set
# CONFIG_KALLSYMS is not set
# CONFIG_FUTEX is not set
# CONFIG_EPOLL is not set
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_MEASURE_INLINES is not set
# CONFIG_IRQ_DEBUG is not set
# CONFIG_FULL_STACK is not set
# CONFIG_AUDIT_BOOTMEM is not set
# CONFIG_KMALLOC_ACCOUNTING is not set
CONFIG_HERTZ=1000
CONFIG_MAX_USER_RT_PRIO=5
# CONFIG_VM86 is not set
# CONFIG_AIO is not set
# CONFIG_DOUBLEFAULT is not set
# CONFIG_SYSFS is not set
# CONFIG_PRINTK is not set
# CONFIG_BUG is not set
CONFIG_PANIC=y
# CONFIG_FULL_PANIC is not set
# CONFIG_ELF_CORE is not set
# CONFIG_KCORE is not set
CONFIG_MAX_SWAPFILES_SHIFT=0
CONFIG_NR_LDISCS=0
# CONFIG_DMI_SCAN is not set
# CONFIG_CONSOLE_TRANSLATIONS is not set
# CONFIG_SLAB is not set
# CONFIG_TCP_DIAG is not set
# CONFIG_INETPEER is not set
# CONFIG_INLINE_THREADINFO is not set
# CONFIG_DNOTIFY is not set
# CONFIG_PTRACE is not set
# CONFIG_SYSENTER is not set
CONFIG_TINY_CFLAGS=y
CONFIG_TINY_CFLAGS_VAL="-march=i386"
CONFIG_SLOB=y

#
# Loadable module support
#
# CONFIG_MODULES is not set

#
# Processor type and features
#
CONFIG_X86_PC=y
# CONFIG_X86_VOYAGER is not set
# CONFIG_X86_NUMAQ is not set
# CONFIG_X86_SUMMIT is not set
# CONFIG_X86_BIGSMP is not set
# CONFIG_X86_VISWS is not set
# CONFIG_X86_GENERICARCH is not set
# CONFIG_X86_ES7000 is not set
# CONFIG_M386 is not set
CONFIG_M486=y
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MELAN is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP2 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_X86_GENERIC is not set
CONFIG_X86_CMPXCHG=y
CONFIG_X86_XADD=y
CONFIG_X86_L1_CACHE_SHIFT=4
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_X86_PPRO_FENCE=y
CONFIG_X86_F00F_BUG=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_X86_POPAD_OK=y
CONFIG_X86_ALIGNMENT_16=y
# CONFIG_HPET_TIMER is not set
# CONFIG_HPET_EMULATE_RTC is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
# CONFIG_X86_UP_APIC is not set
# CONFIG_X86_MCE is not set
# CONFIG_TOSHIBA is not set
# CONFIG_I8K is not set
# CONFIG_MICROCODE is not set
# CONFIG_X86_MSR is not set
# CONFIG_X86_CPUID is not set
# CONFIG_EDD is not set
CONFIG_NOHIGHMEM=y
# CONFIG_HIGHMEM4G is not set
# CONFIG_HIGHMEM64G is not set
# CONFIG_MATH_EMULATION is not set
# CONFIG_MTRR is not set

#
# Power management options (ACPI, APM)
#
# CONFIG_PM is not set

#
# ACPI (Advanced Configuration and Power Interface) Support
#
# CONFIG_ACPI is not set

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set

#
# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
#
# CONFIG_PCI is not set
# CONFIG_ISA is not set
# CONFIG_MCA is not set
# CONFIG_SCx200 is not set
# CONFIG_HOTPLUG is not set

#
# Executable file formats
#
# CONFIG_BINFMT_ELF is not set
# CONFIG_BINFMT_AOUT is not set
# CONFIG_BINFMT_MISC is not set

#
# Device Drivers
#

#
# Generic Driver Options
#

#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set

#
# Parallel port support
#
# CONFIG_PARPORT is not set

#
# Plug and Play support
#
# CONFIG_PNP is not set

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_LBD is not set

#
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set

#
# SCSI device support
#
# CONFIG_SCSI is not set

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Fusion MPT device support
#

#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
#
# CONFIG_IEEE1394 is not set

#
# I2O device support
#

#
# Networking support
#
# CONFIG_NET is not set

#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
# CONFIG_KGDBOE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NETPOLL_RX is not set
# CONFIG_NETPOLL_TRAP is not set
# CONFIG_NET_POLL_CONTROLLER is not set

#
# ISDN subsystem
#

#
# Telephony Support
#
# CONFIG_PHONE is not set

#
# Input device support
#
# CONFIG_INPUT is not set

#
# Userland interfaces
#

#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
# CONFIG_SERIO is not set
# CONFIG_SERIO_I8042 is not set

#
# Input Device Drivers
#

#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set

#
# Non-8250 serial port support
#
# CONFIG_UNIX98_PTYS is not set

#
# I2C support
#
# CONFIG_I2C is not set

#
# I2C Algorithms
#

#
# I2C Hardware Bus support
#

#
# I2C Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set

#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_MWAVE is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_HANGCHECK_TIMER is not set

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set

#
# Digital Video Broadcasting Devices
#

#
# Graphics support
#
# CONFIG_FB is not set

#
# Sound
#
# CONFIG_SOUND is not set

#
# USB support
#
# CONFIG_USB_GADGET is not set

#
# File systems
#
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_JBD is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_FAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
# CONFIG_PROC_FS is not set
# CONFIG_DEVFS_FS is not set
# CONFIG_TMPFS is not set
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
# CONFIG_MSDOS_PARTITION is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_NEC98_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
# CONFIG_EFI_PARTITION is not set

#
# Native Language Support
#
# CONFIG_NLS is not set

#
# Profiling support
#
# CONFIG_PROFILING is not set

#
# Kernel hacking
#
# CONFIG_DEBUG_KERNEL is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_FRAME_POINTER is not set

#
# Security options
#
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

#
# Library routines
#
# CONFIG_CRC32 is not set
CONFIG_X86_BIOS_REBOOT=y

[-- Attachment #3: linux-2.6.1-rc1-tiny1.eb1.diff --]
[-- Type: text/plain, Size: 3259 bytes --]

diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/arch/i386/kernel/cpu/common.c linux-2.6.1-rc1-tiny1.eb1/arch/i386/kernel/cpu/common.c
--- linux-2.6.1-rc1-tiny1/arch/i386/kernel/cpu/common.c	Sun Jan  4 00:03:51 2004
+++ linux-2.6.1-rc1-tiny1.eb1/arch/i386/kernel/cpu/common.c	Sun Jan  4 00:21:05 2004
@@ -421,7 +421,6 @@
  * They will insert themselves into the cpu_devs structure.
  * Then, when cpu_init() is called, we can just iterate over that array.
  */
-
 extern int intel_cpu_init(void);
 extern int cyrix_init_cpu(void);
 extern int nsc_init_cpu(void);
@@ -431,6 +430,34 @@
 extern int rise_init_cpu(void);
 extern int nexgen_init_cpu(void);
 extern int umc_init_cpu(void);
+
+#ifndef CONFIG_CPU_SUP_INTEL
+#define intel_cpu_init() 
+#endif
+#ifndef CONFIG_CPU_SUP_CYRIX
+#define cyrix_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_NSC
+#define nsc_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_AMD
+#define amd_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_CENTAUR
+#define centaur_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_TRANSMETA
+#define transmeta_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_RISE
+#define rise_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_NEXGEN
+#define nexgen_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_UMC
+#define umc_init_cpu() 
+#endif
 
 void __init early_cpu_init(void)
 {
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/arch/i386/mm/init.c linux-2.6.1-rc1-tiny1.eb1/arch/i386/mm/init.c
--- linux-2.6.1-rc1-tiny1/arch/i386/mm/init.c	Sun Jan  4 00:03:51 2004
+++ linux-2.6.1-rc1-tiny1.eb1/arch/i386/mm/init.c	Sun Jan  4 00:22:36 2004
@@ -444,9 +444,14 @@
 static struct kcore_list kcore_mem, kcore_vmalloc; 
 #endif
 
+#ifdef CNFIG_CPU_SUP_INTEL
+extern int ppro_with_ram_bug(void);
+#else
+static inline int ppro_with_ram_bug(void) { return 0; }
+#endif
+
 void __init mem_init(void)
 {
-	extern int ppro_with_ram_bug(void);
 	int codesize, reservedpages, datasize, initsize;
 	int tmp;
 	int bad_ppro;
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/kernel/Makefile linux-2.6.1-rc1-tiny1.eb1/kernel/Makefile
--- linux-2.6.1-rc1-tiny1/kernel/Makefile	Wed Dec 17 19:58:18 2003
+++ linux-2.6.1-rc1-tiny1.eb1/kernel/Makefile	Sun Jan  4 00:02:11 2004
@@ -4,10 +4,11 @@
 
 obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
 	    exit.o itimer.o time.o softirq.o resource.o \
-	    sysctl.o capability.o ptrace.o timer.o user.o \
+	    sysctl.o capability.o timer.o user.o \
 	    signal.o sys.o kmod.o workqueue.o pid.o \
 	    rcupdate.o intermodule.o extable.o params.o posix-timers.o
 
+obj-$(CONFIG_PTRACE) += ptrace.o
 obj-$(CONFIG_FUTEX) += futex.o
 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
 obj-$(CONFIG_SMP) += cpu.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/kernel/printk.c linux-2.6.1-rc1-tiny1.eb1/kernel/printk.c
--- linux-2.6.1-rc1-tiny1/kernel/printk.c	Sun Jan  4 00:03:57 2004
+++ linux-2.6.1-rc1-tiny1.eb1/kernel/printk.c	Sat Jan  3 23:59:30 2004
@@ -101,10 +101,10 @@
 static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
 static int preferred_console = -1;
 
-#ifdef CONFIG_PRINTK
-
 /* Flag: console code may call schedule() */
 static int console_may_schedule;
+
+#ifdef CONFIG_PRINTK
 
 /*
  *	Setup a list of consoles. Called from init/main.c

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-04  7:42 ` Eric W. Biederman
@ 2004-01-04  8:40   ` Matt Mackall
  2004-01-04 16:02     ` Eric W. Biederman
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Matt Mackall @ 2004-01-04  8:40 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-kernel

On Sun, Jan 04, 2004 at 12:42:43AM -0700, Eric W. Biederman wrote:
> Matt Mackall <mpm@selenic.com> writes:
> 
> > Contributions and suggestions are encouraged. In particular, it would
> > be helpful if people with non-x86 hardware could take a stab at
> > extending some of the stuff that's currently only been done for X86 to
> > other architectures.
> 
> I just tried a kernel build with as much as possible turned off.  This
> uncovered a couple of bugs, which I fixed with the attached diff.  But
> it looks like there finally is a light at the end of the rainbow.

Thanks. I actually cleaned up all this stuff earlier today, will
probably do another release shortly.
 
> 220K compressed and 371K uncompressed.  This is a serious reduction from
> previous versions.  There is still a huge amount of code I can't compile
> out but this is certainly progress.  Thank you.

Suggestions? I'm rapidly exhausting a lot of the obvious candidates.
My target build at the moment is ide + ext2 + proc + ipv4 + console, and
that's currently at around 800K uncompressed, booting in a little less
than 2.5MB. Hoping to get that under 2.

-- 
Matt Mackall : http://www.selenic.com : Linux development and consulting

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-04  8:40   ` Matt Mackall
@ 2004-01-04 16:02     ` Eric W. Biederman
  2004-01-05  0:00     ` Eric W. Biederman
  2004-01-08 21:04     ` bill davidsen
  2 siblings, 0 replies; 11+ messages in thread
From: Eric W. Biederman @ 2004-01-04 16:02 UTC (permalink / raw)
  To: Matt Mackall; +Cc: linux-kernel

Matt Mackall <mpm@selenic.com> writes:

> On Sun, Jan 04, 2004 at 12:42:43AM -0700, Eric W. Biederman wrote:
> > Matt Mackall <mpm@selenic.com> writes:
> > 
> > > Contributions and suggestions are encouraged. In particular, it would
> > > be helpful if people with non-x86 hardware could take a stab at
> > > extending some of the stuff that's currently only been done for X86 to
> > > other architectures.
> > 
> > I just tried a kernel build with as much as possible turned off.  This
> > uncovered a couple of bugs, which I fixed with the attached diff.  But
> > it looks like there finally is a light at the end of the rainbow.
> 
> Thanks. I actually cleaned up all this stuff earlier today, will
> probably do another release shortly.
>  
> > 220K compressed and 371K uncompressed.  This is a serious reduction from
> > previous versions.  There is still a huge amount of code I can't compile
> > out but this is certainly progress.  Thank you.
> 
> Suggestions? I'm rapidly exhausting a lot of the obvious candidates.
> My target build at the moment is ide + ext2 + proc + ipv4 + console, and
> that's currently at around 800K uncompressed, booting in a little less
> than 2.5MB. Hoping to get that under 2.

Nice.  I have a 386 I really should try this out on.

Of note IPv4 is about 90K compressed.  And I know you can do a minimal
IPv4 stack in about 8K compressed.

My target is a minimal kernel that can be used as a bootloader.  But
what I am looking for at first is to be able to turn as many things
off as possible so that we can test to see how much individual pieces
add.

If you look at ELKS or one of the old unix like kernels you can get
those down to 64K and still be usable.

I'm currently looking at removing the buffer cache, since I most
of the time I don't care about disks.  This is complicated by the fact
that many of the default paths in the kernel when they don't have a
better implementation use buffer cache methods.  But I'm making
headway.

Proc is one of things that frequently has loads of crap that are
not needed in a minimal setup.

Until I find more candidates to turn off I can't see any low hanging
fruit for shrinking in size.

Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-04  8:40   ` Matt Mackall
  2004-01-04 16:02     ` Eric W. Biederman
@ 2004-01-05  0:00     ` Eric W. Biederman
  2004-01-05  0:34       ` viro
       [not found]       ` <20040105170938.GY18208@waste.org>
  2004-01-08 21:04     ` bill davidsen
  2 siblings, 2 replies; 11+ messages in thread
From: Eric W. Biederman @ 2004-01-05  0:00 UTC (permalink / raw)
  To: Matt Mackall; +Cc: linux-kernel

Matt Mackall <mpm@selenic.com> writes:

> On Sun, Jan 04, 2004 at 12:42:43AM -0700, Eric W. Biederman wrote:
> > Matt Mackall <mpm@selenic.com> writes:
> > 220K compressed and 371K uncompressed.  This is a serious reduction from
> > previous versions.  There is still a huge amount of code I can't compile
> > out but this is certainly progress.  Thank you.
> 
> Suggestions? I'm rapidly exhausting a lot of the obvious candidates.
> My target build at the moment is ide + ext2 + proc + ipv4 + console, and
> that's currently at around 800K uncompressed, booting in a little less
> than 2.5MB. Hoping to get that under 2.

On the side of useless ugly.  But interesting in what I had to touch
the following patch is a first crude stab at removing block device
support from the kernel.

With nothing selected this gets me down to a 191K bzImage and a 323K
text segment.  So for those who are not using it this is a significant
drop.

I have a fairly static target of kernel and user space in 384K so I
can fit it in a standard BIOS ROM chip.  192K would be even better,
but I have other solutions I can use in that case if I need to.

Eric

$ ls -l arch/i386/boot/bzImage 
-rw-r--r--    2 eric     eric       191316 Jan  4 15:38 arch/i386/boot/bzImage

$ size vmlinux
   text	   data	    bss	    dec	    hex	filename
 323359	  28652	  24252	 376263	  5bdc7	vmlinux

diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/arch/i386/mm/init.c linux-2.6.1-rc1-tiny1.eb2/arch/i386/mm/init.c
--- linux-2.6.1-rc1-tiny1.eb1/arch/i386/mm/init.c	Sun Jan  4 00:22:36 2004
+++ linux-2.6.1-rc1-tiny1.eb2/arch/i386/mm/init.c	Sun Jan  4 13:35:36 2004
@@ -444,7 +444,7 @@
 static struct kcore_list kcore_mem, kcore_vmalloc; 
 #endif
 
-#ifdef CNFIG_CPU_SUP_INTEL
+#ifdef CONFIG_CPU_SUP_INTEL
 extern int ppro_with_ram_bug(void);
 #else
 static inline int ppro_with_ram_bug(void) { return 0; }
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/drivers/block/Kconfig linux-2.6.1-rc1-tiny1.eb2/drivers/block/Kconfig
--- linux-2.6.1-rc1-tiny1.eb1/drivers/block/Kconfig	Wed Dec 17 19:58:28 2003
+++ linux-2.6.1-rc1-tiny1.eb2/drivers/block/Kconfig	Sun Jan  4 03:09:30 2004
@@ -6,7 +6,7 @@
 
 config BLK_DEV_FD
 	tristate "Normal floppy disk support"
-	depends on !X86_PC9800 && !ARCH_S390
+	depends on BLOCK_DEVICES && !X86_PC9800 && !ARCH_S390
 	---help---
 	  If you want to use the floppy disk drive(s) of your PC under Linux,
 	  say Y. Information about this driver, especially important for IBM
@@ -20,29 +20,29 @@
 
 config AMIGA_FLOPPY
 	tristate "Amiga floppy support"
-	depends on AMIGA
+	depends on BLOCK_DEVICES && AMIGA
 
 config ATARI_FLOPPY
 	tristate "Atari floppy support"
-	depends on ATARI
+	depends on BLOCK_DEVICES && ATARI
 
 config BLK_DEV_FD98
 	tristate "NEC PC-9800 floppy disk support"
-	depends on X86_PC9800
+	depends on BLOCK_DEVICES && X86_PC9800
 	---help---
 	  If you want to use the floppy disk drive(s) of NEC PC-9801/PC-9821,
 	  say Y.
 
 config BLK_DEV_SWIM_IOP
 	bool "Macintosh IIfx/Quadra 900/Quadra 950 floppy support (EXPERIMENTAL)"
-	depends on MAC && EXPERIMENTAL && BROKEN
+	depends on BLOCK_DEVICES && MAC && EXPERIMENTAL && BROKEN
 	help
 	  Say Y here to support the SWIM (Super Woz Integrated Machine) IOP
 	  floppy controller on the Macintosh IIfx and Quadra 900/950.
 
 config BLK_DEV_PS2
 	tristate "PS/2 ESDI hard disk support"
-	depends on MCA && MCA_LEGACY
+	depends on BLOCK_DEVICES && MCA && MCA_LEGACY
 	help
 	  Say Y here if you have a PS/2 machine with a MCA bus and an ESDI
 	  hard disk.
@@ -52,7 +52,7 @@
 
 config AMIGA_Z2RAM
 	tristate "Amiga Zorro II ramdisk support"
-	depends on ZORRO
+	depends on BLOCK_DEVICES && ZORRO
 	help
 	  This enables support for using Chip RAM and Zorro II RAM as a
 	  ramdisk or as a swap partition. Say Y if you want to include this
@@ -63,7 +63,7 @@
 
 config ATARI_ACSI
 	tristate "Atari ACSI support"
-	depends on ATARI && BROKEN
+	depends on BLOCK_DEVICES && ATARI && BROKEN
 	---help---
 	  This enables support for the Atari ACSI interface. The driver
 	  supports hard disks and CD-ROMs, which have 512-byte sectors, or can
@@ -79,11 +79,11 @@
 	  module will be called acsi.
 
 comment "Some devices (e.g. CD jukebox) support multiple LUNs"
-	depends on ATARI && ATARI_ACSI
+	depends on BLOCK_DEVICES && ATARI && ATARI_ACSI
 
 config ACSI_MULTI_LUN
 	bool "Probe all LUNs on each ACSI device"
-	depends on ATARI_ACSI
+	depends on BLOCK_DEVICES && ATARI_ACSI
 	help
 	  If you have a ACSI device that supports more than one LUN (Logical
 	  Unit Number), e.g. a CD jukebox, you should say Y here so that all
@@ -94,7 +94,7 @@
 
 config ATARI_SLM
 	tristate "Atari SLM laser printer support"
-	depends on ATARI && ATARI_ACSI!=n
+	depends on BLOCK_DEVICES && ATARI && ATARI_ACSI!=n
 	help
 	  If you have an Atari SLM laser printer, say Y to include support for
 	  it in the kernel. Otherwise, say N. This driver is also available as
@@ -105,7 +105,7 @@
 
 config BLK_DEV_XD
 	tristate "XT hard disk support"
-	depends on ISA
+	depends on BLOCK_DEVICES && ISA
 	help
 	  Very old 8 bit hard disk controllers used in the IBM XT computer
 	  will be supported if you say Y here.
@@ -117,7 +117,7 @@
 
 config PARIDE
 	tristate "Parallel port IDE device support"
-	depends on PARPORT
+	depends on BLOCK_DEVIVES && PARPORT
 	---help---
 	  There are many external CD-ROM and disk devices that connect through
 	  your computer's parallel port. Most of them are actually IDE devices
@@ -146,7 +146,7 @@
 
 config BLK_CPQ_DA
 	tristate "Compaq SMART2 support"
-	depends on PCI
+	depends on BLOCK_DEVICES && PCI
 	help
 	  This is the driver for Compaq Smart Array controllers.  Everyone
 	  using these boards should say Y here.  See the file
@@ -156,7 +156,7 @@
 
 config BLK_CPQ_CISS_DA
 	tristate "Compaq Smart Array 5xxx support"
-	depends on PCI
+	depends on BLOCK_DEVICES && PCI
 	help
 	  This is the driver for Compaq Smart Array 5xxx controllers.
 	  Everyone using these boards should say Y here.
@@ -166,7 +166,7 @@
 
 config CISS_SCSI_TAPE
 	bool "SCSI tape drive support for Smart Array 5xxx"
-	depends on BLK_CPQ_CISS_DA && SCSI
+	depends on BLOCK_DEVICES && BLK_CPQ_CISS_DA && SCSI
 	help
 	  When enabled (Y), this option allows SCSI tape drives and SCSI medium
 	  changers (tape robots) to be accessed via a Compaq 5xxx array 
@@ -180,7 +180,7 @@
 
 config BLK_DEV_DAC960
 	tristate "Mylex DAC960/DAC1100 PCI RAID Controller support"
-	depends on PCI
+	depends on BLOCK_DEVICES && PCI
 	help
 	  This driver adds support for the Mylex DAC960, AcceleRAID, and
 	  eXtremeRAID PCI RAID controllers.  See the file
@@ -192,7 +192,7 @@
 
 config BLK_DEV_UMEM
 	tristate "Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)"
-	depends on PCI && EXPERIMENTAL
+	depends on BLOCK_DEVICES && PCI && EXPERIMENTAL
 	---help---
 	  Saying Y here will include support for the MM5415 family of
 	  battery backed (Non-volatile) RAM cards.
@@ -251,7 +251,7 @@
 config BLK_DEV_CRYPTOLOOP
 	tristate "Cryptoloop Support"
 	select CRYPTO
-	depends on BLK_DEV_LOOP
+	depends on BLOCK_DEVICES && BLK_DEV_LOOP
 	---help---
 	  Say Y here if you want to be able to use the ciphers that are 
 	  provided by the CryptoAPI as loop transformation. This might be
@@ -259,7 +259,7 @@
 
 config BLK_DEV_NBD
 	tristate "Network block device support"
-	depends on NET
+	depends on BLOCK_DEVICES && NET
 	---help---
 	  Saying Y here will allow your computer to be a client for network
 	  block devices, i.e. it will be able to use block devices exported by
@@ -305,7 +305,7 @@
 
 config BLK_DEV_RAM_SIZE
 	int "Default RAM disk size"
-	depends on BLK_DEV_RAM
+	depends on BLOCK_DEVICES && BLK_DEV_RAM
 	default "4096"
 	help
 	  The default value is 4096. Only change this if you know what are
@@ -322,7 +322,7 @@
 
 config LBD
 	bool "Support for Large Block Devices"
-	depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH
+	depends on BLOCK_DEVICES && ( X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH )
 	help
 	  Say Y here if you want to attach large (bigger than 2TB) discs to
 	  your machine, or if you want to have a raid or loopback device
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/drivers/block/Kconfig.embedded linux-2.6.1-rc1-tiny1.eb2/drivers/block/Kconfig.embedded
--- linux-2.6.1-rc1-tiny1.eb1/drivers/block/Kconfig.embedded	Wed Dec 31 17:00:00 1969
+++ linux-2.6.1-rc1-tiny1.eb2/drivers/block/Kconfig.embedded	Sun Jan  4 03:09:51 2004
@@ -0,0 +1,5 @@
+config BLOCK_DEVICES
+	bool "Block device support" if EMBEDDED
+	default y
+	help
+	  Allow the complete removal of block device code
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/drivers/block/Kconfig.iosched linux-2.6.1-rc1-tiny1.eb2/drivers/block/Kconfig.iosched
--- linux-2.6.1-rc1-tiny1.eb1/drivers/block/Kconfig.iosched	Wed Dec 17 19:58:07 2003
+++ linux-2.6.1-rc1-tiny1.eb2/drivers/block/Kconfig.iosched	Sun Jan  4 15:34:04 2004
@@ -1,5 +1,6 @@
 config IOSCHED_NOOP
 	bool "No-op I/O scheduler" if EMBEDDED
+	depends on BLOCK_DEVICES
 	default y
 	---help---
 	  The no-op I/O scheduler is a minimal scheduler that does basic merging
@@ -10,6 +11,7 @@
 
 config IOSCHED_AS
 	bool "Anticipatory I/O scheduler" if EMBEDDED
+	depends on BLOCK_DEVICES
 	default y
 	---help---
 	  The anticipatory I/O scheduler is the default disk scheduler. It is
@@ -19,6 +21,7 @@
 
 config IOSCHED_DEADLINE
 	bool "Deadline I/O scheduler" if EMBEDDED
+	depends on BLOCK_DEVICES
 	default y
 	---help---
 	  The deadline I/O scheduler is simple and compact, and is often as
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/drivers/block/Makefile linux-2.6.1-rc1-tiny1.eb2/drivers/block/Makefile
--- linux-2.6.1-rc1-tiny1.eb1/drivers/block/Makefile	Wed Dec 17 19:59:19 2003
+++ linux-2.6.1-rc1-tiny1.eb2/drivers/block/Makefile	Sun Jan  4 03:10:27 2004
@@ -13,7 +13,7 @@
 # kblockd threads
 #
 
-obj-y	:= elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
+obj-$(CONFIG_BLOCK_DEVICES)	:= elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
 
 obj-$(CONFIG_IOSCHED_NOOP)	+= noop-iosched.o
 obj-$(CONFIG_IOSCHED_AS)	+= as-iosched.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/drivers/md/Kconfig linux-2.6.1-rc1-tiny1.eb2/drivers/md/Kconfig
--- linux-2.6.1-rc1-tiny1.eb1/drivers/md/Kconfig	Sat Jan  3 22:09:07 2004
+++ linux-2.6.1-rc1-tiny1.eb2/drivers/md/Kconfig	Sun Jan  4 03:13:26 2004
@@ -6,6 +6,7 @@
 
 config MD
 	bool "Multiple devices driver support (RAID and LVM)"
+	depends on BLOCK_DEVICES
 	help
 	  Support multiple physical spindles through a single logical device.
 	  Required for RAID and logical volume management.
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/Kconfig.embedded linux-2.6.1-rc1-tiny1.eb2/fs/Kconfig.embedded
--- linux-2.6.1-rc1-tiny1.eb1/fs/Kconfig.embedded	Wed Dec 31 17:00:00 1969
+++ linux-2.6.1-rc1-tiny1.eb2/fs/Kconfig.embedded	Sun Jan  4 03:44:16 2004
@@ -0,0 +1,11 @@
+config BINFMT_SCRIPT
+	bool "Kernel support for shell scripts" if EMBEDDED
+	default y
+	help
+	  Allow the removal of the code for executing shell scripts
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/Makefile linux-2.6.1-rc1-tiny1.eb2/fs/Makefile
--- linux-2.6.1-rc1-tiny1.eb1/fs/Makefile	Sat Jan  3 22:10:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/fs/Makefile	Sun Jan  4 03:44:53 2004
@@ -5,12 +5,14 @@
 # Rewritten to use lists instead of if-statements.
 # 
 
-obj-y :=	open.o read_write.o file_table.o buffer.o \
-		bio.o super.o block_dev.o char_dev.o stat.o exec.o pipe.o \
+obj-y :=	open.o read_write.o file_table.o \
+		super.o char_dev.o stat.o exec.o pipe.o \
 		namei.o fcntl.o ioctl.o readdir.o select.o fifo.o locks.o \
 		dcache.o inode.o attr.o bad_inode.o file.o \
 		filesystems.o namespace.o seq_file.o xattr.o libfs.o \
-		fs-writeback.o mpage.o direct-io.o aio.o
+		fs-writeback.o aio.o
+
+obj-$(CONFIG_BLOCK_DEVICES) += buffer.o bio.o block_dev.o mpage.o direct-io.o
 
 obj-$(CONFIG_DNOTIFY)		+= dnotify.o
 obj-$(CONFIG_EPOLL)		+= eventpoll.o
@@ -24,7 +26,7 @@
 obj-$(CONFIG_BINFMT_MISC)	+= binfmt_misc.o
 
 # binfmt_script is always there
-obj-y				+= binfmt_script.o
+obj-$(CONFIG_BINFMT_SCRIPT)	+= binfmt_script.o
 
 obj-$(CONFIG_BINFMT_ELF)	+= binfmt_elf.o
 obj-$(CONFIG_BINFMT_SOM)	+= binfmt_som.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/buffer.c linux-2.6.1-rc1-tiny1.eb2/fs/buffer.c
--- linux-2.6.1-rc1-tiny1.eb1/fs/buffer.c	Sat Jan  3 22:10:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/fs/buffer.c	Sun Jan  4 14:37:38 2004
@@ -225,27 +225,6 @@
 
 /*
  * Write out and wait upon all dirty data associated with this
- * superblock.  Filesystem data as well as the underlying block
- * device.  Takes the superblock lock.
- */
-int fsync_super(struct super_block *sb)
-{
-	sync_inodes_sb(sb, 0);
-	DQUOT_SYNC(sb);
-	lock_super(sb);
-	if (sb->s_dirt && sb->s_op->write_super)
-		sb->s_op->write_super(sb);
-	unlock_super(sb);
-	if (sb->s_op->sync_fs)
-		sb->s_op->sync_fs(sb, 1);
-	sync_blockdev(sb->s_bdev);
-	sync_inodes_sb(sb, 1);
-
-	return sync_blockdev(sb->s_bdev);
-}
-
-/*
- * Write out and wait upon all dirty data associated with this
  * device.   Filesystem data as well as the underlying block
  * device.  Takes the superblock lock.
  */
@@ -1559,35 +1538,6 @@
 	clear_buffer_new(bh);
 	clear_buffer_delay(bh);
 	unlock_buffer(bh);
-}
-
-/**
- * try_to_release_page() - release old fs-specific metadata on a page
- *
- * @page: the page which the kernel is trying to free
- * @gfp_mask: memory allocation flags (and I/O mode)
- *
- * The address_space is to try to release any data against the page
- * (presumably at page->private).  If the release was successful, return `1'.
- * Otherwise return zero.
- *
- * The @gfp_mask argument specifies whether I/O may be performed to release
- * this page (__GFP_IO), and whether the call may block (__GFP_WAIT).
- *
- * NOTE: @gfp_mask may go away, and this function may become non-blocking.
- */
-int try_to_release_page(struct page *page, int gfp_mask)
-{
-	struct address_space * const mapping = page->mapping;
-
-	if (!PageLocked(page))
-		BUG();
-	if (PageWriteback(page))
-		return 0;
-	
-	if (mapping && mapping->a_ops->releasepage)
-		return mapping->a_ops->releasepage(page, gfp_mask);
-	return try_to_free_buffers(page);
 }
 
 /**
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/dcache.c linux-2.6.1-rc1-tiny1.eb2/fs/dcache.c
--- linux-2.6.1-rc1-tiny1.eb1/fs/dcache.c	Sat Jan  3 22:09:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/fs/dcache.c	Sun Jan  4 03:24:20 2004
@@ -1619,7 +1619,9 @@
 	inode_init(mempages);
 	files_init(mempages); 
 	mnt_init(mempages);
+#ifdef CONFIG_BLOCK_DEVICES
 	bdev_cache_init();
+#endif
 	chrdev_init();
 }
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/fs-writeback.c linux-2.6.1-rc1-tiny1.eb2/fs/fs-writeback.c
--- linux-2.6.1-rc1-tiny1.eb1/fs/fs-writeback.c	Wed Dec 17 20:00:00 2003
+++ linux-2.6.1-rc1-tiny1.eb2/fs/fs-writeback.c	Sun Jan  4 15:25:49 2004
@@ -22,8 +22,11 @@
 #include <linux/blkdev.h>
 #include <linux/backing-dev.h>
 #include <linux/buffer_head.h>
+#include <linux/quotaops.h>
 
+#ifdef CONFIG_BLOCK_DEVICES
 extern struct super_block *blockdev_superblock;
+#endif
 
 /**
  *	__mark_inode_dirty -	internal function
@@ -263,6 +266,7 @@
 		struct backing_dev_info *bdi = mapping->backing_dev_info;
 
 		if (bdi->memory_backed) {
+#ifdef CONFIG_BLOCK_DEVICES
 			if (sb == blockdev_superblock) {
 				/*
 				 * Dirty memory-backed blockdev: the ramdisk
@@ -271,6 +275,7 @@
 				list_move(&inode->i_list, &sb->s_dirty);
 				continue;
 			}
+#endif
 			/*
 			 * Assume that all inodes on this superblock are memory
 			 * backed.  Skip the superblock.
@@ -280,15 +285,19 @@
 
 		if (wbc->nonblocking && bdi_write_congested(bdi)) {
 			wbc->encountered_congestion = 1;
+#ifdef CONFIG_BLOCK_DEVICES
 			if (sb != blockdev_superblock)
 				break;		/* Skip a congested fs */
+#endif
 			list_move(&inode->i_list, &sb->s_dirty);
 			continue;		/* Skip a congested blockdev */
 		}
 
 		if (wbc->bdi && bdi != wbc->bdi) {
+#ifdef CONFIG_BLOCK_DEVICES
 			if (sb != blockdev_superblock)
 				break;		/* fs has the wrong queue */
+#endif
 			list_move(&inode->i_list, &sb->s_dirty);
 			continue;		/* blockdev has wrong queue */
 		}
@@ -523,11 +532,13 @@
 	current->flags |= PF_SYNCWRITE;
 	if (what & OSYNC_DATA)
 		err = filemap_fdatawrite(inode->i_mapping);
+#ifdef CONFIG_BLOCK_DEVICES
 	if (what & (OSYNC_METADATA|OSYNC_DATA)) {
 		err2 = sync_mapping_buffers(inode->i_mapping);
 		if (!err)
 			err = err2;
 	}
+#endif
 	if (what & OSYNC_DATA) {
 		err2 = filemap_fdatawait(inode->i_mapping);
 		if (!err)
@@ -586,4 +597,32 @@
 {
 	BUG_ON(!writeback_in_progress(bdi));
 	clear_bit(BDI_pdflush, &bdi->state);
+}
+
+
+/*
+ * Write out and wait upon all dirty data associated with this
+ * superblock.  Filesystem data as well as the underlying block
+ * device.  Takes the superblock lock.
+ */
+int fsync_super(struct super_block *sb)
+{
+	sync_inodes_sb(sb, 0);
+	DQUOT_SYNC(sb);
+	lock_super(sb);
+	if (sb->s_dirt && sb->s_op->write_super)
+		sb->s_op->write_super(sb);
+	unlock_super(sb);
+	if (sb->s_op->sync_fs)
+		sb->s_op->sync_fs(sb, 1);
+#ifdef CONFIG_BLOCK_DEVICES
+	sync_blockdev(sb->s_bdev);
+#endif
+	sync_inodes_sb(sb, 1);
+
+#ifdef CONFIG_BLOCK_DEVICES
+	return sync_blockdev(sb->s_bdev);
+#else
+	return 0;
+#endif
 }
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/inode.c linux-2.6.1-rc1-tiny1.eb2/fs/inode.c
--- linux-2.6.1-rc1-tiny1.eb1/fs/inode.c	Wed Dec 17 19:59:55 2003
+++ linux-2.6.1-rc1-tiny1.eb2/fs/inode.c	Sun Jan  4 15:35:18 2004
@@ -233,7 +233,9 @@
  */
 void clear_inode(struct inode *inode)
 {
+#ifdef CONFIG_BLOCK_DEVICES
 	invalidate_inode_buffers(inode);
+#endif
        
 	if (inode->i_data.nrpages)
 		BUG();
@@ -245,8 +247,10 @@
 	DQUOT_DROP(inode);
 	if (inode->i_sb && inode->i_sb->s_op->clear_inode)
 		inode->i_sb->s_op->clear_inode(inode);
+#if CONFIG_BLOCK_DEVICES
 	if (inode->i_bdev)
 		bd_forget(inode);
+#endif
 	if (inode->i_cdev)
 		cd_forget(inode);
 	inode->i_state = I_CLEAR;
@@ -301,7 +305,9 @@
 		inode = list_entry(tmp, struct inode, i_list);
 		if (inode->i_sb != sb)
 			continue;
+#ifdef CONFIG_BLOCK_DEVICES
 		invalidate_inode_buffers(inode);
+#endif
 		if (!atomic_read(&inode->i_count)) {
 			hlist_del_init(&inode->i_hash);
 			list_del(&inode->i_list);
@@ -353,7 +359,8 @@
 }
 
 EXPORT_SYMBOL(invalidate_inodes);
- 
+
+#ifdef CONFIG_BLOCK_DEVICES 
 int __invalidate_device(struct block_device *bdev, int do_sync)
 {
 	struct super_block *sb;
@@ -380,6 +387,7 @@
 }
 
 EXPORT_SYMBOL(__invalidate_device);
+#endif
 
 static int can_unuse(struct inode *inode)
 {
@@ -431,8 +439,10 @@
 		if (inode_has_buffers(inode) || inode->i_data.nrpages) {
 			__iget(inode);
 			spin_unlock(&inode_lock);
+#ifdef CONFIG_BLOCK_DEVICES
 			if (remove_inode_buffers(inode))
 				reap += invalidate_inode_pages(&inode->i_data);
+#endif
 			iput(inode);
 			spin_lock(&inode_lock);
 
@@ -1391,9 +1401,11 @@
 	if (S_ISCHR(mode)) {
 		inode->i_fop = &def_chr_fops;
 		inode->i_rdev = rdev;
+#ifdef CONFIG_BLOCK_DEVICES
 	} else if (S_ISBLK(mode)) {
 		inode->i_fop = &def_blk_fops;
 		inode->i_rdev = rdev;
+#endif
 	} else if (S_ISFIFO(mode))
 		inode->i_fop = &def_fifo_fops;
 	else if (S_ISSOCK(mode))
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/partitions/Makefile linux-2.6.1-rc1-tiny1.eb2/fs/partitions/Makefile
--- linux-2.6.1-rc1-tiny1.eb1/fs/partitions/Makefile	Wed Dec 17 19:58:47 2003
+++ linux-2.6.1-rc1-tiny1.eb2/fs/partitions/Makefile	Sun Jan  4 03:29:11 2004
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-obj-y := check.o
+obj-$(CONFIG_BLOCK_DEVICES) := check.o
 
 obj-$(CONFIG_DEVFS_FS) += devfs.o
 obj-$(CONFIG_ACORN_PARTITION) += acorn.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/fs/super.c linux-2.6.1-rc1-tiny1.eb2/fs/super.c
--- linux-2.6.1-rc1-tiny1.eb1/fs/super.c	Wed Dec 17 19:58:48 2003
+++ linux-2.6.1-rc1-tiny1.eb2/fs/super.c	Sun Jan  4 15:18:28 2004
@@ -473,8 +473,10 @@
 {
 	int retval;
 	
+#ifdef CONFIG_BLOCK_DEVICES
 	if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev))
 		return -EACCES;
+#endif
 	if (flags & MS_RDONLY)
 		acct_auto_close(sb);
 	shrink_dcache_sb(sb);
@@ -588,6 +590,7 @@
 	return (void *)s->s_bdev == data;
 }
 
+#ifdef CONFIG_BLOCK_DEVICES
 struct super_block *get_sb_bdev(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *data,
 	int (*fill_super)(struct super_block *, void *, int))
@@ -645,6 +648,7 @@
 }
 
 EXPORT_SYMBOL(kill_block_super);
+#endif
 
 struct super_block *get_sb_nodev(struct file_system_type *fs_type,
 	int flags, void *data,
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/include/linux/blkdev.h linux-2.6.1-rc1-tiny1.eb2/include/linux/blkdev.h
--- linux-2.6.1-rc1-tiny1.eb1/include/linux/blkdev.h	Wed Dec 17 19:58:28 2003
+++ linux-2.6.1-rc1-tiny1.eb2/include/linux/blkdev.h	Sun Jan  4 03:32:28 2004
@@ -577,7 +577,11 @@
 extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *);
 extern void blk_dump_rq_flags(struct request *, char *);
 extern void generic_unplug_device(void *);
+#ifdef CONFIG_BLOCK_DEVICES
 extern long nr_blockdev_pages(void);
+#else
+static inline long nr_blockdev_pages(void) { return 0; }
+#endif
 
 int blk_get_queue(request_queue_t *);
 request_queue_t *blk_alloc_queue(int);
@@ -596,7 +600,12 @@
 extern void blk_queue_free_tags(request_queue_t *);
 extern int blk_queue_resize_tags(request_queue_t *, int);
 extern void blk_queue_invalidate_tags(request_queue_t *);
+
+#if defined(CONFIG_BLOCK_DEVICES)
 extern void blk_congestion_wait(int rw, long timeout);
+#else
+static inline void blk_congestion_wait(int rw, long timeout) {} 
+#endif
 
 extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
 extern void blk_rq_prep_restart(struct request *);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/include/linux/buffer_head.h linux-2.6.1-rc1-tiny1.eb2/include/linux/buffer_head.h
--- linux-2.6.1-rc1-tiny1.eb1/include/linux/buffer_head.h	Wed Dec 17 19:58:04 2003
+++ linux-2.6.1-rc1-tiny1.eb2/include/linux/buffer_head.h	Sun Jan  4 15:23:47 2004
@@ -150,7 +150,11 @@
 void buffer_insert_list(spinlock_t *lock,
 			struct buffer_head *, struct list_head *);
 void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
+#ifdef CONFIG_BLOCK_DEVICES
 int inode_has_buffers(struct inode *);
+#else
+static inline int inode_has_buffers(struct inode *inode) { return 0; }
+#endif
 void invalidate_inode_buffers(struct inode *);
 int remove_inode_buffers(struct inode *inode);
 int fsync_buffers_list(spinlock_t *lock, struct list_head *);
@@ -160,7 +164,11 @@
 void mark_buffer_async_read(struct buffer_head *bh);
 void mark_buffer_async_write(struct buffer_head *bh);
 void invalidate_bdev(struct block_device *, int);
+#if CONFIG_BLOCK_DEVICES
 int sync_blockdev(struct block_device *bdev);
+#else
+static inline int sync_blockdev(struct block_device *bdev) { return 0; }
+#endif
 void __wait_on_buffer(struct buffer_head *);
 wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
 void wake_up_buffer(struct buffer_head *bh);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/include/linux/fs.h linux-2.6.1-rc1-tiny1.eb2/include/linux/fs.h
--- linux-2.6.1-rc1-tiny1.eb1/include/linux/fs.h	Sat Jan  3 22:10:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/include/linux/fs.h	Sun Jan  4 03:52:15 2004
@@ -1145,7 +1145,11 @@
 extern int blkdev_put(struct block_device *, int);
 extern int bd_claim(struct block_device *, void *);
 extern void bd_release(struct block_device *);
+#ifdef CONFIG_BLOCK_DEVICE
 extern void blk_run_queues(void);
+#else
+static inline void blk_run_queues(void) {};
+#endif
 
 /* fs/char_dev.c */
 extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, char *);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/include/linux/mm.h linux-2.6.1-rc1-tiny1.eb2/include/linux/mm.h
--- linux-2.6.1-rc1-tiny1.eb1/include/linux/mm.h	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.eb2/include/linux/mm.h	Sun Jan  4 03:57:55 2004
@@ -486,7 +486,11 @@
 		if (spd)
 			return (*spd)(page);
 	}
+#if CONFIG_BLOCK_DEVICES
 	return __set_page_dirty_buffers(page);
+#else
+	return 0;
+#endif
 }
 
 /*
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/include/linux/mpage.h linux-2.6.1-rc1-tiny1.eb2/include/linux/mpage.h
--- linux-2.6.1-rc1-tiny1.eb1/include/linux/mpage.h	Wed Dec 17 19:58:47 2003
+++ linux-2.6.1-rc1-tiny1.eb2/include/linux/mpage.h	Sun Jan  4 03:33:28 2004
@@ -10,6 +10,7 @@
  * nested includes.  Get it right in the .c file).
  */
 
+#ifdef CONFIG_BLOCK_DEVICES
 struct writeback_control;
 
 int mpage_readpages(struct address_space *mapping, struct list_head *pages,
@@ -23,3 +24,12 @@
 {
 	return mpage_writepages(mapping, wbc, NULL);
 }
+#else
+
+static inline int
+generic_writepages(struct address_space *mapping, struct writeback_control *wbc)
+{
+	return 0;
+}
+
+#endif
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/init/Kconfig linux-2.6.1-rc1-tiny1.eb2/init/Kconfig
--- linux-2.6.1-rc1-tiny1.eb1/init/Kconfig	Sat Jan  3 22:10:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/init/Kconfig	Sun Jan  4 03:35:04 2004
@@ -277,6 +277,8 @@
 	  support for epoll family of system calls.
 
 source "drivers/block/Kconfig.iosched"
+source "fs/Kconfig.embedded"
+source "drivers/block/Kconfig.embedded"
 
 config CC_OPTIMIZE_FOR_SIZE
 	bool "Optimize for size" if EMBEDDED
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/init/do_mounts.c linux-2.6.1-rc1-tiny1.eb2/init/do_mounts.c
--- linux-2.6.1-rc1-tiny1.eb1/init/do_mounts.c	Sat Jan  3 22:10:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/init/do_mounts.c	Sun Jan  4 03:36:41 2004
@@ -267,6 +267,7 @@
 	return 0;
 }
 
+#if CONFIG_BLOCK_DEVICES
 void __init mount_block_root(char *name, int flags)
 {
 	char *fs_names = __getname();
@@ -301,6 +302,7 @@
 out:
 	putname(fs_names);
 }
+#endif
  
 #ifdef CONFIG_ROOT_NFS
 static int __init mount_nfs_root(void)
@@ -368,8 +370,10 @@
 			change_floppy("root floppy");
 	}
 #endif
+#if CONFIG_BLOCK_DEVICES
 	create_dev("/dev/root", ROOT_DEV, root_device_name);
 	mount_block_root("/dev/root", root_mountflags);
+#endif
 }
 
 /*
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/init/main.c linux-2.6.1-rc1-tiny1.eb2/init/main.c
--- linux-2.6.1-rc1-tiny1.eb1/init/main.c	Sat Jan  3 22:10:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/init/main.c	Sun Jan  4 03:37:07 2004
@@ -447,7 +447,9 @@
 #endif
 	fork_init(num_physpages);
 	proc_caches_init();
+#if CONFIG_BLOCK_DEVICES
 	buffer_init();
+#endif
 	security_scaffolding_startup();
 	vfs_caches_init(max(1000, (int)num_physpages-16000));
 	radix_tree_init();
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/kernel/exit.c linux-2.6.1-rc1-tiny1.eb2/kernel/exit.c
--- linux-2.6.1-rc1-tiny1.eb1/kernel/exit.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.eb2/kernel/exit.c	Sun Jan  4 15:38:02 2004
@@ -750,8 +750,10 @@
 		panic("Attempted to kill the idle task!");
 	if (unlikely(tsk->pid == 1))
 		panic("Attempted to kill init!");
+#ifdef CONFIG_BLOCK_DEVICES
 	if (tsk->io_context)
 		exit_io_context();
+#endif
 	tsk->flags |= PF_EXITING;
 	del_timer_sync(&tsk->real_timer);
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/kernel/sys.c linux-2.6.1-rc1-tiny1.eb2/kernel/sys.c
--- linux-2.6.1-rc1-tiny1.eb1/kernel/sys.c	Sat Jan  3 22:10:11 2004
+++ linux-2.6.1-rc1-tiny1.eb2/kernel/sys.c	Sun Jan  4 03:38:29 2004
@@ -251,6 +251,15 @@
 cond_syscall(sys_epoll_wait)
 cond_syscall(sys_pciconfig_read)
 cond_syscall(sys_pciconfig_write)
+cond_syscall(sys_io_setup)
+cond_syscall(sys_io_destroy)
+cond_syscall(sys_io_getevents)
+cond_syscall(sys_io_submit)
+cond_syscall(sys_io_cancel)
+cond_syscall(sys_bdflush)
+cond_syscall(sys_sync)
+cond_syscall(sys_fsync)
+cond_syscall(sys_fdatasync)
 
 static int set_one_prio(struct task_struct *p, int niceval, int error)
 {
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/mm/filemap.c linux-2.6.1-rc1-tiny1.eb2/mm/filemap.c
--- linux-2.6.1-rc1-tiny1.eb1/mm/filemap.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.eb2/mm/filemap.c	Sun Jan  4 03:41:15 2004
@@ -1640,6 +1640,11 @@
                 return err;
         }
 
+#if !defined(CONFIG_BLOCK_DEVICES)
+	if (unlikely(isblk)) {
+		return -EINVAL;
+	}
+#endif
 	if (!isblk) {
 		/* FIXME: this is for backwards compatibility with 2.4 */
 		if (file->f_flags & O_APPEND)
@@ -1688,7 +1693,9 @@
 
 		if (unlikely(*pos + *count > inode->i_sb->s_maxbytes))
 			*count = inode->i_sb->s_maxbytes - *pos;
-	} else {
+	} 
+#if defined(CONFIG_BLOCK_DEVICES)
+	else {
 		loff_t isize;
 		if (bdev_read_only(inode->i_bdev))
 			return -EPERM;
@@ -1701,6 +1708,7 @@
 		if (*pos + *count > isize)
 			*count = isize - *pos;
 	}
+#endif
 	return 0;
 }
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/mm/highmem.c linux-2.6.1-rc1-tiny1.eb2/mm/highmem.c
--- linux-2.6.1-rc1-tiny1.eb1/mm/highmem.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.eb2/mm/highmem.c	Sun Jan  4 03:42:22 2004
@@ -300,6 +300,7 @@
 	}
 }
 
+#ifdef CONFIG_BLOCK_DEVICES
 static void bounce_end_io(struct bio *bio, mempool_t *pool)
 {
 	struct bio *bio_orig = bio->bi_private;
@@ -479,6 +480,7 @@
 }
 
 EXPORT_SYMBOL(blk_queue_bounce);
+#endif /* CONFIG_BLOCK_DEVICES */
 
 #if defined(HASHED_PAGE_VIRTUAL)
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/mm/page-writeback.c linux-2.6.1-rc1-tiny1.eb2/mm/page-writeback.c
--- linux-2.6.1-rc1-tiny1.eb1/mm/page-writeback.c	Wed Dec 17 19:59:05 2003
+++ linux-2.6.1-rc1-tiny1.eb2/mm/page-writeback.c	Sun Jan  4 14:15:00 2004
@@ -567,3 +567,38 @@
 	return 0;
 }
 EXPORT_SYMBOL(test_clear_page_dirty);
+
+
+/**
+ * try_to_release_page() - release old fs-specific metadata on a page
+ *
+ * @page: the page which the kernel is trying to free
+ * @gfp_mask: memory allocation flags (and I/O mode)
+ *
+ * The address_space is to try to release any data against the page
+ * (presumably at page->private).  If the release was successful, return `1'.
+ * Otherwise return zero.
+ *
+ * The @gfp_mask argument specifies whether I/O may be performed to release
+ * this page (__GFP_IO), and whether the call may block (__GFP_WAIT).
+ *
+ * NOTE: @gfp_mask may go away, and this function may become non-blocking.
+ */
+int try_to_release_page(struct page *page, int gfp_mask)
+{
+	struct address_space * const mapping = page->mapping;
+
+	if (!PageLocked(page))
+		BUG();
+	if (PageWriteback(page))
+		return 0;
+	
+	if (mapping && mapping->a_ops->releasepage)
+		return mapping->a_ops->releasepage(page, gfp_mask);
+#if CONFIG_BLOCK_DEVICES
+	return try_to_free_buffers(page);
+#else
+	BUG();
+	return 0;
+#endif
+}
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/mm/swap.c linux-2.6.1-rc1-tiny1.eb2/mm/swap.c
--- linux-2.6.1-rc1-tiny1.eb1/mm/swap.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.eb2/mm/swap.c	Sun Jan  4 14:25:25 2004
@@ -317,6 +317,7 @@
 	pagevec_reinit(pvec);
 }
 
+#if CONFIG_BLOCK_DEVICES
 /*
  * Try to drop buffers from the pages in a pagevec
  */
@@ -333,6 +334,7 @@
 		}
 	}
 }
+#endif
 
 /**
  * pagevec_lookup - gang pagecache lookup
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/mm/truncate.c linux-2.6.1-rc1-tiny1.eb2/mm/truncate.c
--- linux-2.6.1-rc1-tiny1.eb1/mm/truncate.c	Wed Dec 17 19:59:42 2003
+++ linux-2.6.1-rc1-tiny1.eb2/mm/truncate.c	Sun Jan  4 14:27:10 2004
@@ -18,11 +18,18 @@
 
 static int do_invalidatepage(struct page *page, unsigned long offset)
 {
+	int ret;
 	int (*invalidatepage)(struct page *, unsigned long);
 	invalidatepage = page->mapping->a_ops->invalidatepage;
+#if CONFIG_BLOCK_DEVICE
 	if (invalidatepage == NULL)
 		invalidatepage = block_invalidatepage;
-	return (*invalidatepage)(page, offset);
+#endif
+	ret = 1;
+	if (invalidatepage) {
+		ret = (*invalidatepage)(page, offset);
+	}
+	return ret;
 }
 
 static inline void truncate_partial_page(struct page *page, unsigned partial)
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.eb1/mm/vmscan.c linux-2.6.1-rc1-tiny1.eb2/mm/vmscan.c
--- linux-2.6.1-rc1-tiny1.eb1/mm/vmscan.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.eb2/mm/vmscan.c	Sun Jan  4 03:43:24 2004
@@ -704,19 +704,23 @@
 			spin_unlock_irq(&zone->lru_lock);
 			pgdeactivate += pgmoved;
 			pgmoved = 0;
+#ifdef CONFIG_BLOCK_DEVICES
 			if (buffer_heads_over_limit)
 				pagevec_strip(&pvec);
+#endif
 			__pagevec_release(&pvec);
 			spin_lock_irq(&zone->lru_lock);
 		}
 	}
 	zone->nr_inactive += pgmoved;
 	pgdeactivate += pgmoved;
+#ifdef CONFIG_BLOCK_DEVICES
 	if (buffer_heads_over_limit) {
 		spin_unlock_irq(&zone->lru_lock);
 		pagevec_strip(&pvec);
 		spin_lock_irq(&zone->lru_lock);
 	}
+#endif
 
 	pgmoved = 0;
 	while (!list_empty(&l_active)) {


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-05  0:00     ` Eric W. Biederman
@ 2004-01-05  0:34       ` viro
  2004-01-05  4:34         ` Eric W. Biederman
       [not found]       ` <20040105170938.GY18208@waste.org>
  1 sibling, 1 reply; 11+ messages in thread
From: viro @ 2004-01-05  0:34 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Matt Mackall, linux-kernel

On Sun, Jan 04, 2004 at 05:00:49PM -0700, Eric W. Biederman wrote:

1) make block-based filesystems dependent on CONFIG_BLOCK

> --- linux-2.6.1-rc1-tiny1.eb1/fs/super.c	Wed Dec 17 19:58:48 2003
> +++ linux-2.6.1-rc1-tiny1.eb2/fs/super.c	Sun Jan  4 15:18:28 2004
> @@ -473,8 +473,10 @@
>  {
>  	int retval;
>  	
> +#ifdef CONFIG_BLOCK_DEVICES
>  	if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev))
>  		return -EACCES;
> +#endif
>  	if (flags & MS_RDONLY)
>  		acct_auto_close(sb);
>  	shrink_dcache_sb(sb);
> @@ -588,6 +590,7 @@
>  	return (void *)s->s_bdev == data;
>  }

Tons of stuff here make sense only for block-based filesystems (e.g. the
function immediately above ;-).  Ifdef, or, better yet, move to fs/block_dev.c

> +cond_syscall(sys_fsync)
> +cond_syscall(sys_fdatasync)

Huh?  They should work for network filesystems.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-05  0:34       ` viro
@ 2004-01-05  4:34         ` Eric W. Biederman
  0 siblings, 0 replies; 11+ messages in thread
From: Eric W. Biederman @ 2004-01-05  4:34 UTC (permalink / raw)
  To: viro; +Cc: Matt Mackall, linux-kernel


First thanks for the review.

viro@parcelfarce.linux.theplanet.co.uk writes:

> On Sun, Jan 04, 2004 at 05:00:49PM -0700, Eric W. Biederman wrote:
> 
> 1) make block-based filesystems dependent on CONFIG_BLOCK

Yep that sounds better and is easier to type.
 
> > --- linux-2.6.1-rc1-tiny1.eb1/fs/super.c	Wed Dec 17 19:58:48 2003
> > +++ linux-2.6.1-rc1-tiny1.eb2/fs/super.c	Sun Jan  4 15:18:28 2004
> > @@ -473,8 +473,10 @@
> >  {
> >  	int retval;
> >  	
> > +#ifdef CONFIG_BLOCK_DEVICES
> >  	if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev))
> >  		return -EACCES;
> > +#endif
> >  	if (flags & MS_RDONLY)
> >  		acct_auto_close(sb);
> >  	shrink_dcache_sb(sb);
> > @@ -588,6 +590,7 @@
> >  	return (void *)s->s_bdev == data;
> >  }
> 
> Tons of stuff here make sense only for block-based filesystems (e.g. the
> function immediately above ;-).  Ifdef, or, better yet, move to fs/block_dev.c

remounting only makes sense for block based filesystems?
That does not sound right.  

Definitely something to look into next time I get the chance.

> > +cond_syscall(sys_fsync)
> > +cond_syscall(sys_fdatasync)
> 
> Huh?  They should work for network filesystems.

Good catch.  I did say this was a first cut that was too ugly to use.
The problem is those functions need to move out of buffer.c

I have moved them into fs-writeback.c and things still appear to work.

My method of exacting the dependencies was to remove the obvious files
from the build and then to fixup whatever linker problems were left.

Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
       [not found]       ` <20040105170938.GY18208@waste.org>
@ 2004-01-08 19:22         ` Eric W. Biederman
  2004-01-09 20:15           ` Arnaldo Carvalho de Melo
  2004-01-10 21:49           ` Matt Mackall
  0 siblings, 2 replies; 11+ messages in thread
From: Eric W. Biederman @ 2004-01-08 19:22 UTC (permalink / raw)
  To: Matt Mackall; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]

Matt Mackall <mpm@selenic.com> writes:

> On Sun, Jan 04, 2004 at 05:00:49PM -0700, Eric W. Biederman wrote:
> > On the side of useless ugly.  But interesting in what I had to touch
> > the following patch is a first crude stab at removing block device
> > support from the kernel.
> 
> This looks good. If you can send me a version with
> /BLOCK_DEVICE/BLOCK/, etc., I'll put it in.

Ok.  I have just had a chance to clean some things up.  Attached
is my latest and hopefully clean set up diffs against 2.6.1-rc1-tiny1

I am bouncing this off of linux-kernel as well since I got such good
feedback last time.

- First the compile fixes, so I can compile test this code.
- Then the CONFIG_BLOCK patch.  
  * I have reviewed the code and it looks correct, beyond just the
    fact that the code compiles. 
  * I have added  a sync.c for the sync functions that used to live in
   buffer.c.
  * I have removed most instances of CONFIG_BLOCK from the mainline
    code to improve maintenance.  Now there are just a few ugly parts
    where the block layer is not cleanly separated from the rest of
    the code.
  * I have updated where I put the depends so fewer things need a CONFIG_BLOCK.
  * I have added  a CONFIG_BLOCK to all of the likely looking
    filesystems.
- Then a new patch that was sort of in my tree to make BINFMT_SCRIPT
  configurable.
- And another new patch to use cond_syscall instead of explicit
  dummies when we don't have the AIO code compiled in.

The last two patches really don't really appear to save anything but
they are clean, and you can't have too many CONFIG_EMBEDDED options :)

Eric


[-- Attachment #2: linux-2.6.1-rc1-tiny1.compile-fixes.diff --]
[-- Type: text/plain, Size: 3340 bytes --]

diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/arch/i386/kernel/cpu/common.c linux-2.6.1-rc1-tiny1.compile-fixes/arch/i386/kernel/cpu/common.c
--- linux-2.6.1-rc1-tiny1/arch/i386/kernel/cpu/common.c	Sun Jan  4 00:03:51 2004
+++ linux-2.6.1-rc1-tiny1.compile-fixes/arch/i386/kernel/cpu/common.c	Thu Jan  8 11:22:52 2004
@@ -421,7 +421,6 @@
  * They will insert themselves into the cpu_devs structure.
  * Then, when cpu_init() is called, we can just iterate over that array.
  */
-
 extern int intel_cpu_init(void);
 extern int cyrix_init_cpu(void);
 extern int nsc_init_cpu(void);
@@ -431,6 +430,34 @@
 extern int rise_init_cpu(void);
 extern int nexgen_init_cpu(void);
 extern int umc_init_cpu(void);
+
+#ifndef CONFIG_CPU_SUP_INTEL
+#define intel_cpu_init() 
+#endif
+#ifndef CONFIG_CPU_SUP_CYRIX
+#define cyrix_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_NSC
+#define nsc_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_AMD
+#define amd_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_CENTAUR
+#define centaur_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_TRANSMETA
+#define transmeta_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_RISE
+#define rise_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_NEXGEN
+#define nexgen_init_cpu() 
+#endif
+#ifndef CONFIG_CPU_SUP_UMC
+#define umc_init_cpu() 
+#endif
 
 void __init early_cpu_init(void)
 {
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/arch/i386/mm/init.c linux-2.6.1-rc1-tiny1.compile-fixes/arch/i386/mm/init.c
--- linux-2.6.1-rc1-tiny1/arch/i386/mm/init.c	Sun Jan  4 00:03:51 2004
+++ linux-2.6.1-rc1-tiny1.compile-fixes/arch/i386/mm/init.c	Thu Jan  8 11:23:49 2004
@@ -444,9 +444,14 @@
 static struct kcore_list kcore_mem, kcore_vmalloc; 
 #endif
 
+#ifdef CONFIG_CPU_SUP_INTEL
+extern int ppro_with_ram_bug(void);
+#else
+static inline int ppro_with_ram_bug(void) { return 0; }
+#endif
+
 void __init mem_init(void)
 {
-	extern int ppro_with_ram_bug(void);
 	int codesize, reservedpages, datasize, initsize;
 	int tmp;
 	int bad_ppro;
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/kernel/Makefile linux-2.6.1-rc1-tiny1.compile-fixes/kernel/Makefile
--- linux-2.6.1-rc1-tiny1/kernel/Makefile	Wed Dec 17 19:58:18 2003
+++ linux-2.6.1-rc1-tiny1.compile-fixes/kernel/Makefile	Thu Jan  8 11:22:52 2004
@@ -4,10 +4,11 @@
 
 obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
 	    exit.o itimer.o time.o softirq.o resource.o \
-	    sysctl.o capability.o ptrace.o timer.o user.o \
+	    sysctl.o capability.o timer.o user.o \
 	    signal.o sys.o kmod.o workqueue.o pid.o \
 	    rcupdate.o intermodule.o extable.o params.o posix-timers.o
 
+obj-$(CONFIG_PTRACE) += ptrace.o
 obj-$(CONFIG_FUTEX) += futex.o
 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
 obj-$(CONFIG_SMP) += cpu.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1/kernel/printk.c linux-2.6.1-rc1-tiny1.compile-fixes/kernel/printk.c
--- linux-2.6.1-rc1-tiny1/kernel/printk.c	Sun Jan  4 00:03:57 2004
+++ linux-2.6.1-rc1-tiny1.compile-fixes/kernel/printk.c	Thu Jan  8 11:22:52 2004
@@ -101,10 +101,10 @@
 static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
 static int preferred_console = -1;
 
-#ifdef CONFIG_PRINTK
-
 /* Flag: console code may call schedule() */
 static int console_may_schedule;
+
+#ifdef CONFIG_PRINTK
 
 /*
  *	Setup a list of consoles. Called from init/main.c

[-- Attachment #3: linux-2.6.1-rc1-tiny1.config-block.diff --]
[-- Type: text/plain, Size: 46216 bytes --]

diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Kconfig linux-2.6.1-rc1-tiny1.config-block/drivers/block/Kconfig
--- linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Kconfig	Wed Dec 17 19:58:28 2003
+++ linux-2.6.1-rc1-tiny1.config-block/drivers/block/Kconfig	Thu Jan  8 11:29:14 2004
@@ -3,6 +3,7 @@
 #
 
 menu "Block devices"
+	depends BLOCK
 
 config BLK_DEV_FD
 	tristate "Normal floppy disk support"
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Kconfig.embedded linux-2.6.1-rc1-tiny1.config-block/drivers/block/Kconfig.embedded
--- linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Kconfig.embedded	Wed Dec 31 17:00:00 1969
+++ linux-2.6.1-rc1-tiny1.config-block/drivers/block/Kconfig.embedded	Thu Jan  8 11:29:14 2004
@@ -0,0 +1,5 @@
+config BLOCK
+	bool "Block device support" if EMBEDDED
+	default y
+	help
+	  Allow the complete removal of block device code
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Kconfig.iosched linux-2.6.1-rc1-tiny1.config-block/drivers/block/Kconfig.iosched
--- linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Kconfig.iosched	Wed Dec 17 19:58:07 2003
+++ linux-2.6.1-rc1-tiny1.config-block/drivers/block/Kconfig.iosched	Thu Jan  8 11:29:14 2004
@@ -1,3 +1,5 @@
+if BLOCK
+
 config IOSCHED_NOOP
 	bool "No-op I/O scheduler" if EMBEDDED
 	default y
@@ -26,4 +28,6 @@
 	  workloads, better. In the case of a single process performing I/O to
 	  a disk at any one time, its behaviour is almost identical to the
 	  anticipatory I/O scheduler and so is a good choice.
+
+endif
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Makefile linux-2.6.1-rc1-tiny1.config-block/drivers/block/Makefile
--- linux-2.6.1-rc1-tiny1.compile-fixes/drivers/block/Makefile	Wed Dec 17 19:59:19 2003
+++ linux-2.6.1-rc1-tiny1.config-block/drivers/block/Makefile	Thu Jan  8 11:29:14 2004
@@ -13,7 +13,7 @@
 # kblockd threads
 #
 
-obj-y	:= elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
+obj-$(CONFIG_BLOCK)	:= elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
 
 obj-$(CONFIG_IOSCHED_NOOP)	+= noop-iosched.o
 obj-$(CONFIG_IOSCHED_AS)	+= as-iosched.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/drivers/md/Kconfig linux-2.6.1-rc1-tiny1.config-block/drivers/md/Kconfig
--- linux-2.6.1-rc1-tiny1.compile-fixes/drivers/md/Kconfig	Sat Jan  3 22:09:07 2004
+++ linux-2.6.1-rc1-tiny1.config-block/drivers/md/Kconfig	Thu Jan  8 11:29:14 2004
@@ -3,6 +3,7 @@
 #
 
 menu "Multi-device support (RAID and LVM)"
+	depends on BLOCK
 
 config MD
 	bool "Multiple devices driver support (RAID and LVM)"
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/Kconfig linux-2.6.1-rc1-tiny1.config-block/fs/Kconfig
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/Kconfig	Sun Jan  4 00:03:56 2004
+++ linux-2.6.1-rc1-tiny1.config-block/fs/Kconfig	Thu Jan  8 11:29:14 2004
@@ -6,6 +6,7 @@
 
 config EXT2_FS
 	tristate "Second extended fs support"
+	depends on BLOCK
 	help
 	  This is the de facto standard Linux file system (method to organize
 	  files on a storage device) for hard disks.
@@ -85,6 +86,7 @@
 
 config EXT3_FS
 	tristate "Ext3 journalling file system support"
+	depends on BLOCK
 	help
 	  This is the journaling version of the Second extended file system
 	  (often called ext3), the de facto standard Linux file system
@@ -157,6 +159,7 @@
 # dep_tristate '  Journal Block Device support (JBD for ext3)' CONFIG_JBD $CONFIG_EXT3_FS
 	tristate
 	default EXT3_FS
+	depends on BLOCK
 	help
 	  This is a generic journaling layer for block devices.  It is
 	  currently used by the ext3 file system, but it could also be used to
@@ -195,6 +198,7 @@
 
 config REISERFS_FS
 	tristate "Reiserfs support"
+	depends on BLOCK
 	help
 	  Stores not just filenames but the files themselves in a balanced
 	  tree.  Uses journaling.
@@ -246,6 +250,7 @@
 
 config JFS_FS
 	tristate "JFS filesystem support"
+	depends on BLOCK
 	select NLS
 	help
 	  This is a port of IBM's Journaled Filesystem .  More information is
@@ -293,6 +298,7 @@
 
 config XFS_FS
 	tristate "XFS filesystem support"
+	depends on BLOCK
 	help
 	  XFS is a high performance journaling filesystem which originated
 	  on the SGI IRIX platform.  It is completely multi-threaded, can
@@ -358,6 +364,7 @@
 
 config MINIX_FS
 	tristate "Minix fs support"
+	depends on BLOCK
 	help
 	  Minix is a simple operating system used in many classes about OS's.
 	  The minix file system (method to organize files on a hard disk
@@ -375,6 +382,7 @@
 
 config ROMFS_FS
 	tristate "ROM file system support"
+	depends on BLOCK
 	---help---
 	  This is a very small read-only file system mainly intended for
 	  initial ram disks of installation disks, but it could be used for
@@ -466,6 +474,8 @@
 	  N here.
 
 menu "CD-ROM/DVD Filesystems"
+	depends on BLOCK
+
 
 config ISO9660_FS
 	tristate "ISO 9660 CDROM file system support"
@@ -529,6 +539,7 @@
 endmenu
 
 menu "DOS/FAT/NT Filesystems"
+	depends on BLOCK
 
 config FAT_FS
 	tristate "DOS FAT fs support"
@@ -900,6 +911,7 @@
 config ADFS_FS
 	tristate "ADFS file system support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	depends on BLOCK
 	help
 	  The Acorn Disc Filing System is the standard file system of the
 	  RiscOS operating system which runs on Acorn's ARM-based Risc PC
@@ -928,6 +940,7 @@
 config AFFS_FS
 	tristate "Amiga FFS file system support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	depends on BLOCK
 	help
 	  The Fast File System (FFS) is the common file system used on hard
 	  disks by Amiga(tm) systems since AmigaOS Version 1.3 (34.20).  Say Y
@@ -950,6 +963,7 @@
 config HFS_FS
 	tristate "Apple Macintosh file system support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	depends on BLOCK
 	help
 	  If you say Y here, you will be able to mount Macintosh-formatted
 	  floppy disks and hard drive partitions with full read-write access.
@@ -962,6 +976,7 @@
 config BEFS_FS
 	tristate "BeOS file systemv(BeFS) support (read only) (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	depends on BLOCK
 	select NLS
 	help
 	  The BeOS File System (BeFS) is the native file system of Be, Inc's
@@ -989,6 +1004,7 @@
 config BFS_FS
 	tristate "BFS file system support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	depends on BLOCK
 	help
 	  Boot File System (BFS) is a file system used under SCO UnixWare to
 	  allow the bootloader access to the kernel image and other important
@@ -1011,6 +1027,7 @@
 config EFS_FS
 	tristate "EFS file system support (read only) (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	depends on BLOCK
 	help
 	  EFS is an older file system used for non-ISO9660 CD-ROMs and hard
 	  disk partitions by SGI's IRIX operating system (IRIX 6.0 and newer
@@ -1097,6 +1114,7 @@
 
 config CRAMFS
 	tristate "Compressed ROM file system support"
+	depends on BLOCK
 	select ZLIB_INFLATE
 	help
 	  Saying Y here includes support for CramFs (Compressed ROM File
@@ -1116,6 +1134,7 @@
 
 config VXFS_FS
 	tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
+	depends on BLOCK
 	help
 	  FreeVxFS is a file system driver that support the VERITAS VxFS(TM)
 	  file system format.  VERITAS VxFS(TM) is the standard file system
@@ -1133,6 +1152,7 @@
 
 config HPFS_FS
 	tristate "OS/2 HPFS file system support"
+	depends on BLOCK
 	help
 	  OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
 	  is the file system used for organizing files on OS/2 hard disk
@@ -1149,6 +1169,7 @@
 
 config QNX4FS_FS
 	tristate "QNX4 file system support (read only)"
+	depends on BLOCK
 	help
 	  This is the file system used by the real-time operating systems
 	  QNX 4 and QNX 6 (the latter is also called QNX RTP).
@@ -1176,6 +1197,7 @@
 
 config SYSV_FS
 	tristate "System V/Xenix/V7/Coherent file system support"
+	depends on BLOCK
 	help
 	  SCO, Xenix and Coherent are commercial Unix systems for Intel
 	  machines, and Version 7 was used on the DEC PDP-11. Saying Y
@@ -1214,6 +1236,7 @@
 
 config UFS_FS
 	tristate "UFS file system support (read only)"
+	depends on BLOCK
 	help
 	  BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
 	  OpenBSD and NeXTstep) use a file system called UFS. Some System V
@@ -1608,6 +1631,7 @@
 endmenu
 
 menu "Partition Types"
+	depends on BLOCK
 
 source "fs/partitions/Kconfig"
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/Makefile linux-2.6.1-rc1-tiny1.config-block/fs/Makefile
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/Makefile	Sun Jan  4 00:03:56 2004
+++ linux-2.6.1-rc1-tiny1.config-block/fs/Makefile	Thu Jan  8 11:29:14 2004
@@ -5,13 +5,14 @@
 # Rewritten to use lists instead of if-statements.
 # 
 
-obj-y :=	open.o read_write.o file_table.o buffer.o \
-		bio.o super.o block_dev.o char_dev.o stat.o exec.o pipe.o \
+obj-y :=	open.o read_write.o file_table.o \
+		super.o char_dev.o stat.o exec.o pipe.o \
 		namei.o fcntl.o ioctl.o readdir.o select.o fifo.o locks.o \
 		dcache.o inode.o attr.o bad_inode.o file.o \
 		filesystems.o namespace.o seq_file.o xattr.o libfs.o \
-		fs-writeback.o mpage.o direct-io.o aio.o
+		fs-writeback.o mpage.o aio.o sync.o
 
+obj-$(CONFIG_BLOCK)		+= buffer.o bio.o block_dev.o direct-io.o
 obj-$(CONFIG_DNOTIFY)		+= dnotify.o
 obj-$(CONFIG_EPOLL)		+= eventpoll.o
 obj-$(CONFIG_COMPAT)		+= compat.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/block_dev.c linux-2.6.1-rc1-tiny1.config-block/fs/block_dev.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/block_dev.c	Wed Dec 17 20:00:01 2003
+++ linux-2.6.1-rc1-tiny1.config-block/fs/block_dev.c	Thu Jan  8 11:29:14 2004
@@ -899,3 +899,104 @@
 }
 
 EXPORT_SYMBOL(close_bdev_excl);
+
+static void do_emergency_remount(unsigned long foo)
+{
+	struct super_block *sb;
+
+	spin_lock(&sb_lock);
+	list_for_each_entry(sb, &super_blocks, s_list) {
+		sb->s_count++;
+		spin_unlock(&sb_lock);
+		down_read(&sb->s_umount);
+		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
+			/*
+			 * ->remount_fs needs lock_kernel().
+			 *
+			 * What lock protects sb->s_flags??
+			 */
+			lock_kernel();
+			do_remount_sb(sb, MS_RDONLY, NULL, 1);
+			unlock_kernel();
+		}
+		drop_super(sb);
+		spin_lock(&sb_lock);
+	}
+	spin_unlock(&sb_lock);
+	printk("Emergency Remount complete\n");
+}
+
+void emergency_remount(void)
+{
+	pdflush_operation(do_emergency_remount, 0);
+}
+
+static int set_bdev_super(struct super_block *s, void *data)
+{
+	s->s_bdev = data;
+	s->s_dev = s->s_bdev->bd_dev;
+	return 0;
+}
+
+static int test_bdev_super(struct super_block *s, void *data)
+{
+	return (void *)s->s_bdev == data;
+}
+
+struct super_block *get_sb_bdev(struct file_system_type *fs_type,
+	int flags, const char *dev_name, void *data,
+	int (*fill_super)(struct super_block *, void *, int))
+{
+	struct block_device *bdev;
+	struct super_block *s;
+	int error = 0;
+
+	bdev = open_bdev_excl(dev_name, flags, BDEV_FS, fs_type);
+	if (IS_ERR(bdev))
+		return (struct super_block *)bdev;
+
+	s = sget(fs_type, test_bdev_super, set_bdev_super, bdev);
+	if (IS_ERR(s))
+		goto out;
+
+	if (s->s_root) {
+		if ((flags ^ s->s_flags) & MS_RDONLY) {
+			up_write(&s->s_umount);
+			deactivate_super(s);
+			s = ERR_PTR(-EBUSY);
+		}
+		goto out;
+	} else {
+		char b[BDEVNAME_SIZE];
+
+		s->s_flags = flags;
+		strncpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
+		s->s_old_blocksize = block_size(bdev);
+		sb_set_blocksize(s, s->s_old_blocksize);
+		error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
+		if (error) {
+			up_write(&s->s_umount);
+			deactivate_super(s);
+			s = ERR_PTR(error);
+		} else
+			s->s_flags |= MS_ACTIVE;
+	}
+
+	return s;
+
+out:
+	close_bdev_excl(bdev, BDEV_FS);
+	return s;
+}
+
+EXPORT_SYMBOL(get_sb_bdev);
+
+void kill_block_super(struct super_block *sb)
+{
+	struct block_device *bdev = sb->s_bdev;
+	generic_shutdown_super(sb);
+	set_blocksize(bdev, sb->s_old_blocksize);
+	close_bdev_excl(bdev, BDEV_FS);
+}
+
+EXPORT_SYMBOL(kill_block_super);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/buffer.c linux-2.6.1-rc1-tiny1.config-block/fs/buffer.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/buffer.c	Sun Jan  4 00:03:56 2004
+++ linux-2.6.1-rc1-tiny1.config-block/fs/buffer.c	Thu Jan  8 11:29:14 2004
@@ -16,6 +16,10 @@
  * Added 32k buffer block sizes - these are required older ARM systems. - RMK
  *
  * async buffer flushing, 1999 Andrea Arcangeli <andrea@suse.de>
+ *
+ * moved bdflush and generic sync functions to sync.c
+ * moved try_to_release_page to mm/page-writeback.c 
+ *     Eric Biederman <ebiederm@xmission.com> 8 Jan 2004 
  */
 
 #include <linux/config.h>
@@ -225,27 +229,6 @@
 
 /*
  * Write out and wait upon all dirty data associated with this
- * superblock.  Filesystem data as well as the underlying block
- * device.  Takes the superblock lock.
- */
-int fsync_super(struct super_block *sb)
-{
-	sync_inodes_sb(sb, 0);
-	DQUOT_SYNC(sb);
-	lock_super(sb);
-	if (sb->s_dirt && sb->s_op->write_super)
-		sb->s_op->write_super(sb);
-	unlock_super(sb);
-	if (sb->s_op->sync_fs)
-		sb->s_op->sync_fs(sb, 1);
-	sync_blockdev(sb->s_bdev);
-	sync_inodes_sb(sb, 1);
-
-	return sync_blockdev(sb->s_bdev);
-}
-
-/*
- * Write out and wait upon all dirty data associated with this
  * device.   Filesystem data as well as the underlying block
  * device.  Takes the superblock lock.
  */
@@ -260,137 +243,7 @@
 	return sync_blockdev(bdev);
 }
 
-/*
- * sync everything.  Start out by waking pdflush, because that writes back
- * all queues in parallel.
- */
-static void do_sync(unsigned long wait)
-{
-	wakeup_bdflush(0);
-	sync_inodes(0);		/* All mappings, inodes and their blockdevs */
-	DQUOT_SYNC(NULL);
-	sync_supers();		/* Write the superblocks */
-	sync_filesystems(0);	/* Start syncing the filesystems */
-	sync_filesystems(wait);	/* Waitingly sync the filesystems */
-	sync_inodes(wait);	/* Mappings, inodes and blockdevs, again. */
-	if (!wait)
-		printk("Emergency Sync complete\n");
-}
-
-asmlinkage long sys_sync(void)
-{
-	do_sync(1);
-	return 0;
-}
-
-void emergency_sync(void)
-{
-	pdflush_operation(do_sync, 0);
-}
-
-/*
- * Generic function to fsync a file.
- *
- * filp may be NULL if called via the msync of a vma.
- */
- 
-int file_fsync(struct file *filp, struct dentry *dentry, int datasync)
-{
-	struct inode * inode = dentry->d_inode;
-	struct super_block * sb;
-	int ret;
-
-	/* sync the inode to buffers */
-	write_inode_now(inode, 0);
-
-	/* sync the superblock to buffers */
-	sb = inode->i_sb;
-	lock_super(sb);
-	if (sb->s_op->write_super)
-		sb->s_op->write_super(sb);
-	unlock_super(sb);
-
-	/* .. finally sync the buffers to disk */
-	ret = sync_blockdev(sb->s_bdev);
-	return ret;
-}
-
-asmlinkage long sys_fsync(unsigned int fd)
-{
-	struct file * file;
-	struct dentry * dentry;
-	struct inode * inode;
-	int ret, err;
-
-	ret = -EBADF;
-	file = fget(fd);
-	if (!file)
-		goto out;
-
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
-
-	ret = -EINVAL;
-	if (!file->f_op || !file->f_op->fsync) {
-		/* Why?  We can still call filemap_fdatawrite */
-		goto out_putf;
-	}
-
-	/* We need to protect against concurrent writers.. */
-	down(&inode->i_sem);
-	current->flags |= PF_SYNCWRITE;
-	ret = filemap_fdatawrite(inode->i_mapping);
-	err = file->f_op->fsync(file, dentry, 0);
-	if (!ret)
-		ret = err;
-	err = filemap_fdatawait(inode->i_mapping);
-	if (!ret)
-		ret = err;
-	current->flags &= ~PF_SYNCWRITE;
-	up(&inode->i_sem);
-
-out_putf:
-	fput(file);
-out:
-	return ret;
-}
-
-asmlinkage long sys_fdatasync(unsigned int fd)
-{
-	struct file * file;
-	struct dentry * dentry;
-	struct inode * inode;
-	int ret, err;
-
-	ret = -EBADF;
-	file = fget(fd);
-	if (!file)
-		goto out;
-
-	dentry = file->f_dentry;
-	inode = dentry->d_inode;
-
-	ret = -EINVAL;
-	if (!file->f_op || !file->f_op->fsync)
-		goto out_putf;
-
-	down(&inode->i_sem);
-	current->flags |= PF_SYNCWRITE;
-	ret = filemap_fdatawrite(inode->i_mapping);
-	err = file->f_op->fsync(file, dentry, 1);
-	if (!ret)
-		ret = err;
-	err = filemap_fdatawait(inode->i_mapping);
-	if (!ret)
-		ret = err;
-	current->flags &= ~PF_SYNCWRITE;
-	up(&inode->i_sem);
 
-out_putf:
-	fput(file);
-out:
-	return ret;
-}
 
 /*
  * Various filesystems appear to want __find_get_block to be non-blocking.
@@ -1562,35 +1415,6 @@
 }
 
 /**
- * try_to_release_page() - release old fs-specific metadata on a page
- *
- * @page: the page which the kernel is trying to free
- * @gfp_mask: memory allocation flags (and I/O mode)
- *
- * The address_space is to try to release any data against the page
- * (presumably at page->private).  If the release was successful, return `1'.
- * Otherwise return zero.
- *
- * The @gfp_mask argument specifies whether I/O may be performed to release
- * this page (__GFP_IO), and whether the call may block (__GFP_WAIT).
- *
- * NOTE: @gfp_mask may go away, and this function may become non-blocking.
- */
-int try_to_release_page(struct page *page, int gfp_mask)
-{
-	struct address_space * const mapping = page->mapping;
-
-	if (!PageLocked(page))
-		BUG();
-	if (PageWriteback(page))
-		return 0;
-	
-	if (mapping && mapping->a_ops->releasepage)
-		return mapping->a_ops->releasepage(page, gfp_mask);
-	return try_to_free_buffers(page);
-}
-
-/**
  * block_invalidatepage - invalidate part of all of a buffer-backed page
  *
  * @page: the page which is affected
@@ -2894,33 +2718,6 @@
 }
 
 /*
- * There are no bdflush tunables left.  But distributions are
- * still running obsolete flush daemons, so we terminate them here.
- *
- * Use of bdflush() is deprecated and will be removed in a future kernel.
- * The `pdflush' kernel threads fully replace bdflush daemons and this call.
- */
-asmlinkage long sys_bdflush(int func, long data)
-{
-	static int msg_count;
-
-	if (!capable(CAP_SYS_ADMIN))
-		return -EPERM;
-
-	if (msg_count < 5) {
-		msg_count++;
-		printk(KERN_INFO
-			"warning: process `%s' used the obsolete bdflush"
-			" system call\n", current->comm);
-		printk(KERN_INFO "Fix your initscripts?\n");
-	}
-
-	if (func == 1)
-		do_exit(0);
-	return 0;
-}
-
-/*
  * Buffer-head allocation
  */
 static kmem_cache_t *bh_cachep;
@@ -3054,7 +2851,6 @@
 EXPORT_SYMBOL(end_buffer_async_write);
 EXPORT_SYMBOL(end_buffer_read_sync);
 EXPORT_SYMBOL(end_buffer_write_sync);
-EXPORT_SYMBOL(file_fsync);
 EXPORT_SYMBOL(fsync_bdev);
 EXPORT_SYMBOL(fsync_buffers_list);
 EXPORT_SYMBOL(generic_block_bmap);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/dcache.c linux-2.6.1-rc1-tiny1.config-block/fs/dcache.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/dcache.c	Sat Jan  3 22:09:11 2004
+++ linux-2.6.1-rc1-tiny1.config-block/fs/dcache.c	Thu Jan  8 11:29:14 2004
@@ -1598,7 +1598,12 @@
 
 EXPORT_SYMBOL(d_genocide);
 
+#ifdef CONFIG_BLOCK
 extern void bdev_cache_init(void);
+#else
+static inline void bdev_cache_init(void) {}
+#endif
+
 extern void chrdev_init(void);
 
 void __init vfs_caches_init(unsigned long mempages)
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/fs-writeback.c linux-2.6.1-rc1-tiny1.config-block/fs/fs-writeback.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/fs-writeback.c	Wed Dec 17 20:00:00 2003
+++ linux-2.6.1-rc1-tiny1.config-block/fs/fs-writeback.c	Thu Jan  8 11:29:14 2004
@@ -23,7 +23,9 @@
 #include <linux/backing-dev.h>
 #include <linux/buffer_head.h>
 
+#ifdef CONFIG_BLOCK
 extern struct super_block *blockdev_superblock;
+#endif
 
 /**
  *	__mark_inode_dirty -	internal function
@@ -263,6 +265,7 @@
 		struct backing_dev_info *bdi = mapping->backing_dev_info;
 
 		if (bdi->memory_backed) {
+#ifdef CONFIG_BLOCK
 			if (sb == blockdev_superblock) {
 				/*
 				 * Dirty memory-backed blockdev: the ramdisk
@@ -271,6 +274,7 @@
 				list_move(&inode->i_list, &sb->s_dirty);
 				continue;
 			}
+#endif
 			/*
 			 * Assume that all inodes on this superblock are memory
 			 * backed.  Skip the superblock.
@@ -280,15 +284,19 @@
 
 		if (wbc->nonblocking && bdi_write_congested(bdi)) {
 			wbc->encountered_congestion = 1;
+#ifdef CONFIG_BLOCK
 			if (sb != blockdev_superblock)
 				break;		/* Skip a congested fs */
+#endif
 			list_move(&inode->i_list, &sb->s_dirty);
 			continue;		/* Skip a congested blockdev */
 		}
 
 		if (wbc->bdi && bdi != wbc->bdi) {
+#ifdef CONFIG_BLOCK
 			if (sb != blockdev_superblock)
 				break;		/* fs has the wrong queue */
+#endif
 			list_move(&inode->i_list, &sb->s_dirty);
 			continue;		/* blockdev has wrong queue */
 		}
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/inode.c linux-2.6.1-rc1-tiny1.config-block/fs/inode.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/inode.c	Wed Dec 17 19:59:55 2003
+++ linux-2.6.1-rc1-tiny1.config-block/fs/inode.c	Thu Jan  8 11:29:14 2004
@@ -245,8 +245,10 @@
 	DQUOT_DROP(inode);
 	if (inode->i_sb && inode->i_sb->s_op->clear_inode)
 		inode->i_sb->s_op->clear_inode(inode);
+#ifdef CONFIG_BLOCK
 	if (inode->i_bdev)
 		bd_forget(inode);
+#endif
 	if (inode->i_cdev)
 		cd_forget(inode);
 	inode->i_state = I_CLEAR;
@@ -354,6 +356,7 @@
 
 EXPORT_SYMBOL(invalidate_inodes);
  
+#ifdef CONFIG_BLOCK
 int __invalidate_device(struct block_device *bdev, int do_sync)
 {
 	struct super_block *sb;
@@ -380,6 +383,7 @@
 }
 
 EXPORT_SYMBOL(__invalidate_device);
+#endif
 
 static int can_unuse(struct inode *inode)
 {
@@ -1384,6 +1388,17 @@
 
 	set_shrinker(DEFAULT_SEEKS, shrink_icache_memory);
 }
+
+#ifndef CONFIG_BLOCK
+static int no_bdev_open(struct inode *inode, struct file *file)
+{
+	return -ENXIO;
+};
+
+struct file_operations def_blk_fops = {
+	.open	= no_bdev_open,
+};
+#endif
 
 void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
 {
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/mpage.c linux-2.6.1-rc1-tiny1.config-block/fs/mpage.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/mpage.c	Wed Dec 17 19:58:28 2003
+++ linux-2.6.1-rc1-tiny1.config-block/fs/mpage.c	Thu Jan  8 11:29:14 2004
@@ -27,6 +27,7 @@
 #include <linux/backing-dev.h>
 #include <linux/pagevec.h>
 
+#ifdef CONFIG_BLOCK
 /*
  * I/O completion handler for multipage BIOs.
  *
@@ -576,6 +577,8 @@
 	return bio;
 }
 
+#endif /* CONFIG_BLOCK */
+
 /**
  * mpage_writepages - walk the list of dirty pages of the given
  * address space and writepage() all of them.
@@ -620,8 +623,10 @@
 		struct writeback_control *wbc, get_block_t get_block)
 {
 	struct backing_dev_info *bdi = mapping->backing_dev_info;
+#ifdef CONFIG_BLOCK
 	struct bio *bio = NULL;
 	sector_t last_block_in_bio = 0;
+#endif
 	int ret = 0;
 	int done = 0;
 	int (*writepage)(struct page *page, struct writeback_control *wbc);
@@ -631,8 +636,10 @@
 		return 0;
 	}
 
+#ifdef CONFIG_BLOCK
 	writepage = NULL;
 	if (get_block == NULL)
+#endif
 		writepage = mapping->a_ops->writepage;
 
 	spin_lock(&mapping->page_lock);
@@ -671,7 +678,9 @@
 
 		if (page->mapping == mapping && !PageWriteback(page) &&
 					test_clear_page_dirty(page)) {
+#ifdef CONFIG_BLOCK
 			if (writepage) {
+#endif
 				ret = (*writepage)(page, wbc);
 				if (ret) {
 					if (ret == -ENOSPC)
@@ -681,10 +690,13 @@
 						set_bit(AS_EIO,
 							&mapping->flags);
 				}
-			} else {
+#ifdef CONFIG_BLOCK
+			} 
+			else {
 				bio = mpage_writepage(bio, page, get_block,
 					&last_block_in_bio, &ret, wbc);
 			}
+#endif
 			if (ret || (--(wbc->nr_to_write) <= 0))
 				done = 1;
 			if (wbc->nonblocking && bdi_write_congested(bdi)) {
@@ -701,8 +713,10 @@
 	 * Leave any remaining dirty pages on ->io_pages
 	 */
 	spin_unlock(&mapping->page_lock);
+#ifdef CONFIG_BLOCK
 	if (bio)
 		mpage_bio_submit(WRITE, bio);
+#endif
 	return ret;
 }
 EXPORT_SYMBOL(mpage_writepages);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/partitions/Makefile linux-2.6.1-rc1-tiny1.config-block/fs/partitions/Makefile
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/partitions/Makefile	Wed Dec 17 19:58:47 2003
+++ linux-2.6.1-rc1-tiny1.config-block/fs/partitions/Makefile	Thu Jan  8 11:29:14 2004
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-obj-y := check.o
+obj-$(CONFIG_BLOCK) := check.o
 
 obj-$(CONFIG_DEVFS_FS) += devfs.o
 obj-$(CONFIG_ACORN_PARTITION) += acorn.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/super.c linux-2.6.1-rc1-tiny1.config-block/fs/super.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/super.c	Wed Dec 17 19:58:48 2003
+++ linux-2.6.1-rc1-tiny1.config-block/fs/super.c	Thu Jan  8 11:29:14 2004
@@ -18,6 +18,8 @@
  *    Torbjörn Lindh (torbjorn.lindh@gopta.se), April 14, 1996.
  *  Added devfs support: Richard Gooch <rgooch@atnf.csiro.au>, 13-JAN-1998
  *  Heavily rewritten for 'one fs - one tree' dcache architecture. AV, Mar 2000
+ *  Moved block device specific functions to block_dev.c 
+ *     Eric Biederman <ebiederm@xmission.com> 8 Jan 2004
  */
 
 #include <linux/config.h>
@@ -499,37 +501,6 @@
 	return 0;
 }
 
-static void do_emergency_remount(unsigned long foo)
-{
-	struct super_block *sb;
-
-	spin_lock(&sb_lock);
-	list_for_each_entry(sb, &super_blocks, s_list) {
-		sb->s_count++;
-		spin_unlock(&sb_lock);
-		down_read(&sb->s_umount);
-		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
-			/*
-			 * ->remount_fs needs lock_kernel().
-			 *
-			 * What lock protects sb->s_flags??
-			 */
-			lock_kernel();
-			do_remount_sb(sb, MS_RDONLY, NULL, 1);
-			unlock_kernel();
-		}
-		drop_super(sb);
-		spin_lock(&sb_lock);
-	}
-	spin_unlock(&sb_lock);
-	printk("Emergency Remount complete\n");
-}
-
-void emergency_remount(void)
-{
-	pdflush_operation(do_emergency_remount, 0);
-}
-
 /*
  * Unnamed block devices are dummy devices used by virtual
  * filesystems which don't use real block-devices.  -- jrs
@@ -575,76 +546,6 @@
 }
 
 EXPORT_SYMBOL(kill_litter_super);
-
-static int set_bdev_super(struct super_block *s, void *data)
-{
-	s->s_bdev = data;
-	s->s_dev = s->s_bdev->bd_dev;
-	return 0;
-}
-
-static int test_bdev_super(struct super_block *s, void *data)
-{
-	return (void *)s->s_bdev == data;
-}
-
-struct super_block *get_sb_bdev(struct file_system_type *fs_type,
-	int flags, const char *dev_name, void *data,
-	int (*fill_super)(struct super_block *, void *, int))
-{
-	struct block_device *bdev;
-	struct super_block *s;
-	int error = 0;
-
-	bdev = open_bdev_excl(dev_name, flags, BDEV_FS, fs_type);
-	if (IS_ERR(bdev))
-		return (struct super_block *)bdev;
-
-	s = sget(fs_type, test_bdev_super, set_bdev_super, bdev);
-	if (IS_ERR(s))
-		goto out;
-
-	if (s->s_root) {
-		if ((flags ^ s->s_flags) & MS_RDONLY) {
-			up_write(&s->s_umount);
-			deactivate_super(s);
-			s = ERR_PTR(-EBUSY);
-		}
-		goto out;
-	} else {
-		char b[BDEVNAME_SIZE];
-
-		s->s_flags = flags;
-		strncpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
-		s->s_old_blocksize = block_size(bdev);
-		sb_set_blocksize(s, s->s_old_blocksize);
-		error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
-		if (error) {
-			up_write(&s->s_umount);
-			deactivate_super(s);
-			s = ERR_PTR(error);
-		} else
-			s->s_flags |= MS_ACTIVE;
-	}
-
-	return s;
-
-out:
-	close_bdev_excl(bdev, BDEV_FS);
-	return s;
-}
-
-EXPORT_SYMBOL(get_sb_bdev);
-
-void kill_block_super(struct super_block *sb)
-{
-	struct block_device *bdev = sb->s_bdev;
-	generic_shutdown_super(sb);
-	set_blocksize(bdev, sb->s_old_blocksize);
-	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,
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/fs/sync.c linux-2.6.1-rc1-tiny1.config-block/fs/sync.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/fs/sync.c	Wed Dec 31 17:00:00 1969
+++ linux-2.6.1-rc1-tiny1.config-block/fs/sync.c	Thu Jan  8 11:29:14 2004
@@ -0,0 +1,201 @@
+/*
+ *  linux/fs/sync.c
+ *
+ *  Copyright (C) 1991, 1992, 2002  Linus Torvalds 
+ *  And others see buffer.c
+ */
+
+/*
+ * Moved here from buffer.c 8 Jan 2004 Eric Biederman <ebiererman@xmission.com>
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/file.h>
+#include <linux/quotaops.h>
+#include <linux/writeback.h>
+#include <linux/buffer_head.h>
+#include <linux/module.h>
+
+/*
+ * Write out and wait upon all dirty data associated with this
+ * superblock.  Filesystem data as well as the underlying block
+ * device.  Takes the superblock lock.
+ */
+int fsync_super(struct super_block *sb)
+{
+	sync_inodes_sb(sb, 0);
+	DQUOT_SYNC(sb);
+	lock_super(sb);
+	if (sb->s_dirt && sb->s_op->write_super)
+		sb->s_op->write_super(sb);
+	unlock_super(sb);
+	if (sb->s_op->sync_fs)
+		sb->s_op->sync_fs(sb, 1);
+	sync_blockdev(sb->s_bdev);
+	sync_inodes_sb(sb, 1);
+
+	return sync_blockdev(sb->s_bdev);
+}
+
+/*
+ * sync everything.  Start out by waking pdflush, because that writes back
+ * all queues in parallel.
+ */
+static void do_sync(unsigned long wait)
+{
+	wakeup_bdflush(0);
+	sync_inodes(0);		/* All mappings, inodes and their blockdevs */
+	DQUOT_SYNC(NULL);
+	sync_supers();		/* Write the superblocks */
+	sync_filesystems(0);	/* Start syncing the filesystems */
+	sync_filesystems(wait);	/* Waitingly sync the filesystems */
+	sync_inodes(wait);	/* Mappings, inodes and blockdevs, again. */
+	if (!wait)
+		printk("Emergency Sync complete\n");
+}
+
+asmlinkage long sys_sync(void)
+{
+	do_sync(1);
+	return 0;
+}
+
+void emergency_sync(void)
+{
+	pdflush_operation(do_sync, 0);
+}
+
+/*
+ * Generic function to fsync a file.
+ *
+ * filp may be NULL if called via the msync of a vma.
+ */
+ 
+int file_fsync(struct file *filp, struct dentry *dentry, int datasync)
+{
+	struct inode * inode = dentry->d_inode;
+	struct super_block * sb;
+	int ret;
+
+	/* sync the inode to buffers */
+	write_inode_now(inode, 0);
+
+	/* sync the superblock to buffers */
+	sb = inode->i_sb;
+	lock_super(sb);
+	if (sb->s_op->write_super)
+		sb->s_op->write_super(sb);
+	unlock_super(sb);
+
+	/* .. finally sync the buffers to disk */
+	ret = sync_blockdev(sb->s_bdev);
+	return ret;
+}
+EXPORT_SYMBOL(file_fsync);
+
+asmlinkage long sys_fsync(unsigned int fd)
+{
+	struct file * file;
+	struct dentry * dentry;
+	struct inode * inode;
+	int ret, err;
+
+	ret = -EBADF;
+	file = fget(fd);
+	if (!file)
+		goto out;
+
+	dentry = file->f_dentry;
+	inode = dentry->d_inode;
+
+	ret = -EINVAL;
+	if (!file->f_op || !file->f_op->fsync) {
+		/* Why?  We can still call filemap_fdatawrite */
+		goto out_putf;
+	}
+
+	/* We need to protect against concurrent writers.. */
+	down(&inode->i_sem);
+	current->flags |= PF_SYNCWRITE;
+	ret = filemap_fdatawrite(inode->i_mapping);
+	err = file->f_op->fsync(file, dentry, 0);
+	if (!ret)
+		ret = err;
+	err = filemap_fdatawait(inode->i_mapping);
+	if (!ret)
+		ret = err;
+	current->flags &= ~PF_SYNCWRITE;
+	up(&inode->i_sem);
+
+out_putf:
+	fput(file);
+out:
+	return ret;
+}
+
+asmlinkage long sys_fdatasync(unsigned int fd)
+{
+	struct file * file;
+	struct dentry * dentry;
+	struct inode * inode;
+	int ret, err;
+
+	ret = -EBADF;
+	file = fget(fd);
+	if (!file)
+		goto out;
+
+	dentry = file->f_dentry;
+	inode = dentry->d_inode;
+
+	ret = -EINVAL;
+	if (!file->f_op || !file->f_op->fsync)
+		goto out_putf;
+
+	down(&inode->i_sem);
+	current->flags |= PF_SYNCWRITE;
+	ret = filemap_fdatawrite(inode->i_mapping);
+	err = file->f_op->fsync(file, dentry, 1);
+	if (!ret)
+		ret = err;
+	err = filemap_fdatawait(inode->i_mapping);
+	if (!ret)
+		ret = err;
+	current->flags &= ~PF_SYNCWRITE;
+	up(&inode->i_sem);
+
+out_putf:
+	fput(file);
+out:
+	return ret;
+}
+
+/*
+ * There are no bdflush tunables left.  But distributions are
+ * still running obsolete flush daemons, so we terminate them here.
+ *
+ * Use of bdflush() is deprecated and will be removed in a future kernel.
+ * The `pdflush' kernel threads fully replace bdflush daemons and this call.
+ */
+asmlinkage long sys_bdflush(int func, long data)
+{
+	static int msg_count;
+
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;
+
+	if (msg_count < 5) {
+		msg_count++;
+		printk(KERN_INFO
+			"warning: process `%s' used the obsolete bdflush"
+			" system call\n", current->comm);
+		printk(KERN_INFO "Fix your initscripts?\n");
+	}
+
+	if (func == 1)
+		do_exit(0);
+	return 0;
+}
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/blkdev.h linux-2.6.1-rc1-tiny1.config-block/include/linux/blkdev.h
--- linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/blkdev.h	Wed Dec 17 19:58:28 2003
+++ linux-2.6.1-rc1-tiny1.config-block/include/linux/blkdev.h	Thu Jan  8 11:29:14 2004
@@ -577,7 +577,11 @@
 extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *);
 extern void blk_dump_rq_flags(struct request *, char *);
 extern void generic_unplug_device(void *);
+#ifdef CONFIG_BLOCK
 extern long nr_blockdev_pages(void);
+#else
+static inline long nr_blockdev_pages(void) { return 0; }
+#endif
 
 int blk_get_queue(request_queue_t *);
 request_queue_t *blk_alloc_queue(int);
@@ -596,7 +600,12 @@
 extern void blk_queue_free_tags(request_queue_t *);
 extern int blk_queue_resize_tags(request_queue_t *, int);
 extern void blk_queue_invalidate_tags(request_queue_t *);
+
+#ifdef CONFIG_BLOCK
 extern void blk_congestion_wait(int rw, long timeout);
+#else
+static inline void blk_congestion_wait(int rw, long timeout) {} 
+#endif
 
 extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
 extern void blk_rq_prep_restart(struct request *);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/buffer_head.h linux-2.6.1-rc1-tiny1.config-block/include/linux/buffer_head.h
--- linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/buffer_head.h	Wed Dec 17 19:58:04 2003
+++ linux-2.6.1-rc1-tiny1.config-block/include/linux/buffer_head.h	Thu Jan  8 11:29:14 2004
@@ -150,17 +150,26 @@
 void buffer_insert_list(spinlock_t *lock,
 			struct buffer_head *, struct list_head *);
 void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
+#ifdef CONFIG_BLOCK
 int inode_has_buffers(struct inode *);
 void invalidate_inode_buffers(struct inode *);
 int remove_inode_buffers(struct inode *inode);
-int fsync_buffers_list(spinlock_t *lock, struct list_head *);
 int sync_mapping_buffers(struct address_space *mapping);
+int sync_blockdev(struct block_device *bdev);
+#else
+static inline int inode_has_buffers(struct inode *inode) { return 0; }
+static inline void invalidate_inode_buffers(struct inode *inode) { }
+static inline int remove_inode_buffers(struct inode *inode) { return 1; }
+static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
+static inline int sync_blockdev(struct block_device *bdev) { return 0; }
+#endif
+int fsync_buffers_list(spinlock_t *lock, struct list_head *);
+
 void unmap_underlying_metadata(struct block_device *bdev, sector_t block);
 
 void mark_buffer_async_read(struct buffer_head *bh);
 void mark_buffer_async_write(struct buffer_head *bh);
 void invalidate_bdev(struct block_device *, int);
-int sync_blockdev(struct block_device *bdev);
 void __wait_on_buffer(struct buffer_head *);
 wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
 void wake_up_buffer(struct buffer_head *bh);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/fs.h linux-2.6.1-rc1-tiny1.config-block/include/linux/fs.h
--- linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/fs.h	Sun Jan  4 00:03:57 2004
+++ linux-2.6.1-rc1-tiny1.config-block/include/linux/fs.h	Thu Jan  8 11:29:14 2004
@@ -1145,7 +1145,11 @@
 extern int blkdev_put(struct block_device *, int);
 extern int bd_claim(struct block_device *, void *);
 extern void bd_release(struct block_device *);
+#ifdef CONFIG_BLOCK
 extern void blk_run_queues(void);
+#else
+static inline void blk_run_queues(void) {};
+#endif
 
 /* fs/char_dev.c */
 extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, char *);
@@ -1210,7 +1214,11 @@
 extern void sync_supers(void);
 extern void sync_filesystems(int wait);
 extern void emergency_sync(void);
+#ifdef CONFIG_bLOCK
 extern void emergency_remount(void);
+#else
+static inline void emergency_remount(void) {}
+#endif
 extern int do_remount_sb(struct super_block *sb, int flags,
 			 void *data, int force);
 extern sector_t bmap(struct inode *, sector_t);
@@ -1290,7 +1298,11 @@
 extern void file_kill(struct file *f);
 struct bio;
 extern int submit_bio(int, struct bio *);
+#ifdef CONFIG_BLOCK
 extern int bdev_read_only(struct block_device *);
+#else
+static inline int bdev_read_only(struct block_device *bdev) { return 0; }
+#endif
 extern int set_blocksize(struct block_device *, int);
 extern int sb_set_blocksize(struct super_block *, int);
 extern int sb_min_blocksize(struct super_block *, int);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/mm.h linux-2.6.1-rc1-tiny1.config-block/include/linux/mm.h
--- linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/mm.h	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.config-block/include/linux/mm.h	Thu Jan  8 11:29:14 2004
@@ -486,7 +486,11 @@
 		if (spd)
 			return (*spd)(page);
 	}
+#if CONFIG_BLOCK
 	return __set_page_dirty_buffers(page);
+#else
+	return 0;
+#endif
 }
 
 /*
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/init/Kconfig linux-2.6.1-rc1-tiny1.config-block/init/Kconfig
--- linux-2.6.1-rc1-tiny1.compile-fixes/init/Kconfig	Sun Jan  4 00:03:57 2004
+++ linux-2.6.1-rc1-tiny1.config-block/init/Kconfig	Thu Jan  8 11:29:14 2004
@@ -276,6 +276,7 @@
 	  Disabling this option will cause the kernel to be built without
 	  support for epoll family of system calls.
 
+source "drivers/block/Kconfig.embedded"
 source "drivers/block/Kconfig.iosched"
 
 config CC_OPTIMIZE_FOR_SIZE
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/init/do_mounts.c linux-2.6.1-rc1-tiny1.config-block/init/do_mounts.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/init/do_mounts.c	Sun Jan  4 00:03:57 2004
+++ linux-2.6.1-rc1-tiny1.config-block/init/do_mounts.c	Thu Jan  8 11:29:14 2004
@@ -267,6 +267,7 @@
 	return 0;
 }
 
+#ifdef CONFIG_BLOCK
 void __init mount_block_root(char *name, int flags)
 {
 	char *fs_names = __getname();
@@ -301,6 +302,7 @@
 out:
 	putname(fs_names);
 }
+#endif /* CONFIG_BLOCK */
  
 #ifdef CONFIG_ROOT_NFS
 static int __init mount_nfs_root(void)
@@ -368,8 +370,10 @@
 			change_floppy("root floppy");
 	}
 #endif
+#ifdef CONFIG_BLOCK
 	create_dev("/dev/root", ROOT_DEV, root_device_name);
 	mount_block_root("/dev/root", root_mountflags);
+#endif
 }
 
 /*
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/init/main.c linux-2.6.1-rc1-tiny1.config-block/init/main.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/init/main.c	Sun Jan  4 00:03:57 2004
+++ linux-2.6.1-rc1-tiny1.config-block/init/main.c	Thu Jan  8 11:29:14 2004
@@ -78,7 +78,6 @@
 extern void sbus_init(void);
 extern void sysctl_init(void);
 extern void signals_init(void);
-extern void buffer_init(void);
 extern void pidhash_init(void);
 extern void pidmap_init(void);
 extern void pte_chain_init(void);
@@ -89,6 +88,12 @@
 
 #ifdef CONFIG_TC
 extern void tc_init(void);
+#endif
+
+#ifdef CONFIG_BLOCK
+extern void buffer_init(void);
+#else
+static inline void buffer_init(void) {}
 #endif
 
 /*
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/kernel/exit.c linux-2.6.1-rc1-tiny1.config-block/kernel/exit.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/kernel/exit.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.config-block/kernel/exit.c	Thu Jan  8 11:29:14 2004
@@ -750,8 +750,10 @@
 		panic("Attempted to kill the idle task!");
 	if (unlikely(tsk->pid == 1))
 		panic("Attempted to kill init!");
+#ifdef CONFIG_BLOCK
 	if (tsk->io_context)
 		exit_io_context();
+#endif
 	tsk->flags |= PF_EXITING;
 	del_timer_sync(&tsk->real_timer);
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/mm/filemap.c linux-2.6.1-rc1-tiny1.config-block/mm/filemap.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/mm/filemap.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.config-block/mm/filemap.c	Thu Jan  8 11:29:14 2004
@@ -1639,7 +1639,11 @@
                 file->f_error = 0;
                 return err;
         }
-
+#ifndef CONFIG_BLOCK
+	if (unlikely(isblk)) {
+		return -EINVAL;
+	}
+#endif
 	if (!isblk) {
 		/* FIXME: this is for backwards compatibility with 2.4 */
 		if (file->f_flags & O_APPEND)
@@ -1688,7 +1692,9 @@
 
 		if (unlikely(*pos + *count > inode->i_sb->s_maxbytes))
 			*count = inode->i_sb->s_maxbytes - *pos;
-	} else {
+	} 
+#ifdef CONFIG_BLOCK
+	else {
 		loff_t isize;
 		if (bdev_read_only(inode->i_bdev))
 			return -EPERM;
@@ -1701,6 +1707,7 @@
 		if (*pos + *count > isize)
 			*count = isize - *pos;
 	}
+#endif
 	return 0;
 }
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/mm/highmem.c linux-2.6.1-rc1-tiny1.config-block/mm/highmem.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/mm/highmem.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.config-block/mm/highmem.c	Thu Jan  8 11:29:14 2004
@@ -300,6 +300,7 @@
 	}
 }
 
+#ifdef CONFIG_BLOCK
 static void bounce_end_io(struct bio *bio, mempool_t *pool)
 {
 	struct bio *bio_orig = bio->bi_private;
@@ -479,6 +480,7 @@
 }
 
 EXPORT_SYMBOL(blk_queue_bounce);
+#endif /* CONFIG_BLOCK */
 
 #if defined(HASHED_PAGE_VIRTUAL)
 
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/mm/page-writeback.c linux-2.6.1-rc1-tiny1.config-block/mm/page-writeback.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/mm/page-writeback.c	Wed Dec 17 19:59:05 2003
+++ linux-2.6.1-rc1-tiny1.config-block/mm/page-writeback.c	Thu Jan  8 11:29:14 2004
@@ -567,3 +567,37 @@
 	return 0;
 }
 EXPORT_SYMBOL(test_clear_page_dirty);
+
+/**
+ * try_to_release_page() - release old fs-specific metadata on a page
+ *
+ * @page: the page which the kernel is trying to free
+ * @gfp_mask: memory allocation flags (and I/O mode)
+ *
+ * The address_space is to try to release any data against the page
+ * (presumably at page->private).  If the release was successful, return `1'.
+ * Otherwise return zero.
+ *
+ * The @gfp_mask argument specifies whether I/O may be performed to release
+ * this page (__GFP_IO), and whether the call may block (__GFP_WAIT).
+ *
+ * NOTE: @gfp_mask may go away, and this function may become non-blocking.
+ */
+int try_to_release_page(struct page *page, int gfp_mask)
+{
+	struct address_space * const mapping = page->mapping;
+
+	if (!PageLocked(page))
+		BUG();
+	if (PageWriteback(page))
+		return 0;
+	
+	if (mapping && mapping->a_ops->releasepage)
+		return mapping->a_ops->releasepage(page, gfp_mask);
+#ifdef CONFIG_BLOCK
+	return try_to_free_buffers(page);
+#else
+	BUG();
+	return 0;
+#endif
+}
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/mm/swap.c linux-2.6.1-rc1-tiny1.config-block/mm/swap.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/mm/swap.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.config-block/mm/swap.c	Thu Jan  8 11:29:14 2004
@@ -317,6 +317,7 @@
 	pagevec_reinit(pvec);
 }
 
+#ifdef CONFIG_BLOCK
 /*
  * Try to drop buffers from the pages in a pagevec
  */
@@ -333,6 +334,7 @@
 		}
 	}
 }
+#endif /* CONFIG_BLOCK */
 
 /**
  * pagevec_lookup - gang pagecache lookup
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/mm/truncate.c linux-2.6.1-rc1-tiny1.config-block/mm/truncate.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/mm/truncate.c	Wed Dec 17 19:59:42 2003
+++ linux-2.6.1-rc1-tiny1.config-block/mm/truncate.c	Thu Jan  8 11:29:14 2004
@@ -20,9 +20,11 @@
 {
 	int (*invalidatepage)(struct page *, unsigned long);
 	invalidatepage = page->mapping->a_ops->invalidatepage;
+#ifdef CONFIG_BLOCK
 	if (invalidatepage == NULL)
 		invalidatepage = block_invalidatepage;
-	return (*invalidatepage)(page, offset);
+#endif
+	return (invalidatepage) ? (*invalidatepage)(page, offset) : 1;
 }
 
 static inline void truncate_partial_page(struct page *page, unsigned partial)
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/mm/vmscan.c linux-2.6.1-rc1-tiny1.config-block/mm/vmscan.c
--- linux-2.6.1-rc1-tiny1.compile-fixes/mm/vmscan.c	Sat Jan  3 22:09:12 2004
+++ linux-2.6.1-rc1-tiny1.config-block/mm/vmscan.c	Thu Jan  8 11:29:14 2004
@@ -704,19 +704,23 @@
 			spin_unlock_irq(&zone->lru_lock);
 			pgdeactivate += pgmoved;
 			pgmoved = 0;
+#ifdef CONFIG_BLOCK
 			if (buffer_heads_over_limit)
 				pagevec_strip(&pvec);
+#endif
 			__pagevec_release(&pvec);
 			spin_lock_irq(&zone->lru_lock);
 		}
 	}
 	zone->nr_inactive += pgmoved;
 	pgdeactivate += pgmoved;
+#ifdef CONFIG_BLOCK
 	if (buffer_heads_over_limit) {
 		spin_unlock_irq(&zone->lru_lock);
 		pagevec_strip(&pvec);
 		spin_lock_irq(&zone->lru_lock);
 	}
+#endif
 
 	pgmoved = 0;
 	while (!list_empty(&l_active)) {

[-- Attachment #4: linux-2.6.1-rc1-tiny1.config-binfmt-script.diff --]
[-- Type: text/plain, Size: 1600 bytes --]

diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.config-block/fs/Kconfig.embedded linux-2.6.1-rc1-tiny1.config-binfmt-script/fs/Kconfig.embedded
--- linux-2.6.1-rc1-tiny1.config-block/fs/Kconfig.embedded	Wed Dec 31 17:00:00 1969
+++ linux-2.6.1-rc1-tiny1.config-binfmt-script/fs/Kconfig.embedded	Thu Jan  8 11:41:24 2004
@@ -0,0 +1,6 @@
+config BINFMT_SCRIPT
+	bool "Kernel support for shell scripts" if EMBEDDED
+	default y
+	help
+	  Allow the removal of the code for executing shell scripts
+
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.config-block/fs/Makefile linux-2.6.1-rc1-tiny1.config-binfmt-script/fs/Makefile
--- linux-2.6.1-rc1-tiny1.config-block/fs/Makefile	Thu Jan  8 11:29:14 2004
+++ linux-2.6.1-rc1-tiny1.config-binfmt-script/fs/Makefile	Thu Jan  8 11:40:59 2004
@@ -24,8 +24,7 @@
 obj-$(CONFIG_BINFMT_EM86)	+= binfmt_em86.o
 obj-$(CONFIG_BINFMT_MISC)	+= binfmt_misc.o
 
-# binfmt_script is always there
-obj-y				+= binfmt_script.o
+obj-$(CONFIG_BINFMT_SCRIPT)	+= binfmt_script.o
 
 obj-$(CONFIG_BINFMT_ELF)	+= binfmt_elf.o
 obj-$(CONFIG_BINFMT_SOM)	+= binfmt_som.o
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.config-block/init/Kconfig linux-2.6.1-rc1-tiny1.config-binfmt-script/init/Kconfig
--- linux-2.6.1-rc1-tiny1.config-block/init/Kconfig	Thu Jan  8 11:29:14 2004
+++ linux-2.6.1-rc1-tiny1.config-binfmt-script/init/Kconfig	Thu Jan  8 11:42:47 2004
@@ -278,6 +278,7 @@
 
 source "drivers/block/Kconfig.embedded"
 source "drivers/block/Kconfig.iosched"
+source "fs/Kconfig.embedded"
 
 config CC_OPTIMIZE_FOR_SIZE
 	bool "Optimize for size" if EMBEDDED

[-- Attachment #5: linux-2.6.1-rc1-tiny1.reduce-aio.diff --]
[-- Type: text/plain, Size: 1817 bytes --]

diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.config-binfmt-script/fs/aio.c linux-2.6.1-rc1-tiny1.reduce-aio/fs/aio.c
--- linux-2.6.1-rc1-tiny1.config-binfmt-script/fs/aio.c	Sun Jan  4 00:03:56 2004
+++ linux-2.6.1-rc1-tiny1.reduce-aio/fs/aio.c	Thu Jan  8 12:00:28 2004
@@ -1293,46 +1293,15 @@
 	return 0;
 }
 
-asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t *ctxp)
-{
-	return -ENOSYS;
-}
-
-asmlinkage long sys_io_destroy(aio_context_t ctx)
-{
-	return -ENOSYS;
-}
-
 int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
 			 struct iocb *iocb)
 {
 	return -EINVAL;
 }
 
-asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr,
-			      struct iocb __user **iocbpp)
-{
-	return -ENOSYS;
-}
-
 struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb *iocb, u32 key)
 {
 	return 0;
-}
-
-asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb *iocb,
-			      struct io_event *result)
-{
-	return -ENOSYS;
-}
-
-asmlinkage long sys_io_getevents(aio_context_t ctx_id,
-				 long min_nr,
-				 long nr,
-				 struct io_event *events,
-				 struct timespec *timeout)
-{
-	return -ENOSYS;
 }
 
 EXPORT_SYMBOL(aio_complete);
diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.config-binfmt-script/kernel/sys.c linux-2.6.1-rc1-tiny1.reduce-aio/kernel/sys.c
--- linux-2.6.1-rc1-tiny1.config-binfmt-script/kernel/sys.c	Thu Jan  8 11:58:47 2004
+++ linux-2.6.1-rc1-tiny1.reduce-aio/kernel/sys.c	Thu Jan  8 12:00:26 2004
@@ -251,6 +251,11 @@
 cond_syscall(sys_epoll_wait)
 cond_syscall(sys_pciconfig_read)
 cond_syscall(sys_pciconfig_write)
+cond_syscall(sys_io_setup)
+cond_syscall(sys_io_destroy)
+cond_syscall(sys_io_submit)
+cond_syscall(sys_io_cancel)
+cond_syscall(sys_io_getevents)
 
 static int set_one_prio(struct task_struct *p, int niceval, int error)
 {

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-04  8:40   ` Matt Mackall
  2004-01-04 16:02     ` Eric W. Biederman
  2004-01-05  0:00     ` Eric W. Biederman
@ 2004-01-08 21:04     ` bill davidsen
  2 siblings, 0 replies; 11+ messages in thread
From: bill davidsen @ 2004-01-08 21:04 UTC (permalink / raw)
  To: linux-kernel

In article <20040104084005.GU18208@waste.org>,
Matt Mackall  <mpm@selenic.com> wrote:

| Suggestions? I'm rapidly exhausting a lot of the obvious candidates.
| My target build at the moment is ide + ext2 + proc + ipv4 + console, and
| that's currently at around 800K uncompressed, booting in a little less
| than 2.5MB. Hoping to get that under 2.

Suggestion: keep picking the low-hanging fruit a bit longer, you have
been making a lot of improvement with minimal code changes! Much appreciated!
-- 
bill davidsen <davidsen@tmr.com>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-08 19:22         ` Eric W. Biederman
@ 2004-01-09 20:15           ` Arnaldo Carvalho de Melo
  2004-01-10 21:49           ` Matt Mackall
  1 sibling, 0 replies; 11+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-01-09 20:15 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Matt Mackall, linux-kernel

Em Thu, Jan 08, 2004 at 12:22:29PM -0700, Eric W. Biederman escreveu:
> Matt Mackall <mpm@selenic.com> writes:
> 
> > On Sun, Jan 04, 2004 at 05:00:49PM -0700, Eric W. Biederman wrote:
> > > On the side of useless ugly.  But interesting in what I had to touch
> > > the following patch is a first crude stab at removing block device
> > > support from the kernel.
> > 
> > This looks good. If you can send me a version with
> > /BLOCK_DEVICE/BLOCK/, etc., I'll put it in.
> 
> Ok.  I have just had a chance to clean some things up.  Attached
> is my latest and hopefully clean set up diffs against 2.6.1-rc1-tiny1
 
> diff -uNr -X linux-ignore-files linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/fs.h linux-2.6.1-rc1-tiny1.config-block/include/linux/fs.h
> --- linux-2.6.1-rc1-tiny1.compile-fixes/include/linux/fs.h	Sun Jan  4 00:03:57 2004
> +++ linux-2.6.1-rc1-tiny1.config-block/include/linux/fs.h	Thu Jan  8 11:29:14 2004
> @@ -1210,7 +1214,11 @@
>  extern void sync_supers(void);
>  extern void sync_filesystems(int wait);
>  extern void emergency_sync(void);
> +#ifdef CONFIG_bLOCK
                 ^
                 |
                 |
                 |
                 |

oops :)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: 2.6.1-rc1-tiny1 tree for small systems
  2004-01-08 19:22         ` Eric W. Biederman
  2004-01-09 20:15           ` Arnaldo Carvalho de Melo
@ 2004-01-10 21:49           ` Matt Mackall
  1 sibling, 0 replies; 11+ messages in thread
From: Matt Mackall @ 2004-01-10 21:49 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-kernel

On Thu, Jan 08, 2004 at 12:22:29PM -0700, Eric W. Biederman wrote:
> Matt Mackall <mpm@selenic.com> writes:
> 
> > On Sun, Jan 04, 2004 at 05:00:49PM -0700, Eric W. Biederman wrote:
> > > On the side of useless ugly.  But interesting in what I had to touch
> > > the following patch is a first crude stab at removing block device
> > > support from the kernel.
> > 
> > This looks good. If you can send me a version with
> > /BLOCK_DEVICE/BLOCK/, etc., I'll put it in.
> 
> Ok.  I have just had a chance to clean some things up.  Attached
> is my latest and hopefully clean set up diffs against 2.6.1-rc1-tiny1
> 
> I am bouncing this off of linux-kernel as well since I got such good
> feedback last time.
> 
> - First the compile fixes, so I can compile test this code.

Ok, had this stuff in my last release.

> - Then the CONFIG_BLOCK patch.  

Merged with some minor tweaks in 2.6.1-tiny1.

> - Then a new patch that was sort of in my tree to make BINFMT_SCRIPT
>   configurable.

Merged.

> - And another new patch to use cond_syscall instead of explicit
>   dummies when we don't have the AIO code compiled in.

I went back and cleaned up all my syscall changes to use the
cond_syscall approach, thanks for pointing it out.

-- 
Matt Mackall : http://www.selenic.com : Linux development and consulting

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-01-10 21:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-03  3:08 2.6.1-rc1-tiny1 tree for small systems Matt Mackall
2004-01-04  7:42 ` Eric W. Biederman
2004-01-04  8:40   ` Matt Mackall
2004-01-04 16:02     ` Eric W. Biederman
2004-01-05  0:00     ` Eric W. Biederman
2004-01-05  0:34       ` viro
2004-01-05  4:34         ` Eric W. Biederman
     [not found]       ` <20040105170938.GY18208@waste.org>
2004-01-08 19:22         ` Eric W. Biederman
2004-01-09 20:15           ` Arnaldo Carvalho de Melo
2004-01-10 21:49           ` Matt Mackall
2004-01-08 21:04     ` bill davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).