Commit 4d372877 authored by Linus Torvalds's avatar Linus Torvalds

The most noticeable part of this is that the run_task_queue fix should

cure the lockup that some people have seen.

The shmfs cleanup should be unnoticeable except to users who use SAP with
huge shared memory segments, where Christoph Rohlands work not only
makes the code much more readable, it should also make it dependable..

- Christian Jullien: smc9194: proper dev_kfree_skb_irq
- Cort Dougan: new-style PowerPC Makefiles
- Andrew Morton, Petr Vandrovec: fix run_task_queue
- Christoph Rohland: shmfs for shared memory handling
parent a64eae62
...@@ -115,18 +115,18 @@ DevFS is now in the kernel. See Documentation/filesystems/devfs/* in ...@@ -115,18 +115,18 @@ DevFS is now in the kernel. See Documentation/filesystems/devfs/* in
the kernel source tree for all the gory details. the kernel source tree for all the gory details.
System V shared memory is now implemented via a virtual filesystem. System V shared memory is now implemented via a virtual filesystem.
You do not have to mount it to use it as long as you can live with the You do not have to mount it to use it. SYSV shared memory limits are
default maxima for shared memory and segments. If you wish to change set via /proc/sys/kernel/shm{max,all,mni}. You should mount the
these variables, you have to mount it with the options nr_blocks filesystem under /dev/shm to be able to use POSIX shared
and / or nr_inodes. POSIX shared memory is also now implemented via a memory. Adding the following line to /etc/fstab should take care of
virtual filesystem. If you want to use it, you'll need to mount the things:
filesystem. The recommended mount location is /dev/shm, and adding the
following line to /etc/fstab should take care of things:
none /dev/shm shm defaults 0 0 none /dev/shm shm defaults 0 0
Remember to create the directory that you intend to mount shm on if Remember to create the directory that you intend to mount shm on if
necessary. necessary (The entry is automagically created if you use devfs). You
can set limits for the number of blocks and inodes used by the
filesystem with the mount options nr_blocks and nr_inodes.
The Logical Volume Manager (LVM) is now in the kernel. If you want to The Logical Volume Manager (LVM) is now in the kernel. If you want to
use this, you'll need to install the necessary LVM toolset. use this, you'll need to install the necessary LVM toolset.
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -test13-pre2 EXTRAVERSION = -test13-pre3
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......
...@@ -7,14 +7,11 @@ ...@@ -7,14 +7,11 @@
# #
# Note 2! The CFLAGS definition is now in the main makefile... # Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := 8260_io.a O_TARGET := 8260_io.o
O_OBJS = commproc.o uart.o
ifdef CONFIG_FEC_ENET obj-y := commproc.o uart.o
O_OBJS += fcc_enet.o
endif obj-$(CONFIG_FEC_ENET) += fcc_enet.o
ifdef CONFIG_SCC_ENET obj-$(CONFIG_SCC_ENET) += enet.o
O_OBJS += enet.o
endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -7,14 +7,11 @@ ...@@ -7,14 +7,11 @@
# #
# Note 2! The CFLAGS definition is now in the main makefile... # Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := 8xx_io.a O_TARGET := 8xx_io.o
O_OBJS = commproc.o uart.o
ifdef CONFIG_FEC_ENET obj-y := commproc.o uart.o
O_OBJS += fec.o
endif obj-$(CONFIG_FEC_ENET) += fec.o
ifdef CONFIG_SCC_ENET obj-$(CONFIG_SCC_ENET) += enet.o
O_OBJS += enet.o
endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -72,12 +72,12 @@ MAKETREEBOOT = $(MAKE) -C arch/$(ARCH)/treeboot ...@@ -72,12 +72,12 @@ MAKETREEBOOT = $(MAKE) -C arch/$(ARCH)/treeboot
ifdef CONFIG_8xx ifdef CONFIG_8xx
SUBDIRS += arch/ppc/8xx_io SUBDIRS += arch/ppc/8xx_io
DRIVERS += arch/ppc/8xx_io/8xx_io.a DRIVERS += arch/ppc/8xx_io/8xx_io.o
endif endif
ifdef CONFIG_8260 ifdef CONFIG_8260
SUBDIRS += arch/ppc/8260_io SUBDIRS += arch/ppc/8260_io
DRIVERS += arch/ppc/8260_io/8260_io.a DRIVERS += arch/ppc/8260_io/8260_io.o
endif endif
ifdef CONFIG_APUS ifdef CONFIG_APUS
......
...@@ -8,13 +8,10 @@ ...@@ -8,13 +8,10 @@
# Note 2! The CFLAGS definitions are now in the main makefile... # Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := amiga.o O_TARGET := amiga.o
O_OBJS := config.o amiints.o cia.o time.o \
bootinfo.o amisound.o chipram.o
OX_OBJS := amiga_ksyms.o obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o chipram.o
export-objs := amiga_ksyms.o
ifdef CONFIG_AMIGA_PCMCIA objs-$(CONFIG_AMIGA_PCMCIA) += pcmia.o
O_OBJS := $(O_OBJS) pcmcia.o
endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -15,10 +15,6 @@ else ...@@ -15,10 +15,6 @@ else
$(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $*.o $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $*.o
endif endif
O_TARGET := kernel.o
OX_OBJS := ppc_ksyms.o setup.o
ifeq ($(CONFIG_4xx),y) ifeq ($(CONFIG_4xx),y)
KHEAD := head_4xx.o KHEAD := head_4xx.o
else else
...@@ -29,90 +25,52 @@ else ...@@ -29,90 +25,52 @@ else
endif endif
endif endif
ifdef CONFIG_ALL_PPC all: $(KHEAD) kernel.o
CONFIG_PMAC=y
CONFIG_PREP=y
CONFIG_CHRP=y
endif
O_OBJS := entry.o traps.o irq.o idle.o time.o process.o signal.o syscalls.o \
misc.o ptrace.o align.o ppc_htab.o semaphore.o bitops.o
ifdef CONFIG_POWER4
O_OBJS += xics.o
endif
ifndef CONFIG_8xx
O_OBJS += hashtable.o
endif
ifdef CONFIG_PCI
O_OBJS += pci.o pci-dma.o
endif
ifdef CONFIG_KGDB
O_OBJS += ppc-stub.o
endif
ifdef CONFIG_PMAC_PBOOK
O_OBJS += sleep.o
endif
ifdef CONFIG_SMP
O_OBJS += smp.o
endif
ifeq ($(CONFIG_4xx),y)
O_OBJS += ppc4xx_pic.o
endif
ifeq ($(CONFIG_OAK),y) O_TARGET := kernel.o
O_OBJS += oak_setup.o
endif
export-objs := ppc_ksyms.o prep_setup.o
obj-$(CONFIG_PPC) := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o bitops.o ptrace.o \
ppc_htab.o semaphore.o syscalls.o \
align.o setup.o
obj-$(CONFIG_POWER4) += xics.o
obj-$(CONFIG_PCI) += pci.o pci-dma.o
obj-$(CONFIG_KGDB) += ppc-stub.o
obj-$(CONFIG_PMAC_PBOOK) += sleep.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o
obj-$(CONFIG_NVRAM) += pmac_nvram.o
obj-$(CONFIG_PREP_RESIDUAL) += residual.o
obj-$(CONFIG_4xx) += ppc4xx_pic.o
obj-$(CONFIG_OAK) += oak_setup.o
obj-$(CONFIG_WALNUT) += walnut_setup.o
ifeq ($(CONFIG_WALNUT),y) ifeq ($(CONFIG_WALNUT),y)
O_OBJS += walnut_setup.o obj-$(CONFIG_PCI) += galaxy_pci.o
ifeq ($(CONFIG_PCI),y)
O_OBJS += galaxy_pci.o
endif
endif endif
obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o
ifeq ($(CONFIG_8xx),y) ifeq ($(CONFIG_8xx),y)
O_OBJS += m8xx_setup.o ppc8xx_pic.o obj-$(CONFIG_PCI) += qspan_pci.c
ifndef CONFIG_MATH_EMULATION else
O_OBJS += softemu8xx.o obj-$(CONFIG_PPC) += hashtable.o
endif endif
ifdef CONFIG_PCI obj-$(CONFIG_MATH_EMULATION) += softemu8xx.o
O_OBJS += qspan_pci.c obj-$(CONFIG_MBX) += i8259.o
endif obj-$(CONFIG_APUS) += apus_setup.o
ifdef CONFIG_MBX obj-$(CONFIG_ALL_PPC) += pmac_pic.o pmac_setup.o pmac_time.o prom.o \
O_OBJS += i8259.o feature.o pmac_pci.o chrp_setup.o \
endif chrp_time.o chrp_pci.o open_pic.o \
endif indirect_pci.o i8259.o prep_pci.o \
prep_time.o prep_nvram.o ppc_ksyms.o \
prep_setup.o
obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o
obj-$(CONFIG_GEMINI) += gemini_prom.o gemini_pci.o gemini_setup.o \
open_pic.o
obj-$(CONFIG_8260) += m8260_setup.o ppc8260_pic.o
ifeq ($(CONFIG_NVRAM),y)
O_OBJS += pmac_nvram.o
endif
ifeq ($(CONFIG_APUS),y)
O_OBJS += apus_setup.o
endif
ifeq ($(CONFIG_ALL_PPC),y)
O_OBJS += pmac_pic.o pmac_setup.o pmac_time.o feature.o pmac_pci.o prom.o \
chrp_setup.o chrp_time.o chrp_pci.o open_pic.o indirect_pci.o \
prep_pci.o i8259.o prep_nvram.o prep_time.o residual.o
ifeq ($(CONFIG_PMAC_BACKLIGHT),y)
O_OBJS += pmac_backlight.o
endif
OX_OBJS += prep_setup.o
endif
ifeq ($(CONFIG_GEMINI),y)
O_OBJS += gemini_prom.o gemini_pci.o gemini_setup.o open_pic.o
endif
ifeq ($(CONFIG_8260),y)
O_OBJS += m8260_setup.o ppc8260_pic.o
endif
all: $(KHEAD) kernel.o include $(TOPDIR)/Rules.make
head.o: head.S ppc_defs.h head.o: head.S ppc_defs.h
head_4xx.o: head_4xx.S ppc_defs.h head_4xx.o: head_4xx.S ppc_defs.h
...@@ -137,4 +95,3 @@ checks: checks.c ...@@ -137,4 +95,3 @@ checks: checks.c
$(HOSTCC) -I$(HPATH) $(HOSTCFLAGS) -D__KERNEL__ -fno-builtin -o checks checks.c $(HOSTCC) -I$(HPATH) $(HOSTCFLAGS) -D__KERNEL__ -fno-builtin -o checks checks.c
./checks ./checks
include $(TOPDIR)/Rules.make
...@@ -5,12 +5,10 @@ ...@@ -5,12 +5,10 @@
.S.o: .S.o:
$(CC) $(AFLAGS) -c $< -o $*.o $(CC) $(AFLAGS) -c $< -o $*.o
O_TARGET = lib.o O_TARGET := lib.o
O_OBJS = checksum.o string.o strcase.o
ifdef CONFIG_SMP obj-y := checksum.o string.o strcase.o
O_OBJS += locks.o
endif
obj-$(CONFIG_SMP) := locks.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
# #
# #
O_TARGET := math-emu.o O_TARGET := math-emu.o
O_OBJS := math.o fmr.o lfd.o stfd.o obj-y := math.o fmr.o lfd.o stfd.o
ifdef CONFIG_MATH_EMULATION obj-$(CONFIG_MATH_EMULATION) += fabs.o fadd.o fadds.o fcmpo.o fcmpu.o \
O_OBJS += fabs.o fadd.o fadds.o fcmpo.o fcmpu.o fctiw.o fctiwz.o \ fctiw.o fctiwz.o fdiv.o fdivs.o \
fdiv.o fdivs.o fmadd.o fmadds.o fmsub.o fmsubs.o \ fmadd.o fmadds.o fmsub.o fmsubs.o \
fmul.o fmuls.o fnabs.o fneg.o fnmadd.o fnmadds.o \ fmul.o fmuls.o fnabs.o fneg.o types.o \
fnmsub.o fnmsubs.o fres.o frsp.o frsqrte.o fsel.o \ fnmadd.o fnmadds.o fnmsub.o fnmsubs.o \
fsqrt.o fsqrts.o fsub.o fsubs.o lfs.o \ fres.o frsp.o frsqrte.o fsel.o lfs.o \
mcrfs.o mffs.o mtfsb0.o mtfsb1.o mtfsf.o mtfsfi.o \ fsqrt.o fsqrts.o fsub.o fsubs.o \
stfiwx.o stfs.o udivmodti4.o types.o mcrfs.o mffs.o mtfsb0.o mtfsb1.o \
endif mtfsf.o mtfsfi.o stfiwx.o stfs.o \
udivmodti4.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -7,11 +7,9 @@ ...@@ -7,11 +7,9 @@
# #
# Note 2! The CFLAGS definition is now in the main makefile... # Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := mm.o O_TARGET := mm.o
O_OBJS = fault.o init.o mem_pieces.o extable.o obj-y := fault.o init.o mem_pieces.o extable.o
ifeq ($(CONFIG_4xx),y) obj-$(CONFIG_4xx) += 4xx_tlb.o
O_OBJS += 4xx_tlb.o
endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
# Makefile for xmon # Makefile for xmon
O_TARGET = x.o O_TARGET := x.o
ifeq ($(CONFIG_8xx),y) ifeq ($(CONFIG_8xx),y)
O_OBJS = start_8xx.o xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o obj-y := start_8xx.o xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
else else
O_OBJS = start.o xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o obj-y := start.o xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
endif endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -438,7 +438,7 @@ static ssize_t read_zero(struct file * file, char * buf, ...@@ -438,7 +438,7 @@ static ssize_t read_zero(struct file * file, char * buf,
static int mmap_zero(struct file * file, struct vm_area_struct * vma) static int mmap_zero(struct file * file, struct vm_area_struct * vma)
{ {
if (vma->vm_flags & VM_SHARED) if (vma->vm_flags & VM_SHARED)
return map_zero_setup(vma); return shmem_zero_setup(vma);
if (zeromap_page_range(vma->vm_start, vma->vm_end - vma->vm_start, vma->vm_page_prot)) if (zeromap_page_range(vma->vm_start, vma->vm_end - vma->vm_start, vma->vm_page_prot))
return -EAGAIN; return -EAGAIN;
return 0; return 0;
......
...@@ -95,7 +95,7 @@ if [ "$CONFIG_ISDN_DRV_EICON" != "n" ]; then ...@@ -95,7 +95,7 @@ if [ "$CONFIG_ISDN_DRV_EICON" != "n" ]; then
dep_bool ' Eicon PCI DIVA Server BRI/PRI/4BRI support' CONFIG_ISDN_DRV_EICON_PCI $CONFIG_PCI dep_bool ' Eicon PCI DIVA Server BRI/PRI/4BRI support' CONFIG_ISDN_DRV_EICON_PCI $CONFIG_PCI
bool ' Eicon S,SX,SCOM,Quadro,S2M support' CONFIG_ISDN_DRV_EICON_ISA bool ' Eicon S,SX,SCOM,Quadro,S2M support' CONFIG_ISDN_DRV_EICON_ISA
fi fi
dep_tristate ' Build Eicon driver type standalone' CONFIG_ISDN_DRV_EICON_DIVAS tristate ' Build Eicon driver type standalone' CONFIG_ISDN_DRV_EICON_DIVAS
fi fi
# CAPI subsystem # CAPI subsystem
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# The target object and module list name. # The target object and module list name.
O_TARGET := sc_drv O_TARGET := sc_drv.o
# Objects that export symbols. # Objects that export symbols.
......
...@@ -8,6 +8,8 @@ obj-m := ...@@ -8,6 +8,8 @@ obj-m :=
obj-n := obj-n :=
obj- := obj- :=
mod-subdirs := wan
O_TARGET := net.o O_TARGET := net.o
# All of the (potential) objects that export symbols. # All of the (potential) objects that export symbols.
......
...@@ -50,10 +50,11 @@ ...@@ -50,10 +50,11 @@
. 04/14/00 Heiko Pruessing (SMA Regelsysteme) Fixed bug in chip memory . 04/14/00 Heiko Pruessing (SMA Regelsysteme) Fixed bug in chip memory
. allocation . allocation
. 08/20/00 Arnaldo Melo fix kfree(skb) in smc_hardware_send_packet . 08/20/00 Arnaldo Melo fix kfree(skb) in smc_hardware_send_packet
. 12/15/00 Christian Jullien fix "Warning: kfree_skb on hard IRQ"
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/
static const char *version = static const char *version =
"smc9194.c:v0.13 04/14/00 by Erik Stahlman (erik@vt.edu)\n"; "smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)\n";
#include <linux/module.h> #include <linux/module.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -615,7 +616,7 @@ static void smc_hardware_send_packet( struct net_device * dev ) ...@@ -615,7 +616,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
if ( packet_no & 0x80 ) { if ( packet_no & 0x80 ) {
/* or isn't there? BAD CHIP! */ /* or isn't there? BAD CHIP! */
printk(KERN_DEBUG CARDNAME": Memory allocation failed. \n"); printk(KERN_DEBUG CARDNAME": Memory allocation failed. \n");
dev_kfree_skb(skb); dev_kfree_skb_irq(skb);
lp->saved_skb = NULL; lp->saved_skb = NULL;
netif_wake_queue(dev); netif_wake_queue(dev);
return; return;
...@@ -678,7 +679,7 @@ static void smc_hardware_send_packet( struct net_device * dev ) ...@@ -678,7 +679,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
PRINTK2((CARDNAME": Sent packet of length %d \n",length)); PRINTK2((CARDNAME": Sent packet of length %d \n",length));
lp->saved_skb = NULL; lp->saved_skb = NULL;
dev_kfree_skb (skb); dev_kfree_skb_irq (skb);
dev->trans_start = jiffies; dev->trans_start = jiffies;
......
...@@ -1693,6 +1693,9 @@ int block_read_full_page(struct page *page, get_block_t *get_block) ...@@ -1693,6 +1693,9 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
set_bit(BH_Uptodate, &bh->b_state); set_bit(BH_Uptodate, &bh->b_state);
continue; continue;
} }
/* get_block() might have updated the buffer synchronously */
if (buffer_uptodate(bh))
continue;
} }
arr[nr] = bh; arr[nr] = bh;
......
...@@ -312,7 +312,6 @@ lockd_down(void) ...@@ -312,7 +312,6 @@ lockd_down(void)
#ifdef MODULE #ifdef MODULE
/* New module support in 2.1.18 */ /* New module support in 2.1.18 */
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>"); MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>");
MODULE_DESCRIPTION("NFS file locking service version " LOCKD_VERSION "."); MODULE_DESCRIPTION("NFS file locking service version " LOCKD_VERSION ".");
MODULE_PARM(nlm_grace_period, "10-240l"); MODULE_PARM(nlm_grace_period, "10-240l");
......
...@@ -963,8 +963,10 @@ static void __exit exit_ntfs_fs(void) ...@@ -963,8 +963,10 @@ static void __exit exit_ntfs_fs(void)
EXPORT_NO_SYMBOLS; EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Martin von Lwis"); MODULE_AUTHOR("Martin von Lwis");
MODULE_DESCRIPTION("NTFS driver"); MODULE_DESCRIPTION("NTFS driver");
#ifdef DEBUG
MODULE_PARM(ntdebug, "i"); MODULE_PARM(ntdebug, "i");
MODULE_PARM_DESC(ntdebug, "Debug level"); MODULE_PARM_DESC(ntdebug, "Debug level");
#endif
module_init(init_ntfs_fs) module_init(init_ntfs_fs)
module_exit(exit_ntfs_fs) module_exit(exit_ntfs_fs)
......
torvalds@penguin
\ No newline at end of file
...@@ -283,6 +283,7 @@ extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long ...@@ -283,6 +283,7 @@ extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long
#include <linux/efs_fs_i.h> #include <linux/efs_fs_i.h>
#include <linux/coda_fs_i.h> #include <linux/coda_fs_i.h>
#include <linux/romfs_fs_i.h> #include <linux/romfs_fs_i.h>
#include <linux/shmem_fs.h>
#include <linux/smb_fs_i.h> #include <linux/smb_fs_i.h>
#include <linux/hfs_fs_i.h> #include <linux/hfs_fs_i.h>
#include <linux/adfs_fs_i.h> #include <linux/adfs_fs_i.h>
...@@ -441,6 +442,7 @@ struct inode { ...@@ -441,6 +442,7 @@ struct inode {
struct ufs_inode_info ufs_i; struct ufs_inode_info ufs_i;
struct efs_inode_info efs_i; struct efs_inode_info efs_i;
struct romfs_inode_info romfs_i; struct romfs_inode_info romfs_i;
struct shmem_inode_info shmem_i;
struct coda_inode_info coda_i; struct coda_inode_info coda_i;
struct smb_inode_info smbfs_i; struct smb_inode_info smbfs_i;
struct hfs_inode_info hfs_i; struct hfs_inode_info hfs_i;
...@@ -685,6 +687,7 @@ struct super_block { ...@@ -685,6 +687,7 @@ struct super_block {
struct affs_sb_info affs_sb; struct affs_sb_info affs_sb;
struct ufs_sb_info ufs_sb; struct ufs_sb_info ufs_sb;
struct efs_sb_info efs_sb; struct efs_sb_info efs_sb;
struct shmem_sb_info shmem_sb;
struct romfs_sb_info romfs_sb; struct romfs_sb_info romfs_sb;
struct smb_sb_info smbfs_sb; struct smb_sb_info smbfs_sb;
struct hfs_sb_info hfs_sb; struct hfs_sb_info hfs_sb;
......
...@@ -128,15 +128,6 @@ struct vm_operations_struct { ...@@ -128,15 +128,6 @@ struct vm_operations_struct {
int (*swapout)(struct page *, struct file *); int (*swapout)(struct page *, struct file *);
}; };
/*
* A swap entry has to fit into a "unsigned long", as
* the entry is hidden in the "index" field of the
* swapper address space.
*/
typedef struct {
unsigned long val;
} swp_entry_t;
/* /*
* Try to keep the most commonly accessed fields in single cache lines * Try to keep the most commonly accessed fields in single cache lines
* here (16 bytes or greater). This ordering should be particularly * here (16 bytes or greater). This ordering should be particularly
...@@ -390,7 +381,10 @@ extern void show_free_areas_node(pg_data_t *pgdat); ...@@ -390,7 +381,10 @@ extern void show_free_areas_node(pg_data_t *pgdat);
extern void clear_page_tables(struct mm_struct *, unsigned long, int); extern void clear_page_tables(struct mm_struct *, unsigned long, int);
extern int map_zero_setup(struct vm_area_struct *); int shmem_swapout(struct page * page, struct file *file);
struct page * shmem_nopage(struct vm_area_struct * vma, unsigned long address, int no_share);
struct file *shmem_file_setup(char * name, loff_t size);
extern int shmem_zero_setup(struct vm_area_struct *);
extern void zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size); extern void zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size);
extern int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma); extern int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma);
......
...@@ -67,6 +67,8 @@ extern inline unsigned long _page_hashfn(struct address_space * mapping, unsigne ...@@ -67,6 +67,8 @@ extern inline unsigned long _page_hashfn(struct address_space * mapping, unsigne
#define page_hash(mapping,index) (page_hash_table+_page_hashfn(mapping,index)) #define page_hash(mapping,index) (page_hash_table+_page_hashfn(mapping,index))
extern struct page * __find_get_page(struct address_space *mapping,
unsigned long offset, struct page **hash);
extern struct page * __find_lock_page (struct address_space * mapping, extern struct page * __find_lock_page (struct address_space * mapping,
unsigned long index, struct page **hash); unsigned long index, struct page **hash);
extern void lock_page(struct page *page); extern void lock_page(struct page *page);
......
#ifndef __SHMEM_FS_H
#define __SHMEM_FS_H
/* inode in-kernel data */
#define SHMEM_NR_DIRECT 16
/*
* A swap entry has to fit into a "unsigned long", as
* the entry is hidden in the "index" field of the
* swapper address space.
*
* We have to move it here, since not every user of fs.h is including
* mm.h, but m.h is including fs.h via sched .h :-/
*/
typedef struct {
unsigned long val;
} swp_entry_t;
struct shmem_inode_info {
spinlock_t lock;
swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* for the first blocks */
swp_entry_t **i_indirect; /* doubly indirect blocks */
unsigned long swapped;
int locked; /* into memory */
struct list_head list;
};
struct shmem_sb_info {
unsigned long max_blocks; /* How many blocks are allowed */
unsigned long free_blocks; /* How many are left for allocation */
unsigned long max_inodes; /* How many inodes are allowed */
unsigned long free_inodes; /* How many are left for allocation */
spinlock_t stat_lock;
};
#endif
...@@ -291,6 +291,8 @@ extern spinlock_t swaplock; ...@@ -291,6 +291,8 @@ extern spinlock_t swaplock;
#define swap_device_lock(p) spin_lock(&p->sdev_lock) #define swap_device_lock(p) spin_lock(&p->sdev_lock)
#define swap_device_unlock(p) spin_unlock(&p->sdev_lock) #define swap_device_unlock(p) spin_unlock(&p->sdev_lock)
extern void shmem_unuse(swp_entry_t entry, struct page *page);
#endif /* __KERNEL__*/ #endif /* __KERNEL__*/
#endif /* _LINUX_SWAP_H */ #endif /* _LINUX_SWAP_H */
...@@ -53,22 +53,22 @@ extern task_queue tq_timer, tq_immediate, tq_disk; ...@@ -53,22 +53,22 @@ extern task_queue tq_timer, tq_immediate, tq_disk;
* To implement your own list of active bottom halfs, use the following * To implement your own list of active bottom halfs, use the following
* two definitions: * two definitions:
* *
* DECLARE_TASK_QUEUE(my_bh); * DECLARE_TASK_QUEUE(my_tqueue);
* struct tq_struct run_my_bh = { * struct tq_struct my_task = {
* routine: (void (*)(void *)) run_task_queue, * routine: (void (*)(void *)) my_routine,
* data: &my_bh * data: &my_data
* }; * };
* *
* To activate a bottom half on your list, use: * To activate a bottom half on a list, use:
* *
* queue_task(tq_pointer, &my_bh); * queue_task(&my_task, &my_tqueue);
* *
* To run the bottom halfs on your list put them on the immediate list by: * To later run the queued tasks use
* *
* queue_task(&run_my_bh, &tq_immediate); * run_task_queue(&my_tqueue);
* *
* This allows you to do deferred procession. For example, you could * This allows you to do deferred processing. For example, you could
* have a bottom half list tq_timer, which is marked active by the timer * have a task queue called tq_timer, which is executed within the timer
* interrupt. * interrupt.
*/ */
...@@ -78,8 +78,7 @@ extern spinlock_t tqueue_lock; ...@@ -78,8 +78,7 @@ extern spinlock_t tqueue_lock;
* Queue a task on a tq. Return non-zero if it was successfully * Queue a task on a tq. Return non-zero if it was successfully
* added. * added.
*/ */
static inline int queue_task(struct tq_struct *bh_pointer, static inline int queue_task(struct tq_struct *bh_pointer, task_queue *bh_list)
task_queue *bh_list)
{ {
int ret = 0; int ret = 0;
if (!test_and_set_bit(0,&bh_pointer->sync)) { if (!test_and_set_bit(0,&bh_pointer->sync)) {
...@@ -95,32 +94,13 @@ static inline int queue_task(struct tq_struct *bh_pointer, ...@@ -95,32 +94,13 @@ static inline int queue_task(struct tq_struct *bh_pointer,
/* /*
* Call all "bottom halfs" on a given list. * Call all "bottom halfs" on a given list.
*/ */
static inline void run_task_queue(task_queue *list)
{
while (!list_empty(list)) {
unsigned long flags;
struct list_head *next;
spin_lock_irqsave(&tqueue_lock, flags);
next = list->next;
if (next != list) {
void *arg;
void (*f) (void *);
struct tq_struct *p;
list_del(next); extern void __run_task_queue(task_queue *list);
p = list_entry(next, struct tq_struct, list);
arg = p->data;
f = p->routine;
p->sync = 0;
spin_unlock_irqrestore(&tqueue_lock, flags);
if (f) static inline void run_task_queue(task_queue *list)
f(arg); {
continue; if (TQ_ACTIVE(*list))
} __run_task_queue(list);
spin_unlock_irqrestore(&tqueue_lock, flags);
}
} }
#endif /* _LINUX_TQUEUE_H */ #endif /* _LINUX_TQUEUE_H */
This diff is collapsed.
...@@ -345,11 +345,6 @@ void sem_exit (void) ...@@ -345,11 +345,6 @@ void sem_exit (void)
return; return;
} }
int shm_swap (int prio, int gfp_mask)
{
return 0;
}
asmlinkage long sys_semget (key_t key, int nsems, int semflg) asmlinkage long sys_semget (key_t key, int nsems, int semflg)
{ {
return -ENOSYS; return -ENOSYS;
...@@ -406,13 +401,4 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf) ...@@ -406,13 +401,4 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
return -ENOSYS; return -ENOSYS;
} }
void shm_unuse(swp_entry_t entry, struct page *page)
{
}
int map_zero_setup(struct vm_area_struct *vma)
{
return -EINVAL;
}
#endif /* CONFIG_SYSVIPC */ #endif /* CONFIG_SYSVIPC */
...@@ -524,6 +524,7 @@ EXPORT_SYMBOL(init_bh); ...@@ -524,6 +524,7 @@ EXPORT_SYMBOL(init_bh);
EXPORT_SYMBOL(remove_bh); EXPORT_SYMBOL(remove_bh);
EXPORT_SYMBOL(tasklet_init); EXPORT_SYMBOL(tasklet_init);
EXPORT_SYMBOL(tasklet_kill); EXPORT_SYMBOL(tasklet_kill);
EXPORT_SYMBOL(__run_task_queue);
/* init task, for moving kthread roots - ought to export a function ?? */ /* init task, for moving kthread roots - ought to export a function ?? */
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/tqueue.h>
/* /*
- No shared variables, all the data are CPU local. - No shared variables, all the data are CPU local.
...@@ -288,4 +289,28 @@ void __init softirq_init() ...@@ -288,4 +289,28 @@ void __init softirq_init()
open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL); open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL);
} }
void __run_task_queue(task_queue *list)
{
struct list_head head, *next;
unsigned long flags;
spin_lock_irqsave(&tqueue_lock, flags);
list_add(&head, list);
list_del_init(list);
spin_unlock_irqrestore(&tqueue_lock, flags);
next = head.next;
while (next != &head) {
void (*f) (void *);
struct tq_struct *p;
p = list_entry(next, struct tq_struct, list);
next = next->next;
/* Debug: force an oops from people who delete entries */
next->prev->next = next->prev->prev = 0;
f = p->routine;
p->sync = 0;
if (f)
f(p->data);
}
}
...@@ -63,6 +63,8 @@ extern int sg_big_buff; ...@@ -63,6 +63,8 @@ extern int sg_big_buff;
#endif #endif
#ifdef CONFIG_SYSVIPC #ifdef CONFIG_SYSVIPC
extern size_t shm_ctlmax; extern size_t shm_ctlmax;
extern size_t shm_ctlall;
extern int shm_ctlmni;
extern int msg_ctlmax; extern int msg_ctlmax;
extern int msg_ctlmnb; extern int msg_ctlmnb;
extern int msg_ctlmni; extern int msg_ctlmni;
...@@ -208,6 +210,10 @@ static ctl_table kern_table[] = { ...@@ -208,6 +210,10 @@ static ctl_table kern_table[] = {
#ifdef CONFIG_SYSVIPC #ifdef CONFIG_SYSVIPC
{KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t), {KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t),
0644, NULL, &proc_doulongvec_minmax}, 0644, NULL, &proc_doulongvec_minmax},
{KERN_SHMALL, "shmall", &shm_ctlall, sizeof (size_t),
0644, NULL, &proc_doulongvec_minmax},
{KERN_SHMMNI, "shmmni", &shm_ctlmni, sizeof (int),
0644, NULL, &proc_dointvec},
{KERN_MSGMAX, "msgmax", &msg_ctlmax, sizeof (int), {KERN_MSGMAX, "msgmax", &msg_ctlmax, sizeof (int),
0644, NULL, &proc_dointvec}, 0644, NULL, &proc_dointvec},
{KERN_MSGMNI, "msgmni", &msg_ctlmni, sizeof (int), {KERN_MSGMNI, "msgmni", &msg_ctlmni, sizeof (int),
......
...@@ -11,7 +11,8 @@ O_TARGET := mm.o ...@@ -11,7 +11,8 @@ O_TARGET := mm.o
obj-y := memory.o mmap.o filemap.o mprotect.o mlock.o mremap.o \ obj-y := memory.o mmap.o filemap.o mprotect.o mlock.o mremap.o \
vmalloc.o slab.o bootmem.o swap.o vmscan.o page_io.o \ vmalloc.o slab.o bootmem.o swap.o vmscan.o page_io.o \
page_alloc.o swap_state.o swapfile.o numa.o oom_kill.o page_alloc.o swap_state.o swapfile.o numa.o oom_kill.o \
shmem.o
obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_HIGHMEM) += highmem.o
......
...@@ -542,8 +542,8 @@ void lock_page(struct page *page) ...@@ -542,8 +542,8 @@ void lock_page(struct page *page)
* a rather lightweight function, finding and getting a reference to a * a rather lightweight function, finding and getting a reference to a
* hashed page atomically, waiting for it if it's locked. * hashed page atomically, waiting for it if it's locked.
*/ */
static struct page * __find_get_page(struct address_space *mapping, struct page * __find_get_page(struct address_space *mapping,
unsigned long offset, struct page **hash) unsigned long offset, struct page **hash)
{ {
struct page *page; struct page *page;
......
...@@ -333,7 +333,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, unsigned lon ...@@ -333,7 +333,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, unsigned lon
if (error) if (error)
goto unmap_and_free_vma; goto unmap_and_free_vma;
} else if (flags & MAP_SHARED) { } else if (flags & MAP_SHARED) {
error = map_zero_setup(vma); error = shmem_zero_setup(vma);
if (error) if (error)
goto free_vma; goto free_vma;
} }
......
This diff is collapsed.
...@@ -375,7 +375,7 @@ static int try_to_unuse(unsigned int type) ...@@ -375,7 +375,7 @@ static int try_to_unuse(unsigned int type)
for_each_task(p) for_each_task(p)
unuse_process(p->mm, entry, page); unuse_process(p->mm, entry, page);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
shm_unuse(entry, page); shmem_unuse(entry, page);
/* Now get rid of the extra reference to the temporary /* Now get rid of the extra reference to the temporary
page we've been using. */ page we've been using. */
page_cache_release(page); page_cache_release(page);
......
...@@ -603,6 +603,8 @@ int page_launder(int gfp_mask, int sync) ...@@ -603,6 +603,8 @@ int page_launder(int gfp_mask, int sync)
*/ */
if (PageDirty(page)) { if (PageDirty(page)) {
int (*writepage)(struct page *) = page->mapping->a_ops->writepage; int (*writepage)(struct page *) = page->mapping->a_ops->writepage;
int result;
if (!writepage) if (!writepage)
goto page_active; goto page_active;
...@@ -619,12 +621,16 @@ int page_launder(int gfp_mask, int sync) ...@@ -619,12 +621,16 @@ int page_launder(int gfp_mask, int sync)
page_cache_get(page); page_cache_get(page);
spin_unlock(&pagemap_lru_lock); spin_unlock(&pagemap_lru_lock);
writepage(page); result = writepage(page);
page_cache_release(page); page_cache_release(page);
/* And re-start the thing.. */ /* And re-start the thing.. */
spin_lock(&pagemap_lru_lock); spin_lock(&pagemap_lru_lock);
continue; if (result != 1)
continue;
/* writepage refused to do anything */
SetPageDirty(page);
goto page_active;
} }
/* /*
......
...@@ -14,15 +14,38 @@ export-objs = ip_conntrack_standalone.o ip_conntrack_ftp.o ip_fw_compat.o ip_nat ...@@ -14,15 +14,38 @@ export-objs = ip_conntrack_standalone.o ip_conntrack_ftp.o ip_fw_compat.o ip_nat
# Multipart objects. # Multipart objects.
list-multi := ip_conntrack.o iptable_nat.o ipfwadm.o ipchains.o list-multi := ip_conntrack.o iptable_nat.o ipfwadm.o ipchains.o
ip_conntrack-objs := ip_conntrack_standalone.o ip_conntrack_core.o ip_conntrack_proto_generic.o ip_conntrack_proto_tcp.o ip_conntrack_proto_udp.o ip_conntrack_proto_icmp.o # objects for the conntrack and NAT core (used by standalone and backw. compat)
iptable_nat-objs := ip_nat_standalone.o ip_nat_rule.o ip_nat_core.o ip_nat_proto_unknown.o ip_nat_proto_tcp.o ip_nat_proto_udp.o ip_nat_proto_icmp.o ip_nf_conntrack-objs := ip_conntrack_core.o ip_conntrack_proto_generic.o ip_conntrack_proto_tcp.o ip_conntrack_proto_udp.o ip_conntrack_proto_icmp.o
ip_nf_compat-objs := ipfwadm_core.o ip_fw_compat.o ip_fw_compat_redir.o ip_fw_compat_masq.o $(ip_conntrack-objs) $(iptable_nat-objs) ip_nf_nat-objs := ip_nat_core.o ip_nat_proto_unknown.o ip_nat_proto_tcp.o ip_nat_proto_udp.o ip_nat_proto_icmp.o
ipfwadm-objs := ipfwadm_core.o
ipchains-objs := ipchains_core.o
# objects for the standalone - connection tracking / NAT
ip_conntrack-objs := ip_conntrack_standalone.o $(ip_nf_conntrack-objs)
iptable_nat-objs := ip_nat_standalone.o ip_nat_rule.o $(ip_nf_nat-objs)
# objects for backwards compatibility mode
ip_nf_compat-objs := ip_fw_compat.o ip_fw_compat_redir.o ip_fw_compat_masq.o $(ip_nf_conntrack-objs) $(ip_nf_nat-objs)
ipfwadm-objs := $(ip_nf_compat-objs) ipfwadm_core.o
ipchains-objs := $(ip_nf_compat-objs) ipchains_core.o
# connection tracking
obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
# connection tracking helpers
obj-$(CONFIG_IP_NF_FTP) += ip_conntrack_ftp.o obj-$(CONFIG_IP_NF_FTP) += ip_conntrack_ftp.o
# NAT helpers
obj-$(CONFIG_IP_NF_FTP) += ip_nat_ftp.o
# generic IP tables
obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o
# the three instances of ip_tables
obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o
obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o
obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o
# matches
obj-$(CONFIG_IP_NF_MATCH_LIMIT) += ipt_limit.o obj-$(CONFIG_IP_NF_MATCH_LIMIT) += ipt_limit.o
obj-$(CONFIG_IP_NF_MATCH_MARK) += ipt_mark.o obj-$(CONFIG_IP_NF_MATCH_MARK) += ipt_mark.o
obj-$(CONFIG_IP_NF_MATCH_MAC) += ipt_mac.o obj-$(CONFIG_IP_NF_MATCH_MAC) += ipt_mac.o
...@@ -31,11 +54,8 @@ obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o ...@@ -31,11 +54,8 @@ obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o
obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o
obj-$(CONFIG_IP_NF_FTP) += ip_nat_ftp.o
obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o
obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o
# targets
obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
obj-$(CONFIG_IP_NF_TARGET_MIRROR) += ipt_MIRROR.o obj-$(CONFIG_IP_NF_TARGET_MIRROR) += ipt_MIRROR.o
obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
...@@ -44,8 +64,10 @@ obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o ...@@ -44,8 +64,10 @@ obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
obj-$(CONFIG_IP_NF_COMPAT_IPCHAINS) += ipchains.o ip_nf_compat.o # backwards compatibility
obj-$(CONFIG_IP_NF_COMPAT_IPFWADM) += ipfwadm.o ip_nf_compat.o obj-$(CONFIG_IP_NF_COMPAT_IPCHAINS) += ipchains.o
obj-$(CONFIG_IP_NF_COMPAT_IPFWADM) += ipfwadm.o
obj-$(CONFIG_IP_NF_QUEUE) += ip_queue.o obj-$(CONFIG_IP_NF_QUEUE) += ip_queue.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -61,6 +83,3 @@ ipfwadm.o: $(ipfwadm-objs) ...@@ -61,6 +83,3 @@ ipfwadm.o: $(ipfwadm-objs)
ipchains.o: $(ipchains-objs) ipchains.o: $(ipchains-objs)
$(LD) -r -o $@ $(ipchains-objs) $(LD) -r -o $@ $(ipchains-objs)
ip_nf_compat.o: $(ip_nf_compat-objs)
$(LD) -r -o $@ $(ip_nf_compat-objs)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment