Commit 1f58336f authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.9

parent 5d1afa8d
......@@ -3,6 +3,7 @@
*
* Copyright (C) 1998 Russell King, Phil Blundell
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/pci.h>
......
#include <linux/config.h>
/*============================================================================
* All exits to user mode from the kernel go through this code.
*/
......
......@@ -6,6 +6,7 @@
*
* $Id: console.c,v 1.2 1999/06/12 18:42:38 ulfc Exp $
*/
#include <linux/config.h>
#include <linux/init.h>
#include <asm/sgialib.h>
#include <asm/bcache.h>
......
......@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/config.h>
#include <asm/sgialib.h>
#include <asm/page.h>
......
......@@ -6,6 +6,7 @@
*
* $Id: printf.c,v 1.2 1999/06/12 18:42:38 ulfc Exp $
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
......
......@@ -4,7 +4,6 @@
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
*/
#include <linux/config.h>
#include <asm/asm.h>
#include <asm/regdef.h>
#include <asm/stackframe.h>
......
......@@ -6,7 +6,6 @@
* $Id$
*/
#include <linux/init.h>
#include <linux/config.h>
#include <asm/bootinfo.h>
char arcs_cmdline[CL_SIZE];
......
......@@ -5,7 +5,6 @@
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
*
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......
......@@ -7,7 +7,6 @@
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/config.h>
#include <linux/string.h>
#include <asm/bootinfo.h>
......
......@@ -6,7 +6,6 @@
* $Id: $
*/
#include <linux/init.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/string.h>
......
......@@ -6,7 +6,6 @@
* $Id: $
*/
#include <linux/init.h>
#include <linux/config.h>
#include "prom.h"
/*
......
......@@ -7,7 +7,6 @@
*/
#include <asm/addrspace.h>
#include <linux/init.h>
#include <linux/config.h>
#include <linux/string.h>
#include "prom.h"
......
......@@ -16,6 +16,7 @@
* console device I strongly recommend to use only one.
*/
#include <linux/config.h>
#include <asm/init.h>
#include <asm/dec/machtype.h>
......
......@@ -10,8 +10,6 @@
* Copyright (c) 1998 Harald Koerfgen
* Copyright (c) 1998 Gleb Raiko & Vladimir Roganov
*/
#include <linux/config.h>
#include <asm/asm.h>
#include <asm/current.h>
#include <asm/bootinfo.h>
......
......@@ -6,6 +6,7 @@
* This file contains the time handling details for PC-style clocks as
* found in some MIPS systems.
*/
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/sched.h>
......
......@@ -9,9 +9,7 @@
* - Indigo2 changes
* - Interrupt handling fixes
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/kernel_stat.h>
#include <linux/signal.h>
......
......@@ -10,6 +10,7 @@
* 22-May-1999 RMK Added support for V6 DMA
*/
#include <linux/config.h>
#include <linux/string.h>
#include <linux/module.h>
#include <linux/ioport.h>
......
......@@ -24,6 +24,7 @@
#define MOD_DEC_USE_COUNT
#endif
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/init.h>
......
......@@ -9,7 +9,6 @@
* some more code.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
......
......@@ -14,7 +14,6 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
......
......@@ -19,7 +19,6 @@
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
......
......@@ -25,6 +25,7 @@
* - code/test for other LAN classes
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/netdevice.h>
......
......@@ -12,7 +12,6 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
......
......@@ -38,7 +38,6 @@
#define FMT_U64_HEX "0x%08x%08x"
#define U64_VAL(pu64) *((u32*)(pu64)+1), *((u32*)(pu64))
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/i2o.h>
......
......@@ -39,7 +39,6 @@
* Aug 8, 1998 Arnaldo Initial version.
*/
#include <linux/config.h>
#ifdef MODULE
#ifdef MODVERSIONS
#include <linux/modversions.h>
......
......@@ -24,7 +24,6 @@
*
********************************************************************/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <linux/kernel.h>
......
......@@ -45,7 +45,6 @@
#include <linux/interrupt.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/config.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
......
......@@ -29,6 +29,8 @@
* $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $
*-M*************************************************************************/
#include <linux/config.h>
#define BLS (&aic7xxx_buffer[size])
#define HDRB \
" < 2K 2K+ 4K+ 8K+ 16K+ 32K+ 64K+ 128K+"
......
......@@ -8,7 +8,6 @@
*/
#define __NO_VERSION__
#include <linux/config.h>
#include <linux/module.h>
/* extern int rrm_command (unsigned int cmd, void *arg);
......
......@@ -12,7 +12,6 @@
#include <asm/ng1.h>
#include <asm/uaccess.h>
#include <asm/newport.h>
#include <linux/config.h>
#include <linux/module.h>
struct newport_regs *npregs;
......
......@@ -62,6 +62,7 @@
/*****************************************************************************/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/string.h>
......
......@@ -183,6 +183,7 @@
* ES1946 yes This is a PCI chip; not handled by this driver
*/
#include <linux/config.h>
#include <linux/delay.h>
#include "sound_config.h"
......
......@@ -3,7 +3,6 @@
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/dec/tc.h>
......
......@@ -26,7 +26,6 @@
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/malloc.h>
#include <linux/config.h>
#include <linux/module.h>
#include <asm/spinlock.h>
......
......@@ -3,7 +3,6 @@
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/config.h>
#include <linux/module.h>
#include "usb.h"
......
......@@ -17,7 +17,6 @@
#include <linux/videodev.h>
#include <linux/vmalloc.h>
#include <linux/wrapper.h>
#include <linux/config.h>
#include <linux/module.h>
#include <asm/spinlock.h>
......
......@@ -10,7 +10,6 @@
#include <linux/list.h>
#include <linux/malloc.h>
#include <linux/smp_lock.h>
#include <linux/config.h>
#include <linux/module.h>
#include <asm/spinlock.h>
......
......@@ -33,7 +33,6 @@
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/malloc.h>
#include <linux/config.h>
#include <linux/module.h>
#include <asm/spinlock.h>
......
......@@ -36,7 +36,6 @@
* 6 wLength 2 Count Bytes for data
*/
#include <linux/config.h>
#include <linux/string.h>
#include <linux/bitops.h>
#include <linux/malloc.h>
......
......@@ -25,6 +25,7 @@
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......
......@@ -11,6 +11,8 @@
*
*/
#include <linux/config.h>
#define USB_SCSI "usbscsi: "
extern int usbscsi_debug;
......
......@@ -78,6 +78,7 @@ static int nr_buffers_type[NR_LIST] = {0,};
static struct buffer_head * unused_list = NULL;
static int nr_unused_buffer_heads = 0;
static spinlock_t unused_list_lock = SPIN_LOCK_UNLOCKED;
static DECLARE_WAIT_QUEUE_HEAD(buffer_wait);
struct bh_free_head {
struct buffer_head *list;
......@@ -85,8 +86,6 @@ struct bh_free_head {
};
static struct bh_free_head free_list[NR_SIZES];
static DECLARE_WAIT_QUEUE_HEAD(buffer_wait);
static kmem_cache_t *bh_cachep;
static int grow_buffers(int size);
......@@ -904,7 +903,6 @@ void __brelse(struct buffer_head * buf)
if (atomic_read(&buf->b_count)) {
atomic_dec(&buf->b_count);
wake_up(&buffer_wait);
return;
}
printk("VFS: brelse: Trying to free free buffer\n");
......@@ -923,7 +921,6 @@ void __bforget(struct buffer_head * buf)
if (atomic_read(&buf->b_count) != 1 || buffer_locked(buf)) {
touch_buffer(buf);
atomic_dec(&buf->b_count);
wake_up(&buffer_wait);
} else {
atomic_set(&buf->b_count, 0);
buf->b_state = 0;
......@@ -1837,9 +1834,16 @@ void __init buffer_init(unsigned long memory_size)
for something that is really too small */
do {
unsigned long tmp;
nr_hash = (PAGE_SIZE << order) / sizeof(struct buffer_head *);
bh_hash_mask = (nr_hash - 1);
bh_hash_shift = (PAGE_SHIFT + order);
tmp = nr_hash;
bh_hash_shift = 0;
while((tmp >>= 1UL) != 0UL)
bh_hash_shift++;
hash_table = (struct buffer_head **)
__get_free_pages(GFP_ATOMIC, order);
} while (hash_table == NULL && --order > 0);
......@@ -2070,7 +2074,6 @@ int bdflush(void * unused)
--written;
} else
ll_rw_block(WRITE, 1, &bh);
wake_up(&buffer_wait);
atomic_dec(&bh->b_count);
goto repeat;
}
......
......@@ -140,6 +140,7 @@ nlm_lookup_host(struct svc_client *clnt, struct sockaddr_in *sin,
host->h_nextrebind = jiffies + NLM_HOST_REBIND;
host->h_expires = jiffies + NLM_HOST_EXPIRE;
host->h_count = 1;
init_waitqueue_head(&host->h_gracewait);
host->h_state = 0; /* pseudo NSM state */
host->h_nsmstate = 0; /* real NSM state */
host->h_exportent = clnt;
......
......@@ -884,6 +884,8 @@ static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
nfs_flush_dircache(dir);
error = nfs_proc_mkdir(NFS_DSERVER(dentry), NFS_FH(dentry->d_parent),
dentry->d_name.name, &sattr, &fhandle, &fattr);
if (!error)
dir->i_nlink++;
return error;
}
......@@ -909,8 +911,8 @@ dentry->d_inode->i_count, dentry->d_inode->i_nlink);
/* Update i_nlink and invalidate dentry. */
if (!error) {
d_drop(dentry);
if (dentry->d_inode->i_nlink)
dentry->d_inode->i_nlink --;
if (dir->i_nlink)
dir->i_nlink--;
}
return error;
......
......@@ -6,9 +6,7 @@
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
......
......@@ -10,6 +10,7 @@
* 26-Jan-1999 PJB Don't use IACK on CATS
* 16-Mar-1999 RMK Added autodetect of ISA PICs
*/
#include <linux/config.h>
#include <asm/hardware.h>
#include <asm/dec21285.h>
#include <asm/irq.h>
......
......@@ -15,6 +15,8 @@
#ifndef __ASM_ARCH_MMU_H
#define __ASM_ARCH_MMU_H
#include <linux/config.h>
#if defined(CONFIG_HOST_FOOTBRIDGE)
/*
......
......@@ -6,8 +6,6 @@
*/
#undef CONF_SLOWDOWN_IO
#include <linux/config.h>
#include <asm/mipsconfig.h>
#include <asm/addrspace.h>
......
......@@ -12,7 +12,6 @@
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <asm/bootinfo.h>
......
......@@ -5,6 +5,8 @@
#ifndef _PPC_MMU_H_
#define _PPC_MMU_H_
#include <linux/config.h>
#ifndef __ASSEMBLY__
/* Hardware Page Table Entry */
typedef struct _PTE {
......
......@@ -17,6 +17,8 @@
* the PT_* values below. This simplifies arch/ppc/kernel/ptrace.c.
*/
#include <linux/config.h>
#ifndef __ASSEMBLY__
#ifdef CONFIG_PPC64
#define PPC_REG unsigned long /*long*/
......
......@@ -21,6 +21,7 @@
#ifndef _CYCLOMX_H
#define _CYCLOMX_H
#include <linux/config.h>
#include <linux/wanrouter.h>
#include <asm/spinlock.h>
......
......@@ -39,11 +39,14 @@ static inline unsigned long page_address(struct page * page)
*/
#define page_cache_entry(x) (mem_map + MAP_NR(x))
#define PAGE_HASH_BITS 16
extern unsigned int page_hash_bits;
#define PAGE_HASH_BITS (page_hash_bits)
#define PAGE_HASH_SIZE (1 << PAGE_HASH_BITS)
extern atomic_t page_cache_size; /* # of pages currently in the hash table */
extern struct page * page_hash_table[PAGE_HASH_SIZE];
extern struct page **page_hash_table;
extern void page_cache_init(unsigned long);
/*
* We use a power-of-two hash table to avoid a modulus,
......
#ifndef _NET_DN_FIB_H
#define _NET_DN_FIB_H
#include <linux/config.h>
#ifdef CONFIG_DECNET_ROUTER
......
#ifndef _NET_DN_RAW_H
#define _NET_DN_RAW_H
#include <linux/config.h>
#ifdef CONFIG_DECNET_RAW
extern struct proto_ops dn_raw_proto_ops;
......
......@@ -1186,6 +1186,7 @@ asmlinkage void __init start_kernel(void)
dcache_init();
vma_init();
buffer_init(memory_end-memory_start);
page_cache_init(memory_end-memory_start);
signals_init();
inode_init();
file_table_init();
......
......@@ -11,6 +11,7 @@
* /proc/sysvipc/msg support (c) 1999 Dragos Acostachioaie <dragos@iname.com>
*/
#include <linux/config.h>
#include <linux/malloc.h>
#include <linux/msg.h>
#include <linux/interrupt.h>
......
......@@ -52,6 +52,7 @@
* /proc/sysvipc/sem support (c) 1999 Dragos Acostachioaie <dragos@iname.com>
*/
#include <linux/config.h>
#include <linux/malloc.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
......
......@@ -8,6 +8,7 @@
* /proc/sysvipc/shm support (c) 1999 Dragos Acostachioaie <dragos@iname.com>
*/
#include <linux/config.h>
#include <linux/malloc.h>
#include <linux/shm.h>
#include <linux/swap.h>
......
......@@ -171,6 +171,8 @@ EXPORT_SYMBOL(block_flushpage);
EXPORT_SYMBOL(generic_file_read);
EXPORT_SYMBOL(generic_file_write);
EXPORT_SYMBOL(generic_file_mmap);
EXPORT_SYMBOL(page_hash_bits);
EXPORT_SYMBOL(page_hash_table);
EXPORT_SYMBOL(file_lock_table);
EXPORT_SYMBOL(posix_lock_file);
EXPORT_SYMBOL(posix_test_lock);
......
......@@ -20,6 +20,7 @@
#include <linux/file.h>
#include <linux/swapctl.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
......@@ -35,7 +36,8 @@
*/
atomic_t page_cache_size = ATOMIC_INIT(0);
struct page * page_hash_table[PAGE_HASH_SIZE];
unsigned int page_hash_bits;
struct page **page_hash_table;
spinlock_t pagecache_lock = SPIN_LOCK_UNLOCKED;
......@@ -1915,3 +1917,30 @@ void put_cached_page(unsigned long addr)
page_count(page));
page_cache_release(page);
}
void __init page_cache_init(unsigned long memory_size)
{
unsigned long htable_size, order;
htable_size = memory_size >> PAGE_SHIFT;
htable_size *= sizeof(struct page *);
for(order = 0; (PAGE_SIZE << order) < htable_size; order++)
;
do {
unsigned long tmp = (PAGE_SIZE << order) / sizeof(struct page *);
page_hash_bits = 0;
while((tmp >>= 1UL) != 0UL)
page_hash_bits++;
page_hash_table = (struct page **)
__get_free_pages(GFP_ATOMIC, order);
} while(page_hash_table == NULL && --order > 0);
printk("Page-cache hash table entries: %d (order: %ld, %ld bytes)\n",
(1 << page_hash_bits), order, (PAGE_SIZE << order));
if (!page_hash_table)
panic("Failed to allocate page hash table\n");
memset(page_hash_table, 0, PAGE_HASH_SIZE * sizeof(struct page *));
}
......@@ -5,7 +5,6 @@
* Swap reorganised 29.12.95, Stephen Tweedie
*/
#include <linux/config.h>
#include <linux/malloc.h>
#include <linux/smp_lock.h>
#include <linux/kernel_stat.h>
......
......@@ -34,7 +34,6 @@
GNU General Public License for more details.
*******************************************************************************/
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
......
......@@ -13,7 +13,6 @@
* timer idea.
* Steve Whitehouse : Added checks for sk->sock_readers
*/
#include <linux/config.h>
#include <linux/net.h>
#include <linux/socket.h>
#include <linux/skbuff.h>
......
......@@ -950,7 +950,6 @@ asmlinkage int sys_sendto(int fd, void * buff, size_t len, unsigned flags,
struct msghdr msg;
struct iovec iov;
lock_kernel();
sock = sockfd_lookup(fd, &err);
if (!sock)
goto out;
......@@ -977,7 +976,6 @@ asmlinkage int sys_sendto(int fd, void * buff, size_t len, unsigned flags,
out_put:
sockfd_put(sock);
out:
unlock_kernel();
return err;
}
......@@ -1005,7 +1003,6 @@ asmlinkage int sys_recvfrom(int fd, void * ubuf, size_t size, unsigned flags,
char address[MAX_SOCK_ADDR];
int err,err2;
lock_kernel();
sock = sockfd_lookup(fd, &err);
if (!sock)
goto out;
......@@ -1030,7 +1027,6 @@ asmlinkage int sys_recvfrom(int fd, void * ubuf, size_t size, unsigned flags,
}
sockfd_put(sock);
out:
unlock_kernel();
return err;
}
......@@ -1123,8 +1119,6 @@ asmlinkage int sys_sendmsg(int fd, struct msghdr *msg, unsigned flags)
struct msghdr msg_sys;
int err, ctl_len, iov_size, total_len;
lock_kernel();
err = -EFAULT;
if (copy_from_user(&msg_sys,msg,sizeof(struct msghdr)))
goto out;
......@@ -1194,7 +1188,6 @@ asmlinkage int sys_sendmsg(int fd, struct msghdr *msg, unsigned flags)
out_put:
sockfd_put(sock);
out:
unlock_kernel();
return err;
}
......@@ -1218,7 +1211,6 @@ asmlinkage int sys_recvmsg(int fd, struct msghdr *msg, unsigned int flags)
struct sockaddr *uaddr;
int *uaddr_len;
lock_kernel();
err=-EFAULT;
if (copy_from_user(&msg_sys,msg,sizeof(struct msghdr)))
goto out;
......@@ -1282,7 +1274,6 @@ asmlinkage int sys_recvmsg(int fd, struct msghdr *msg, unsigned int flags)
out_put:
sockfd_put(sock);
out:
unlock_kernel();
return err;
}
......
......@@ -42,7 +42,6 @@
#define __KERNEL_SYSCALLS__
#include <linux/version.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/malloc.h>
#include <linux/sched.h>
......
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