Commit 62a62049 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://ppc.bkbits.net/for-linus-ppc

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 67fa9ad1 4ee819e6
......@@ -18,7 +18,7 @@ export-objs := mca.o mtrr.o msr.o cpuid.o microcode.o i386_ksyms.o time.o
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
i386_ksyms.o i387.o bluesmoke.o dmi_scan.o \
pci-dma.o i386_ksyms.o i387.o bluesmoke.o dmi_scan.o \
bootflag.o
obj-$(CONFIG_MCA) += mca.o
......
O_TARGET := pci.o
obj-y := dma.o i386.o
obj-y := i386.o
ifdef CONFIG_VISWS
obj-y += visws.o
......
......@@ -192,8 +192,7 @@ asmlinkage int sunos_brk(unsigned long brk)
* simple, it hopefully works in most obvious cases.. Easy to
* fool it, but this should catch most mistakes.
*/
freepages = atomic_read(&buffermem_pages) >> PAGE_SHIFT;
freepages += get_page_cache_size();
freepages = get_page_cache_size();
freepages >>= 1;
freepages += nr_free_pages();
freepages += nr_swap_pages;
......
# $Id: Makefile,v 1.70 2002/02/09 19:49:30 davem Exp $
# Makefile for the linux kernel.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
SH = $(CONFIG_SHELL)
.S.s:
$(CPP) $(AFLAGS) -ansi $< -o $*.s
.S.o:
$(CC) $(AFLAGS) -ansi -c $< -o $*.o
USE_STANDARD_AS_RULE := true
EXTRA_AFLAGS := -ansi
all: kernel.o head.o init_task.o
......
......@@ -181,7 +181,7 @@ extern void rs_init(void);
extern void clock_probe(void);
extern void power_init(void);
void __init pcibios_init(void)
static void __init pcibios_init(void)
{
pci_controller_probe();
if (pci_controller_root == NULL)
......@@ -199,6 +199,8 @@ void __init pcibios_init(void)
power_init();
}
subsys_initcall(pcibios_init);
struct pci_fixup pcibios_fixups[] = {
{ 0 }
};
......
......@@ -411,6 +411,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
struct rt_signal_frame *sf;
unsigned long tpc, tnpc, tstate;
__siginfo_fpu_t *fpu_save;
mm_segment_t old_fs;
sigset_t set;
stack_t st;
int err;
......@@ -455,7 +456,10 @@ void do_rt_sigreturn(struct pt_regs *regs)
/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
old_fs = get_fs();
set_fs(KERNEL_DS);
do_sigaltstack(&st, NULL, (unsigned long)sf);
set_fs(old_fs);
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sigmask_lock);
......
......@@ -396,6 +396,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
struct rt_signal_frame32 *sf;
unsigned int psr;
unsigned pc, npc, fpu_save;
mm_segment_t old_fs;
sigset_t set;
sigset_t32 seta;
stack_t st;
......@@ -453,7 +454,10 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
old_fs = get_fs();
set_fs(KERNEL_DS);
do_sigaltstack(&st, NULL, (unsigned long)sf);
set_fs(old_fs);
switch (_NSIG_WORDS) {
case 4: set.sig[3] = seta.sig[6] + (((long)seta.sig[7]) << 32);
......@@ -1031,6 +1035,7 @@ svr4_getcontext(svr4_ucontext_t *uc, struct pt_regs *regs)
asmlinkage int svr4_setcontext(svr4_ucontext_t *c, struct pt_regs *regs)
{
svr4_gregset_t *gr;
mm_segment_t old_fs;
u32 pc, npc, psr;
sigset_t set;
svr4_sigset_t setv;
......@@ -1086,7 +1091,10 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t *c, struct pt_regs *regs)
/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
old_fs = get_fs();
set_fs(KERNEL_DS);
do_sigaltstack(&st, NULL, regs->u_regs[UREG_I6]);
set_fs(old_fs);
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sigmask_lock);
......
......@@ -156,8 +156,7 @@ asmlinkage int sunos_brk(u32 baddr)
* simple, it hopefully works in most obvious cases.. Easy to
* fool it, but this should catch most mistakes.
*/
freepages = atomic_read(&buffermem_pages) >> PAGE_SHIFT;
freepages += get_page_cache_size();
freepages = get_page_cache_size();
freepages >>= 1;
freepages += nr_free_pages();
freepages += nr_swap_pages;
......
......@@ -2,13 +2,8 @@
# Makefile for Sparc64 library files..
#
.S.s:
$(CPP) $(AFLAGS) -ansi $< -o $*.s
.S.o:
$(CC) $(AFLAGS) -ansi -c $< -o $*.o
CFLAGS := $(CFLAGS)
USE_STANDARD_AS_RULE := true
EXTRA_AFLAGS := -ansi
L_TARGET = lib.a
obj-y := PeeCeeI.o blockops.o debuglocks.o strlen.o strncmp.o \
......
# $Id: Makefile,v 1.8 2000/12/14 22:57:25 davem Exp $
# Makefile for the linux Sparc64-specific parts of the memory manager.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...
.S.s:
$(CPP) $(AFLAGS) -ansi $< -o $*.s
.S.o:
$(CC) $(AFLAGS) -ansi -c $< -o $*.o
USE_STANDARD_AS_RULE := true
EXTRA_AFLAGS := -ansi
O_TARGET := mm.o
obj-y := ultra.o fault.o init.o generic.o extable.o modutil.o
......
......@@ -1704,7 +1704,7 @@ void __init mem_init(void)
max_mapnr = last_valid_pfn - pfn_base;
high_memory = __va(last_valid_pfn << PAGE_SHIFT);
num_physpages = free_all_bootmem() - 1;
totalram_pages = num_physpages = free_all_bootmem() - 1;
/*
* Set up the zero page, mark it reserved, so that page count
......@@ -1737,6 +1737,7 @@ void __init mem_init(void)
addr += alias_base;
free_pgd_fast((pgd_t *)addr);
num_physpages++;
totalram_pages++;
}
#endif
......@@ -1773,6 +1774,7 @@ void free_initmem (void)
set_page_count(p, 1);
__free_page(p);
num_physpages++;
totalram_pages++;
}
}
......@@ -1788,6 +1790,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
set_page_count(p, 1);
__free_page(p);
num_physpages++;
totalram_pages++;
}
}
#endif
......@@ -2,22 +2,14 @@
# Makefile for the Sun Boot PROM interface library under
# Linux.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
USE_STANDARD_AS_RULE := true
EXTRA_AFLAGS := -ansi
L_TARGET = promlib.a
obj-y := bootstr.o devops.o init.o memory.o misc.o \
tree.o console.o printf.o p1275.o map.o
.S.s:
$(CPP) $(AFLAGS) -ansi $< -o $*.s
.S.o:
$(CC) $(AFLAGS) -ansi -c $< -o $*.o
include $(TOPDIR)/Rules.make
%.o: %.c
......
......@@ -2,16 +2,13 @@
# Makefile for the Solaris binary emulation.
#
USE_STANDARD_AS_RULE := true
EXTRA_AFLAGS := -ansi
ifeq ($(CONFIG_SOLARIS_EMUL),m)
CPPFLAGS = $(MODFLAGS)
EXTRA_AFLAGS += $(MODFLAGS)
endif
.S.s:
$(CPP) $(AFLAGS) $(CPPFLAGS) -ansi $< -o $*.s
.S.o:
$(CC) $(AFLAGS) $(CPPFLAGS) -ansi -c $< -o $*.o
solaris-objs := entry64.o fs.o misc.o signal.o systbl.o socket.o \
ioctl.o ipc.o socksys.o timod.o
......
This diff is collapsed.
......@@ -317,6 +317,8 @@ drm_agp_head_t *DRM(agp_init)(void)
break;
#endif
case HP_ZX1: head->chipset = "HP ZX1"; break;
default: head->chipset = "Unknown"; break;
}
#if LINUX_VERSION_CODE <= 0x020408
......
......@@ -2692,7 +2692,7 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr,
flagsize &= ~BD_FLG_COAL_NOW;
#endif
if (!ACE_IS_TIGON_I(ap)) {
if (ACE_IS_TIGON_I(ap)) {
writel(addr >> 32, &desc->addr.addrhi);
writel(addr & 0xffffffff, &desc->addr.addrlo);
writel(flagsize, &desc->flagsize);
......
......@@ -1211,7 +1211,7 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
if (ap->rxconfig & ANEG_CFG_FD)
ap->flags |= MR_LP_ADV_FULL_DUPLEX;
if (ap->rxconfig & ANEG_CFG_HD)
ap->flags |= MR_LP_ADV_FULL_DUPLEX;
ap->flags |= MR_LP_ADV_HALF_DUPLEX;
if (ap->rxconfig & ANEG_CFG_PS1)
ap->flags |= MR_LP_ADV_SYM_PAUSE;
if (ap->rxconfig & ANEG_CFG_PS2)
......
......@@ -29,7 +29,7 @@ obj-$(CONFIG_ALPHA) += setup-bus.o setup-irq.o
obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o
obj-$(CONFIG_PARISC) += setup-bus.o
obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o
obj-$(CONFIG_ALL_PPC) += setup-bus.o
obj-$(CONFIG_PPC32) += setup-irq.o
obj-$(CONFIG_DDB5476) += setup-bus.o
obj-$(CONFIG_SGI_IP27) += setup-irq.o
......
......@@ -129,7 +129,7 @@ static void sd_rw_intr(Scsi_Cmnd * SCpnt);
static Scsi_Disk * sd_get_sdisk(int index);
#if defined(CONFIG_PPC)
#if defined(CONFIG_PPC32)
/**
* sd_find_target - find kdev_t of first scsi disk that matches
* given host and scsi_id.
......@@ -149,7 +149,7 @@ sd_find_target(void *hp, int scsi_id)
{
Scsi_Disk *sdkp;
Scsi_Device *sdp;
Scsi_Host *shp = hp;
struct Scsi_Host *shp = hp;
int dsk_nr;
unsigned long iflags;
......@@ -162,7 +162,7 @@ sd_find_target(void *hp, int scsi_id)
sdp = sdkp->device;
if (sdp && (sdp->host == shp) && (sdp->id == scsi_id)) {
read_unlock_irqrestore(&sd_dsk_arr_lock, iflags);
return MKDEV_SD(k);
return MKDEV_SD(dsk_nr);
}
}
read_unlock_irqrestore(&sd_dsk_arr_lock, iflags);
......
......@@ -19,6 +19,7 @@
#include <linux/ethtool.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/usb.h>
#include <linux/init.h>
#include <asm/uaccess.h>
/* Version Information */
......
......@@ -38,60 +38,74 @@ static void redo_inode_mask(struct inode *inode)
inode->i_dnotify_mask = new_mask;
}
void dnotify_flush(struct file *filp, fl_owner_t id)
{
struct dnotify_struct *dn;
struct dnotify_struct **prev;
struct inode *inode;
inode = filp->f_dentry->d_inode;
if (!S_ISDIR(inode->i_mode))
return;
write_lock(&dn_lock);
prev = &inode->i_dnotify;
while ((dn = *prev) != NULL) {
if ((dn->dn_owner == id) && (dn->dn_filp == filp)) {
*prev = dn->dn_next;
redo_inode_mask(inode);
kmem_cache_free(dn_cache, dn);
break;
}
prev = &dn->dn_next;
}
write_unlock(&dn_lock);
}
int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
{
struct dnotify_struct *dn = NULL;
struct dnotify_struct *dn;
struct dnotify_struct *odn;
struct dnotify_struct **prev;
struct inode *inode;
int turning_off = (arg & ~DN_MULTISHOT) == 0;
fl_owner_t id = current->files;
if (!turning_off && !dir_notify_enable)
if ((arg & ~DN_MULTISHOT) == 0) {
dnotify_flush(filp, id);
return 0;
}
if (!dir_notify_enable)
return -EINVAL;
inode = filp->f_dentry->d_inode;
if (!S_ISDIR(inode->i_mode))
return -ENOTDIR;
if (!turning_off) {
dn = kmem_cache_alloc(dn_cache, SLAB_KERNEL);
if (dn == NULL)
return -ENOMEM;
}
write_lock(&dn_lock);
prev = &inode->i_dnotify;
for (odn = *prev; odn != NULL; prev = &odn->dn_next, odn = *prev)
if ((odn->dn_owner == current->files) && (odn->dn_filp == filp))
break;
if (odn != NULL) {
if (turning_off) {
*prev = odn->dn_next;
redo_inode_mask(inode);
dn = odn;
goto out_free;
}
while ((odn = *prev) != NULL) {
if ((odn->dn_owner == id) && (odn->dn_filp == filp)) {
odn->dn_fd = fd;
odn->dn_mask |= arg;
inode->i_dnotify_mask |= arg & ~DN_MULTISHOT;
goto out_free;
}
if (turning_off)
kmem_cache_free(dn_cache, dn);
goto out;
}
prev = &odn->dn_next;
}
filp->f_owner.pid = current->pid;
filp->f_owner.uid = current->uid;
filp->f_owner.euid = current->euid;
dn->dn_magic = DNOTIFY_MAGIC;
dn->dn_mask = arg;
dn->dn_fd = fd;
dn->dn_filp = filp;
dn->dn_owner = current->files;
dn->dn_owner = id;
inode->i_dnotify_mask |= arg & ~DN_MULTISHOT;
dn->dn_next = inode->i_dnotify;
inode->i_dnotify = dn;
out:
write_unlock(&dn_lock);
return 0;
out_free:
kmem_cache_free(dn_cache, dn);
goto out;
}
void __inode_dir_notify(struct inode *inode, unsigned long event)
......@@ -104,11 +118,6 @@ void __inode_dir_notify(struct inode *inode, unsigned long event)
write_lock(&dn_lock);
prev = &inode->i_dnotify;
while ((dn = *prev) != NULL) {
if (dn->dn_magic != DNOTIFY_MAGIC) {
printk(KERN_ERR "__inode_dir_notify: bad magic "
"number in dnotify_struct!\n");
goto out;
}
if ((dn->dn_mask & event) == 0) {
prev = &dn->dn_next;
continue;
......
......@@ -1385,6 +1385,35 @@ int lmLogClose(struct super_block *sb, log_t * log)
}
/*
* NAME: lmLogWait()
*
* FUNCTION: wait for all outstanding log records to be written to disk
*/
void lmLogWait(log_t *log)
{
int i;
jFYI(1, ("lmLogWait: log:0x%p\n", log));
if (log->cqueue.head || !list_empty(&log->synclist)) {
/*
* If there was very recent activity, we may need to wait
* for the lazycommit thread to catch up
*/
for (i = 0; i < 800; i++) { /* Too much? */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(HZ / 4);
if ((log->cqueue.head == NULL) &&
list_empty(&log->synclist))
break;
}
}
assert(log->cqueue.head == NULL);
assert(list_empty(&log->synclist));
}
/*
* NAME: lmLogShutdown()
*
......@@ -1411,23 +1440,7 @@ static int lmLogShutdown(log_t * log)
jFYI(1, ("lmLogShutdown: log:0x%p\n", log));
if (log->cqueue.head || !list_empty(&log->synclist)) {
/*
* If there was very recent activity, we may need to wait
* for the lazycommit thread to catch up
*/
int i;
for (i = 0; i < 800; i++) { /* Too much? */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(HZ / 4);
if ((log->cqueue.head == NULL) &&
list_empty(&log->synclist))
break;
}
}
assert(log->cqueue.head == NULL);
assert(list_empty(&log->synclist));
lmLogWait(log);
/*
* We need to make sure all of the "written" metapages
......
......@@ -489,6 +489,7 @@ typedef struct logsyncblk {
}
extern int lmLogOpen(struct super_block *sb, log_t ** log);
extern void lmLogWait(log_t * log);
extern int lmLogClose(struct super_block *sb, log_t * log);
extern int lmLogSync(log_t * log, int nosyncwait);
extern int lmLogQuiesce(log_t * log);
......
......@@ -64,15 +64,11 @@ int jfs_umount(struct super_block *sb)
*
* if mounted read-write and log based recovery was enabled
*/
if ((log = sbi->log)) {
if ((log = sbi->log))
/*
* close log:
*
* remove file system from log active file system list.
* Wait for outstanding transactions to be written to log:
*/
log = sbi->log;
rc = lmLogClose(sb, log);
}
lmLogWait(log);
/*
* close fileset inode allocation map (aka fileset inode)
......@@ -112,6 +108,14 @@ int jfs_umount(struct super_block *sb)
diFreeSpecial(ipbmap);
sbi->ipimap = NULL;
/*
* Make sure all metadata makes it to disk before we mark
* the superblock as clean
*/
filemap_fdatawait(sbi->direct_inode->i_mapping);
filemap_fdatawrite(sbi->direct_inode->i_mapping);
filemap_fdatawait(sbi->direct_inode->i_mapping);
/*
* ensure all file system file pages are propagated to their
* home blocks on disk (and their in-memory buffer pages are
......@@ -120,10 +124,16 @@ int jfs_umount(struct super_block *sb)
* consistent state) and log superblock active file system
* list (to signify skip logredo()).
*/
if (log) /* log = NULL if read-only mount */
if (log) { /* log = NULL if read-only mount */
rc = updateSuper(sb, FM_CLEAN);
/*
* close log:
*
* remove file system from log active file system list.
*/
rc = lmLogClose(sb, log);
}
jFYI(0, (" UnMount JFS Complete: %d\n", rc));
return rc;
}
......@@ -132,8 +142,9 @@ int jfs_umount(struct super_block *sb)
int jfs_umount_rw(struct super_block *sb)
{
struct jfs_sb_info *sbi = JFS_SBI(sb);
log_t *log = sbi->log;
if (!sbi->log)
if (!log)
return 0;
/*
......@@ -141,13 +152,19 @@ int jfs_umount_rw(struct super_block *sb)
*
* remove file system from log active file system list.
*/
lmLogClose(sb, sbi->log);
lmLogWait(log);
/*
* Make sure all metadata makes it to disk
*/
dbSync(sbi->ipbmap);
diSync(sbi->ipimap);
filemap_fdatawait(sbi->direct_inode->i_mapping);
filemap_fdatawrite(sbi->direct_inode->i_mapping);
filemap_fdatawait(sbi->direct_inode->i_mapping);
sbi->log = 0;
return updateSuper(sb, FM_CLEAN);
updateSuper(sb, FM_CLEAN);
sbi->log = NULL;
return lmLogClose(sb, log);
}
......@@ -196,7 +196,7 @@ nfs_list_add_request(struct nfs_page *req, struct list_head *head)
BUG();
}
#endif
for (pos = head->prev; pos != head; pos = pos->prev) {
list_for_each_prev(pos, head) {
struct nfs_page *p = nfs_list_entry(pos);
if (page_index(p->wb_page) < pg_idx)
break;
......
......@@ -835,7 +835,7 @@ int filp_close(struct file *filp, fl_owner_t id)
retval = filp->f_op->flush(filp);
unlock_kernel();
}
fcntl_dirnotify(0, filp, 0);
dnotify_flush(filp, id);
locks_remove_posix(filp, id);
fput(filp);
return retval;
......
......@@ -24,11 +24,12 @@
#define TI_FLAG_BYTE_WSAVED 5
#define TI_FLAG_WSAVED_SHIFT 16
#include <asm/page.h>
#ifndef __ASSEMBLY__
#include <asm/ptrace.h>
#include <asm/types.h>
#include <asm/page.h>
struct task_struct;
struct exec_domain;
......
......@@ -75,7 +75,8 @@ enum chipset_type {
ALI_GENERIC,
SVWRKS_HE,
SVWRKS_LE,
SVWRKS_GENERIC
SVWRKS_GENERIC,
HP_ZX1,
};
typedef struct _agp_version {
......
/*
* Directory notification for Linux
*
* Copyright 2000 (C) Stephen Rothwell
* Copyright (C) 2000,2002 Stephen Rothwell
*/
#include <linux/fs.h>
struct dnotify_struct {
struct dnotify_struct * dn_next;
int dn_magic;
unsigned long dn_mask; /* Events to be notified
see linux/fcntl.h */
int dn_fd;
......@@ -16,9 +15,8 @@ struct dnotify_struct {
fl_owner_t dn_owner;
};
#define DNOTIFY_MAGIC 0x444E4F54
extern void __inode_dir_notify(struct inode *, unsigned long);
extern void dnotify_flush(struct file *filp, fl_owner_t id);
extern int fcntl_dirnotify(int, struct file *, unsigned long);
static inline void inode_dir_notify(struct inode *inode, unsigned long event)
......
......@@ -58,6 +58,7 @@
#define _FP_FRAC_NEGP_1(X) ((_FP_WS_TYPE)X##_f < 0)
#define _FP_FRAC_ZEROP_1(X) (X##_f == 0)
#define _FP_FRAC_OVERP_1(fs,X) (X##_f & _FP_OVERFLOW_##fs)
#define _FP_FRAC_CLEAR_OVERP_1(fs,X) (X##_f &= ~_FP_OVERFLOW_##fs)
#define _FP_FRAC_EQ_1(X, Y) (X##_f == Y##_f)
#define _FP_FRAC_GE_1(X, Y) (X##_f >= Y##_f)
#define _FP_FRAC_GT_1(X, Y) (X##_f > Y##_f)
......
......@@ -114,6 +114,7 @@
#define _FP_FRAC_NEGP_2(X) ((_FP_WS_TYPE)X##_f1 < 0)
#define _FP_FRAC_ZEROP_2(X) ((X##_f1 | X##_f0) == 0)
#define _FP_FRAC_OVERP_2(fs,X) (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
#define _FP_FRAC_CLEAR_OVERP_2(fs,X) (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
#define _FP_FRAC_EQ_2(X, Y) (X##_f1 == Y##_f1 && X##_f0 == Y##_f0)
#define _FP_FRAC_GT_2(X, Y) \
(X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 > Y##_f0))
......
......@@ -132,6 +132,7 @@
#define _FP_FRAC_ZEROP_4(X) ((X##_f[0] | X##_f[1] | X##_f[2] | X##_f[3]) == 0)
#define _FP_FRAC_NEGP_4(X) ((_FP_WS_TYPE)X##_f[3] < 0)
#define _FP_FRAC_OVERP_4(fs,X) (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs)
#define _FP_FRAC_CLEAR_OVERP_4(fs,X) (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs)
#define _FP_FRAC_EQ_4(X,Y) \
(X##_f[0] == Y##_f[0] && X##_f[1] == Y##_f[1] \
......
......@@ -97,10 +97,9 @@ do { \
_FP_ROUND(wc, X); \
if (_FP_FRAC_OVERP_##wc(fs, X)) \
{ \
_FP_FRAC_SRL_##wc(X, (_FP_WORKBITS+1)); \
_FP_FRAC_CLEAR_OVERP_##wc(fs, X); \
X##_e++; \
} \
else \
_FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
if (X##_e >= _FP_EXPMAX_##fs) \
{ \
......@@ -780,9 +779,8 @@ do { \
X##_e -= (_FP_W_TYPE_SIZE - rsize); \
X##_e = rsize - X##_e - 1; \
\
r &= ~((rtype)1 << X##_e); \
if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \
__FP_FRAC_SRS_1(r, (X##_e - _FP_WFRACBITS_##fs), rsize); \
__FP_FRAC_SRS_1(r, (X##_e - _FP_WFRACBITS_##fs + 1), rsize); \
_FP_FRAC_DISASSEMBLE_##wc(X, ((unsigned rtype)r), rsize); \
if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0) \
_FP_FRAC_SLL_##wc(X, (_FP_WFRACBITS_##fs - X##_e - 1)); \
......
......@@ -110,6 +110,10 @@ struct rt_cache_stat
unsigned int out_hit;
unsigned int out_slow_tot;
unsigned int out_slow_mc;
unsigned int gc_total;
unsigned int gc_ignored;
unsigned int gc_goal_miss;
unsigned int gc_dst_overflow;
} ____cacheline_aligned_in_smp;
extern struct ip_rt_acct *ip_rt_acct;
......
......@@ -387,6 +387,9 @@ static int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
if (!mm_init(mm))
goto fail_nomem;
if (init_new_context(tsk,mm))
goto free_pt;
down_write(&oldmm->mmap_sem);
retval = dup_mmap(mm);
up_write(&oldmm->mmap_sem);
......@@ -394,9 +397,6 @@ static int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
if (retval)
goto free_pt;
if (init_new_context(tsk,mm))
goto free_pt;
good_mm:
tsk->mm = mm;
tsk->active_mm = mm;
......
......@@ -160,6 +160,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
put_page(page);
len -= bytes;
buf += bytes;
addr += bytes;
}
up_read(&mm->mmap_sem);
mmput(mm);
......
......@@ -839,7 +839,10 @@ kmem_cache_create (const char *name, size_t size, size_t offset,
down(&cache_chain_sem);
{
struct list_head *p;
mm_segment_t old_fs;
old_fs = get_fs();
set_fs(KERNEL_DS);
list_for_each(p, &cache_chain) {
kmem_cache_t *pc = list_entry(p, kmem_cache_t, next);
char tmp;
......@@ -857,6 +860,7 @@ kmem_cache_create (const char *name, size_t size, size_t offset,
BUG();
}
}
set_fs(old_fs);
}
/* There is no reason to lock our new cache before we
......@@ -1965,8 +1969,13 @@ static int s_show(struct seq_file *m, void *p)
name = cachep->name;
{
char tmp;
mm_segment_t old_fs;
old_fs = get_fs();
set_fs(KERNEL_DS);
if (__get_user(tmp, name))
name = "broken";
set_fs(old_fs);
}
seq_printf(m, "%-17s %6lu %6lu %6u %4lu %4lu %4u",
......
......@@ -1088,7 +1088,7 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
swap_list_unlock();
if (swap_map)
vfree(swap_map);
if (swap_file)
if (swap_file && !IS_ERR(swap_file))
filp_close(swap_file, NULL);
out:
if (swap_header)
......
......@@ -29,7 +29,7 @@
* Specify, after how many clock ticks (intel: 100 per second) the queue
* should be flushed even if it is not full yet.
*
* ipt_ULOG.c,v 1.15 2002/01/18 21:33:19 laforge Exp
* ipt_ULOG.c,v 1.18 2002/04/16 07:33:00 laforge Exp
*/
#include <linux/module.h>
......@@ -339,10 +339,28 @@ static int __init init(void)
static void __exit fini(void)
{
ulog_buff_t *ub;
int i;
DEBUGP("ipt_ULOG: cleanup_module\n");
ipt_unregister_target(&ipt_ulog_reg);
sock_release(nflognl->socket);
/* remove pending timers and free allocated skb's */
for (i = 0; i < ULOG_MAXNLGROUPS; i++) {
ub = &ulog_buffers[i];
if (timer_pending(&ub->timer)) {
DEBUGP("timer was pending, deleting\n");
del_timer(&ub->timer);
}
if (ub->skb) {
kfree_skb(ub->skb);
ub->skb = NULL;
}
}
}
module_init(init);
......
......@@ -286,7 +286,7 @@ static int rt_cache_stat_get_info(char *buffer, char **start, off_t offset, int
for (lcpu = 0; lcpu < smp_num_cpus; lcpu++) {
i = cpu_logical_map(lcpu);
len += sprintf(buffer+len, "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
len += sprintf(buffer+len, "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x \n",
dst_entries,
rt_cache_stat[i].in_hit,
rt_cache_stat[i].in_slow_tot,
......@@ -298,7 +298,13 @@ static int rt_cache_stat_get_info(char *buffer, char **start, off_t offset, int
rt_cache_stat[i].out_hit,
rt_cache_stat[i].out_slow_tot,
rt_cache_stat[i].out_slow_mc
rt_cache_stat[i].out_slow_mc,
rt_cache_stat[i].gc_total,
rt_cache_stat[i].gc_ignored,
rt_cache_stat[i].gc_goal_miss,
rt_cache_stat[i].gc_dst_overflow
);
}
len -= offset;
......@@ -499,9 +505,14 @@ static int rt_garbage_collect(void)
* Garbage collection is pretty expensive,
* do not make it too frequently.
*/
rt_cache_stat[smp_processor_id()].gc_total++;
if (now - last_gc < ip_rt_gc_min_interval &&
atomic_read(&ipv4_dst_ops.entries) < ip_rt_max_size)
atomic_read(&ipv4_dst_ops.entries) < ip_rt_max_size) {
rt_cache_stat[smp_processor_id()].gc_ignored++;
goto out;
}
/* Calculate number of entries, which we want to expire now. */
goal = atomic_read(&ipv4_dst_ops.entries) -
......@@ -567,6 +578,8 @@ static int rt_garbage_collect(void)
We will not spin here for long time in any case.
*/
rt_cache_stat[smp_processor_id()].gc_goal_miss++;
if (expire == 0)
break;
......@@ -584,6 +597,7 @@ static int rt_garbage_collect(void)
goto out;
if (net_ratelimit())
printk(KERN_WARNING "dst cache overflow\n");
rt_cache_stat[smp_processor_id()].gc_dst_overflow++;
return 1;
work_done:
......
This diff is collapsed.
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