Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-02-08 21:55:50 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-02-08 21:55:50 -0800
commit51f5692c3aaa5b9a8555b5a26e61b697fbc061c2 (patch)
treee2adaeee0c6a8c32aeea7e19f1ca460e77b8bdfc
parentec332cd30cf1ccde914a87330ff66744414c8d24 (diff)
parent7021dc361020edc46c8e19914cc188531b9d830d (diff)
Merge home.transmeta.com:/home/torvalds/v2.5/preempt
into home.transmeta.com:/home/torvalds/v2.5/linux
-rw-r--r--Makefile2
-rw-r--r--arch/i386/kernel/cpuid.c1
-rw-r--r--arch/i386/kernel/init_task.c1
-rw-r--r--arch/i386/kernel/msr.c1
-rw-r--r--arch/i386/kernel/process.c2
-rw-r--r--arch/i386/kernel/semaphore.c1
-rw-r--r--drivers/base/core.c1
-rw-r--r--drivers/base/fs.c2
-rw-r--r--drivers/base/interface.c2
-rw-r--r--drivers/char/agp/agpgart_be.c10
-rw-r--r--drivers/char/random.c1
-rw-r--r--drivers/net/aironet4500_proc.c10
-rw-r--r--drivers/net/bsd_comp.c2
-rw-r--r--drivers/pnp/pnpbios_core.c1
-rw-r--r--drivers/scsi/aha1542.c6
-rw-r--r--drivers/sound/cs4281/cs4281m.c1
-rw-r--r--drivers/sound/opl3sa2.c1
-rw-r--r--drivers/sound/ymfpci.c1
-rw-r--r--drivers/telephony/phonedev.c2
-rw-r--r--drivers/usb/acm.c1
-rw-r--r--drivers/usb/auerswald.c1
-rw-r--r--drivers/usb/devio.c1
-rw-r--r--drivers/usb/hcd.c1
-rw-r--r--drivers/usb/hcd/ehci-hub.c2
-rw-r--r--drivers/usb/hcd/ehci-mem.c2
-rw-r--r--drivers/usb/hcd/ehci-q.c2
-rw-r--r--drivers/usb/hcd/ehci-sched.c2
-rw-r--r--drivers/usb/hcd/ohci-hcd.c1
-rw-r--r--drivers/usb/hcd/ohci-q.c2
-rw-r--r--drivers/usb/hid-core.c1
-rw-r--r--drivers/usb/inode.c1
-rw-r--r--drivers/usb/kaweth.c1
-rw-r--r--drivers/usb/mdc800.c1
-rw-r--r--drivers/usb/pegasus.c1
-rw-r--r--drivers/usb/scanner.c2
-rw-r--r--drivers/usb/usb-ohci.c1
-rw-r--r--drivers/usb/usb-uhci.c1
-rw-r--r--drivers/usb/usb.c1
-rw-r--r--fs/adfs/dir.c2
-rw-r--r--fs/adfs/dir_f.c2
-rw-r--r--fs/adfs/dir_fplus.c2
-rw-r--r--fs/adfs/file.c2
-rw-r--r--fs/adfs/inode.c2
-rw-r--r--fs/adfs/super.c2
-rw-r--r--fs/affs/amigaffs.c2
-rw-r--r--fs/affs/bitmap.c2
-rw-r--r--fs/affs/file.c2
-rw-r--r--fs/affs/inode.c2
-rw-r--r--fs/affs/namei.c2
-rw-r--r--fs/affs/super.c2
-rw-r--r--fs/attr.c2
-rw-r--r--fs/autofs/autofs_i.h2
-rw-r--r--fs/autofs/root.c2
-rw-r--r--fs/autofs/waitq.c2
-rw-r--r--fs/autofs4/autofs_i.h2
-rw-r--r--fs/autofs4/root.c2
-rw-r--r--fs/autofs4/waitq.c2
-rw-r--r--fs/bad_inode.c2
-rw-r--r--fs/bfs/dir.c2
-rw-r--r--fs/binfmt_aout.c2
-rw-r--r--fs/binfmt_elf.c2
-rw-r--r--fs/binfmt_script.c2
-rw-r--r--fs/buffer.c2
-rw-r--r--fs/coda/cache.c2
-rw-r--r--fs/coda/coda_linux.c2
-rw-r--r--fs/coda/dir.c2
-rw-r--r--fs/coda/file.c2
-rw-r--r--fs/coda/pioctl.c2
-rw-r--r--fs/coda/psdev.c2
-rw-r--r--fs/coda/symlink.c2
-rw-r--r--fs/coda/sysctl.c2
-rw-r--r--fs/coda/upcall.c2
-rw-r--r--fs/devfs/base.c2
-rw-r--r--fs/devices.c2
-rw-r--r--fs/dquot.c2
-rw-r--r--fs/driverfs/inode.c15
-rw-r--r--fs/efs/inode.c1
-rw-r--r--fs/exec.c1
-rw-r--r--fs/ext2/balloc.c484
-rw-r--r--fs/ext2/file.c2
-rw-r--r--fs/ext2/inode.c2
-rw-r--r--fs/ext2/ioctl.c2
-rw-r--r--fs/ext3/balloc.c2
-rw-r--r--fs/ext3/file.c2
-rw-r--r--fs/ext3/fsync.c2
-rw-r--r--fs/ext3/ialloc.c2
-rw-r--r--fs/ext3/inode.c2
-rw-r--r--fs/ext3/ioctl.c2
-rw-r--r--fs/ext3/namei.c2
-rw-r--r--fs/ext3/super.c2
-rw-r--r--fs/fat/dir.c2
-rw-r--r--fs/fat/file.c2
-rw-r--r--fs/fat/inode.c2
-rw-r--r--fs/fifo.c1
-rw-r--r--fs/file.c2
-rw-r--r--fs/file_table.c1
-rw-r--r--fs/filesystems.c3
-rw-r--r--fs/freevxfs/vxfs_lookup.c2
-rw-r--r--fs/hpfs/dir.c2
-rw-r--r--fs/hpfs/file.c2
-rw-r--r--fs/hpfs/hpfs_fn.h2
-rw-r--r--fs/hpfs/inode.c2
-rw-r--r--fs/intermezzo/cache.c2
-rw-r--r--fs/intermezzo/dcache.c2
-rw-r--r--fs/intermezzo/dir.c2
-rw-r--r--fs/intermezzo/file.c2
-rw-r--r--fs/intermezzo/journal_ext2.c2
-rw-r--r--fs/intermezzo/journal_ext3.c2
-rw-r--r--fs/intermezzo/journal_obdfs.c2
-rw-r--r--fs/intermezzo/journal_reiserfs.c2
-rw-r--r--fs/intermezzo/journal_xfs.c2
-rw-r--r--fs/intermezzo/methods.c2
-rw-r--r--fs/intermezzo/presto.c2
-rw-r--r--fs/intermezzo/psdev.c2
-rw-r--r--fs/intermezzo/super.c2
-rw-r--r--fs/intermezzo/sysctl.c2
-rw-r--r--fs/intermezzo/upcall.c2
-rw-r--r--fs/ioctl.c1
-rw-r--r--fs/isofs/compress.c2
-rw-r--r--fs/isofs/dir.c2
-rw-r--r--fs/isofs/inode.c2
-rw-r--r--fs/isofs/namei.c2
-rw-r--r--fs/isofs/rock.c2
-rw-r--r--fs/jbd/checkpoint.c2
-rw-r--r--fs/jbd/commit.c2
-rw-r--r--fs/jbd/journal.c3
-rw-r--r--fs/jbd/recovery.c2
-rw-r--r--fs/jbd/revoke.c2
-rw-r--r--fs/jbd/transaction.c2
-rw-r--r--fs/jffs/inode-v23.c2
-rw-r--r--fs/jffs/intrep.c2
-rw-r--r--fs/jffs/jffs_proc.c2
-rw-r--r--fs/jffs2/background.c2
-rw-r--r--fs/jffs2/dir.c2
-rw-r--r--fs/jffs2/gc.c2
-rw-r--r--fs/lockd/clntlock.c2
-rw-r--r--fs/lockd/lockd_syms.c2
-rw-r--r--fs/lockd/svc4proc.c2
-rw-r--r--fs/lockd/svcproc.c2
-rw-r--r--fs/lockd/svcshare.c2
-rw-r--r--fs/lockd/svcsubs.c2
-rw-r--r--fs/locks.c3
-rw-r--r--fs/msdos/namei.c2
-rw-r--r--fs/ncpfs/dir.c2
-rw-r--r--fs/ncpfs/file.c2
-rw-r--r--fs/ncpfs/inode.c2
-rw-r--r--fs/ncpfs/ioctl.c2
-rw-r--r--fs/ncpfs/mmap.c2
-rw-r--r--fs/ncpfs/sock.c2
-rw-r--r--fs/ncpfs/symlink.c2
-rw-r--r--fs/nfs/dir.c2
-rw-r--r--fs/nfs/file.c2
-rw-r--r--fs/nfs/flushd.c2
-rw-r--r--fs/nfs/inode.c2
-rw-r--r--fs/nfs/nfs2xdr.c2
-rw-r--r--fs/nfs/nfs3xdr.c2
-rw-r--r--fs/nfs/nfsroot.c2
-rw-r--r--fs/nfs/proc.c2
-rw-r--r--fs/nfs/read.c2
-rw-r--r--fs/nfs/symlink.c2
-rw-r--r--fs/nfsd/nfs3proc.c2
-rw-r--r--fs/nfsd/nfs3xdr.c2
-rw-r--r--fs/nfsd/nfscache.c2
-rw-r--r--fs/nfsd/nfsctl.c2
-rw-r--r--fs/nfsd/nfsproc.c2
-rw-r--r--fs/nfsd/nfssvc.c2
-rw-r--r--fs/nfsd/nfsxdr.c2
-rw-r--r--fs/nfsd/stats.c2
-rw-r--r--fs/nfsd/vfs.c2
-rw-r--r--fs/pipe.c1
-rw-r--r--fs/proc/array.c2
-rw-r--r--fs/proc/base.c2
-rw-r--r--fs/proc/generic.c2
-rw-r--r--fs/proc/inode.c2
-rw-r--r--fs/proc/kmsg.c3
-rw-r--r--fs/proc/proc_devtree.c2
-rw-r--r--fs/proc/proc_misc.c2
-rw-r--r--fs/proc/proc_tty.c2
-rw-r--r--fs/proc/root.c2
-rw-r--r--fs/qnx4/bitmap.c3
-rw-r--r--fs/qnx4/file.c2
-rw-r--r--fs/qnx4/fsync.c2
-rw-r--r--fs/qnx4/namei.c3
-rw-r--r--fs/readdir.c3
-rw-r--r--fs/reiserfs/bitmap.c2
-rw-r--r--fs/reiserfs/buffer2.c2
-rw-r--r--fs/reiserfs/do_balan.c2
-rw-r--r--fs/reiserfs/file.c2
-rw-r--r--fs/reiserfs/fix_node.c2
-rw-r--r--fs/reiserfs/ibalance.c2
-rw-r--r--fs/reiserfs/inode.c2
-rw-r--r--fs/reiserfs/ioctl.c2
-rw-r--r--fs/reiserfs/item_ops.c2
-rw-r--r--fs/reiserfs/journal.c2
-rw-r--r--fs/reiserfs/lbalance.c2
-rw-r--r--fs/reiserfs/namei.c2
-rw-r--r--fs/reiserfs/objectid.c2
-rw-r--r--fs/reiserfs/prints.c2
-rw-r--r--fs/reiserfs/procfs.c2
-rw-r--r--fs/reiserfs/stree.c2
-rw-r--r--fs/reiserfs/super.c2
-rw-r--r--fs/reiserfs/tail_conversion.c2
-rw-r--r--fs/select.c1
-rw-r--r--fs/smbfs/cache.c2
-rw-r--r--fs/smbfs/dir.c2
-rw-r--r--fs/smbfs/file.c2
-rw-r--r--fs/smbfs/inode.c2
-rw-r--r--fs/smbfs/ioctl.c2
-rw-r--r--fs/smbfs/sock.c3
-rw-r--r--fs/stat.c1
-rw-r--r--fs/udf/symlink.c2
-rw-r--r--fs/ufs/balloc.c2
-rw-r--r--fs/ufs/cylinder.c2
-rw-r--r--fs/ufs/dir.c2
-rw-r--r--fs/ufs/file.c2
-rw-r--r--fs/ufs/ialloc.c2
-rw-r--r--fs/ufs/inode.c2
-rw-r--r--fs/ufs/namei.c2
-rw-r--r--fs/ufs/super.c2
-rw-r--r--fs/ufs/truncate.c2
-rw-r--r--fs/umsdos/dir.c2
-rw-r--r--fs/umsdos/emd.c2
-rw-r--r--fs/umsdos/inode.c2
-rw-r--r--fs/umsdos/ioctl.c2
-rw-r--r--fs/umsdos/namei.c2
-rw-r--r--fs/umsdos/rdir.c2
-rw-r--r--include/asm-i386/io_apic.h1
-rw-r--r--include/asm-i386/uaccess.h1
-rw-r--r--include/linux/affs_fs_i.h2
-rw-r--r--include/linux/ax25.h2
-rw-r--r--include/linux/bfs_fs_i.h2
-rw-r--r--include/linux/capability.h1
-rw-r--r--include/linux/efs_fs.h1
-rw-r--r--include/linux/err.h29
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/fs.h23
-rw-r--r--include/linux/fs_struct.h3
-rw-r--r--include/linux/highmem.h1
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/inet.h2
-rw-r--r--include/linux/iso_fs_i.h2
-rw-r--r--include/linux/lp.h3
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/msdos_fs_i.h2
-rw-r--r--include/linux/namespace.h2
-rw-r--r--include/linux/quotaops.h4
-rw-r--r--include/linux/sched.h6
-rw-r--r--include/linux/shmem_fs.h14
-rw-r--r--include/linux/skbuff.h2
-rw-r--r--include/linux/smb.h1
-rw-r--r--include/linux/smb_fs_i.h1
-rw-r--r--include/linux/sound.h2
-rw-r--r--include/linux/sunrpc/svc.h1
-rw-r--r--include/linux/sunrpc/xdr.h1
-rw-r--r--include/linux/swap.h11
-rw-r--r--include/linux/time.h4
-rw-r--r--include/linux/timex.h1
-rw-r--r--include/linux/vmalloc.h1
-rw-r--r--include/net/neighbour.h2
-rw-r--r--include/net/scm.h2
-rw-r--r--include/net/sock.h2
-rw-r--r--kernel/exit.c1
-rw-r--r--kernel/fork.c2
-rw-r--r--kernel/ksyms.c1
-rw-r--r--kernel/module.c1
-rw-r--r--kernel/sched.c1
-rw-r--r--kernel/signal.c1
-rw-r--r--kernel/sys.c1
-rw-r--r--kernel/time.c1
-rw-r--r--mm/filemap.c1
-rw-r--r--mm/mprotect.c1
-rw-r--r--mm/mremap.c1
-rw-r--r--net/sunrpc/svcauth.c1
273 files changed, 617 insertions, 475 deletions
diff --git a/Makefile b/Makefile
index d45179ec6e3c..bf1060fc58ba 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 5
SUBLEVEL = 4
-EXTRAVERSION =-pre5
+EXTRAVERSION =-pre6
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index 16b69e8f6314..499b2fd70266 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -36,6 +36,7 @@
#include <linux/smp.h>
#include <linux/major.h>
#include <linux/smp_lock.h>
+#include <linux/fs.h>
#include <asm/processor.h>
#include <asm/msr.h>
diff --git a/arch/i386/kernel/init_task.c b/arch/i386/kernel/init_task.c
index d12703283443..f652f279b787 100644
--- a/arch/i386/kernel/init_task.c
+++ b/arch/i386/kernel/init_task.c
@@ -2,6 +2,7 @@
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/init_task.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index 18560356a40a..4d377eeeeedb 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -35,6 +35,7 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/major.h>
+#include <linux/fs.h>
#include <asm/processor.h>
#include <asm/msr.h>
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 142915bd3ea0..99710bb8bbcc 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -16,6 +16,7 @@
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/smp.h>
@@ -47,6 +48,7 @@
#endif
#include <linux/irq.h>
+#include <linux/err.h>
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
diff --git a/arch/i386/kernel/semaphore.c b/arch/i386/kernel/semaphore.c
index 09c0852e5a86..06bdf8a44986 100644
--- a/arch/i386/kernel/semaphore.c
+++ b/arch/i386/kernel/semaphore.c
@@ -14,6 +14,7 @@
*/
#include <linux/config.h>
#include <linux/sched.h>
+#include <linux/err.h>
#include <asm/semaphore.h>
/*
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 4a8b527c6792..978e3f5e9a53 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -9,6 +9,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
+#include <linux/err.h>
#undef DEBUG
diff --git a/drivers/base/fs.c b/drivers/base/fs.c
index 363ac8a1bcdc..39cf1fb509f7 100644
--- a/drivers/base/fs.c
+++ b/drivers/base/fs.c
@@ -9,6 +9,8 @@
#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/stat.h>
extern struct driver_file_entry * device_default_files[];
diff --git a/drivers/base/interface.c b/drivers/base/interface.c
index 61a3fa599656..f7698d3dfe5d 100644
--- a/drivers/base/interface.c
+++ b/drivers/base/interface.c
@@ -6,6 +6,8 @@
*/
#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/stat.h>
/**
* device_read_status - report some device information
diff --git a/drivers/char/agp/agpgart_be.c b/drivers/char/agp/agpgart_be.c
index 2f717b9111ea..3c4b24e1006a 100644
--- a/drivers/char/agp/agpgart_be.c
+++ b/drivers/char/agp/agpgart_be.c
@@ -2391,7 +2391,7 @@ static int amd_create_gatt_table(void)
agp_bridge.gatt_table_real = page_dir.real;
agp_bridge.gatt_table = page_dir.remapped;
- agp_bridge.gatt_bus_addr = virt_to_bus(page_dir.real);
+ agp_bridge.gatt_bus_addr = virt_to_phys(page_dir.real);
/* Get the address for the gart region.
* This is a bus address even on the alpha, b/c its
@@ -2405,7 +2405,7 @@ static int amd_create_gatt_table(void)
/* Calculate the agp offset */
for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
page_dir.remapped[GET_PAGE_DIR_OFF(addr)] =
- virt_to_bus(amd_irongate_private.gatt_pages[i]->real);
+ virt_to_phys(amd_irongate_private.gatt_pages[i]->real);
page_dir.remapped[GET_PAGE_DIR_OFF(addr)] |= 0x00000001;
}
@@ -3027,7 +3027,7 @@ static int serverworks_create_gatt_table(void)
for(i = 0; i < 1024; i++) {
serverworks_private.scratch_dir.remapped[i] = (unsigned long) agp_bridge.scratch_page;
page_dir.remapped[i] =
- virt_to_bus(serverworks_private.scratch_dir.real);
+ virt_to_phys(serverworks_private.scratch_dir.real);
page_dir.remapped[i] |= 0x00000001;
}
@@ -3040,7 +3040,7 @@ static int serverworks_create_gatt_table(void)
agp_bridge.gatt_table_real = page_dir.real;
agp_bridge.gatt_table = page_dir.remapped;
- agp_bridge.gatt_bus_addr = virt_to_bus(page_dir.real);
+ agp_bridge.gatt_bus_addr = virt_to_phys(page_dir.real);
/* Get the address for the gart region.
* This is a bus address even on the alpha, b/c its
@@ -3056,7 +3056,7 @@ static int serverworks_create_gatt_table(void)
for(i = 0; i < value->num_entries / 1024; i++) {
page_dir.remapped[i] =
- virt_to_bus(serverworks_private.gatt_pages[i]->real);
+ virt_to_phys(serverworks_private.gatt_pages[i]->real);
page_dir.remapped[i] |= 0x00000001;
}
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 656a38b22da7..0efd9b3ac7c1 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -251,6 +251,7 @@
#include <linux/random.h>
#include <linux/poll.h>
#include <linux/init.h>
+#include <linux/fs.h>
#include <asm/processor.h>
#include <asm/uaccess.h>
diff --git a/drivers/net/aironet4500_proc.c b/drivers/net/aironet4500_proc.c
index 1946e9c7a849..94a77d917cc7 100644
--- a/drivers/net/aironet4500_proc.c
+++ b/drivers/net/aironet4500_proc.c
@@ -33,15 +33,10 @@
#include <linux/if_arp.h>
#include <linux/ioport.h>
-
#ifdef CONFIG_PROC_FS
-#ifdef CONFIG_PROC_FS
#include <linux/sysctl.h>
-#else
-#error awc driver needs CONFIG_PROC_FS
-#endif
-
+#include <linux/fs.h>
#include "aironet4500.h"
#include "aironet4500_rid.c"
@@ -603,5 +598,8 @@ static void aironet_proc_exit(void){
module_init(aironet_proc_init);
module_exit(aironet_proc_exit);
+#else
+#error awc driver needs CONFIG_PROC_FS
+
#endif // whole proc system styff
MODULE_LICENSE("GPL");
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c
index a93784df6638..09afb2398861 100644
--- a/drivers/net/bsd_comp.c
+++ b/drivers/net/bsd_comp.c
@@ -73,6 +73,8 @@
#include <linux/ppp-comp.h>
#undef PACKETPTR
+#include <asm/byteorder.h>
+
/*
* PPP "BSD compress" compression
* The differences between this compression and the classic BSD LZW
diff --git a/drivers/pnp/pnpbios_core.c b/drivers/pnp/pnpbios_core.c
index d60ec7444a80..55a844e0566b 100644
--- a/drivers/pnp/pnpbios_core.c
+++ b/drivers/pnp/pnpbios_core.c
@@ -45,6 +45,7 @@
#include <linux/completion.h>
#include <linux/spinlock.h>
#include <asm/system.h>
+#include <asm/byteorder.h>
/*
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index a93ff6dd3d6a..b49fb0e75b98 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -58,7 +58,7 @@ static void BAD_DMA(void *address, unsigned int length)
{
printk(KERN_CRIT "buf vaddress %p paddress 0x%lx length %d\n",
address,
- SCSI_BUS_PA(address),
+ SCSI_BUF_PA(address),
length);
panic("Buffer at physical address > 16Mb used for aha1542");
}
@@ -68,7 +68,7 @@ static void BAD_SG_DMA(Scsi_Cmnd * SCpnt,
int nseg,
int badseg)
{
- printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%lx length %d\n",
+ printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%x length %d\n",
badseg, nseg,
page_address(sgpnt[badseg].page) + sgpnt[badseg].offset,
SCSI_SG_PA(&sgpnt[badseg]),
@@ -727,7 +727,7 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
panic("Foooooooood fight!");
};
any2scsi(cptr[i].dataptr, SCSI_SG_PA(&sgpnt[i]));
- if (SCSI_SG_PA(&sgpnt[i].page) + sgpnt[i].length - 1 > ISA_DMA_THRESHOLD)
+ if (SCSI_SG_PA(&sgpnt[i]) + sgpnt[i].length - 1 > ISA_DMA_THRESHOLD)
BAD_SG_DMA(SCpnt, sgpnt, SCpnt->use_sg, i);
any2scsi(cptr[i].datalen, sgpnt[i].length);
};
diff --git a/drivers/sound/cs4281/cs4281m.c b/drivers/sound/cs4281/cs4281m.c
index 6854d7041147..c67291e39cf9 100644
--- a/drivers/sound/cs4281/cs4281m.c
+++ b/drivers/sound/cs4281/cs4281m.c
@@ -75,6 +75,7 @@
#include <linux/poll.h>
#include <linux/smp_lock.h>
#include <linux/wrapper.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/hardirq.h>
//#include "cs_dm.h"
diff --git a/drivers/sound/opl3sa2.c b/drivers/sound/opl3sa2.c
index d8b25ed3ad90..bd52c74cb4bc 100644
--- a/drivers/sound/opl3sa2.c
+++ b/drivers/sound/opl3sa2.c
@@ -63,6 +63,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/isapnp.h>
+#include <linux/delay.h>
#include <linux/pm.h>
#include "sound_config.h"
diff --git a/drivers/sound/ymfpci.c b/drivers/sound/ymfpci.c
index 0b372c81047f..8614108b1c18 100644
--- a/drivers/sound/ymfpci.c
+++ b/drivers/sound/ymfpci.c
@@ -55,6 +55,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/ioport.h>
+#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/poll.h>
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index c8eb8d1e48c9..d58a3777e8e7 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -18,7 +18,7 @@
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
diff --git a/drivers/usb/acm.c b/drivers/usb/acm.c
index 77c42d87f551..381b4be68364 100644
--- a/drivers/usb/acm.c
+++ b/drivers/usb/acm.c
@@ -57,6 +57,7 @@
#include <linux/smp_lock.h>
#undef DEBUG
#include <linux/usb.h>
+#include <asm/byteorder.h>
/*
* Version Information
diff --git a/drivers/usb/auerswald.c b/drivers/usb/auerswald.c
index 4c4ef04926a2..cd1c936ff0a8 100644
--- a/drivers/usb/auerswald.c
+++ b/drivers/usb/auerswald.c
@@ -25,6 +25,7 @@
/* Standard Linux module include files */
#include <asm/uaccess.h>
+#include <asm/byteorder.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
diff --git a/drivers/usb/devio.c b/drivers/usb/devio.c
index eeb86671eef1..96cbc98b5cfc 100644
--- a/drivers/usb/devio.c
+++ b/drivers/usb/devio.c
@@ -44,6 +44,7 @@
#include <linux/usb.h>
#include <linux/usbdevice_fs.h>
#include <asm/uaccess.h>
+#include <asm/byteorder.h>
struct async {
diff --git a/drivers/usb/hcd.c b/drivers/usb/hcd.c
index 2f97c96bd105..265143a39d3c 100644
--- a/drivers/usb/hcd.c
+++ b/drivers/usb/hcd.c
@@ -50,6 +50,7 @@
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/unaligned.h>
+#include <asm/byteorder.h>
/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/hcd/ehci-hub.c b/drivers/usb/hcd/ehci-hub.c
index 798fd6066430..4a789564506d 100644
--- a/drivers/usb/hcd/ehci-hub.c
+++ b/drivers/usb/hcd/ehci-hub.c
@@ -18,6 +18,8 @@
/* this file is part of ehci-hcd.c */
+#include <asm/byteorder.h>
+
/*-------------------------------------------------------------------------*/
/*
diff --git a/drivers/usb/hcd/ehci-mem.c b/drivers/usb/hcd/ehci-mem.c
index b2ee617c6c8b..94fd675e5152 100644
--- a/drivers/usb/hcd/ehci-mem.c
+++ b/drivers/usb/hcd/ehci-mem.c
@@ -18,6 +18,8 @@
/* this file is part of ehci-hcd.c */
+#include <asm/byteorder.h>
+
/*-------------------------------------------------------------------------*/
/*
diff --git a/drivers/usb/hcd/ehci-q.c b/drivers/usb/hcd/ehci-q.c
index df6c07d3d6fe..1837e8b2c115 100644
--- a/drivers/usb/hcd/ehci-q.c
+++ b/drivers/usb/hcd/ehci-q.c
@@ -18,6 +18,8 @@
/* this file is part of ehci-hcd.c */
+#include <asm/byteorder.h>
+
/*-------------------------------------------------------------------------*/
/*
diff --git a/drivers/usb/hcd/ehci-sched.c b/drivers/usb/hcd/ehci-sched.c
index 62754b5a2bac..503032029767 100644
--- a/drivers/usb/hcd/ehci-sched.c
+++ b/drivers/usb/hcd/ehci-sched.c
@@ -20,6 +20,8 @@
/*-------------------------------------------------------------------------*/
+#include "ehci.h"
+
/*
* EHCI scheduled transaction support: interrupt, iso, split iso
* These are called "periodic" transactions in the EHCI spec.
diff --git a/drivers/usb/hcd/ohci-hcd.c b/drivers/usb/hcd/ohci-hcd.c
index 9dbceb3aaa03..9a05081e4e85 100644
--- a/drivers/usb/hcd/ohci-hcd.c
+++ b/drivers/usb/hcd/ohci-hcd.c
@@ -87,6 +87,7 @@
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/unaligned.h>
+#include <asm/byteorder.h>
#ifdef CONFIG_PMAC_PBOOK
#include <asm/machdep.h>
diff --git a/drivers/usb/hcd/ohci-q.c b/drivers/usb/hcd/ohci-q.c
index 642e84b7a023..ba17a661c3f9 100644
--- a/drivers/usb/hcd/ohci-q.c
+++ b/drivers/usb/hcd/ohci-q.c
@@ -7,6 +7,8 @@
* This file is licenced under the GPL.
* $Id: ohci-q.c,v 1.6 2002/01/19 00:23:15 dbrownell Exp $
*/
+
+#include <asm/byteorder.h>
static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv)
{
diff --git a/drivers/usb/hid-core.c b/drivers/usb/hid-core.c
index f9ebfa1f8687..670bcfcfae18 100644
--- a/drivers/usb/hid-core.c
+++ b/drivers/usb/hid-core.c
@@ -39,6 +39,7 @@
#include <linux/smp_lock.h>
#include <linux/spinlock.h>
#include <asm/unaligned.h>
+#include <asm/byteorder.h>
#include <linux/input.h>
#undef DEBUG
diff --git a/drivers/usb/inode.c b/drivers/usb/inode.c
index a541dd5eefe7..ad1147485ac3 100644
--- a/drivers/usb/inode.c
+++ b/drivers/usb/inode.c
@@ -37,6 +37,7 @@
#include <linux/usb.h>
#include <linux/usbdevice_fs.h>
#include <linux/smp_lock.h>
+#include <asm/byteorder.h>
static struct super_operations usbfs_ops;
static struct address_space_operations usbfs_aops;
diff --git a/drivers/usb/kaweth.c b/drivers/usb/kaweth.c
index 65cb2b123841..19f04a6ac7c8 100644
--- a/drivers/usb/kaweth.c
+++ b/drivers/usb/kaweth.c
@@ -55,6 +55,7 @@
#include <linux/usb.h>
#include <linux/types.h>
#include <asm/semaphore.h>
+#include <asm/byteorder.h>
#define DEBUG
diff --git a/drivers/usb/mdc800.c b/drivers/usb/mdc800.c
index eb3d1df911cb..542d56c758c8 100644
--- a/drivers/usb/mdc800.c
+++ b/drivers/usb/mdc800.c
@@ -98,6 +98,7 @@
#include <linux/smp_lock.h>
#include <linux/usb.h>
+#include <linux/fs.h>
/*
* Version Information
diff --git a/drivers/usb/pegasus.c b/drivers/usb/pegasus.c
index 02e1a8e84f27..7e04aafd4273 100644
--- a/drivers/usb/pegasus.c
+++ b/drivers/usb/pegasus.c
@@ -48,6 +48,7 @@
#include <linux/etherdevice.h>
#include <linux/usb.h>
#include <linux/module.h>
+#include <asm/byteorder.h>
#include "pegasus.h"
/*
diff --git a/drivers/usb/scanner.c b/drivers/usb/scanner.c
index 8b262b83c275..f9ad345ed1e7 100644
--- a/drivers/usb/scanner.c
+++ b/drivers/usb/scanner.c
@@ -328,6 +328,8 @@
* 24 Bit Color ~ 70 secs - 3.6 Mbit/sec
* 8 Bit Gray ~ 17 secs - 4.2 Mbit/sec */
+#include <asm/byteorder.h>
+
/*
* Scanner definitions, macros, module info,
* debug/ioctl/data_dump enable, and other constants.
diff --git a/drivers/usb/usb-ohci.c b/drivers/usb/usb-ohci.c
index 29384b44989a..63fb3a7b1d15 100644
--- a/drivers/usb/usb-ohci.c
+++ b/drivers/usb/usb-ohci.c
@@ -68,6 +68,7 @@
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/unaligned.h>
+#include <asm/byteorder.h>
#define OHCI_USE_NPS // force NoPowerSwitching mode
// #define OHCI_VERBOSE_DEBUG /* not always helpful */
diff --git a/drivers/usb/usb-uhci.c b/drivers/usb/usb-uhci.c
index 6d332d305ce7..2f38a19857de 100644
--- a/drivers/usb/usb-uhci.c
+++ b/drivers/usb/usb-uhci.c
@@ -40,6 +40,7 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/system.h>
+#include <asm/byteorder.h>
/* This enables more detailed sanity checks in submit_iso */
//#define ISO_SANITY_CHECK
diff --git a/drivers/usb/usb.c b/drivers/usb/usb.c
index be9fa8a786d5..d6d446e84d86 100644
--- a/drivers/usb/usb.c
+++ b/drivers/usb/usb.c
@@ -31,6 +31,7 @@
#include <linux/init.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/spinlock.h>
+#include <asm/byteorder.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index cb6304a1d7ca..f41160b2355b 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -14,7 +14,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/adfs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/spinlock.h>
diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c
index 66a0c36a74fb..7ca21e16ac05 100644
--- a/fs/adfs/dir_f.c
+++ b/fs/adfs/dir_f.c
@@ -13,7 +13,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/adfs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/spinlock.h>
diff --git a/fs/adfs/dir_fplus.c b/fs/adfs/dir_fplus.c
index 71064bc55150..ff901161423d 100644
--- a/fs/adfs/dir_fplus.c
+++ b/fs/adfs/dir_fplus.c
@@ -11,7 +11,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/adfs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/spinlock.h>
diff --git a/fs/adfs/file.c b/fs/adfs/file.c
index c00ebea8b14c..9ab958b9abee 100644
--- a/fs/adfs/file.c
+++ b/fs/adfs/file.c
@@ -23,7 +23,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/fcntl.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include "adfs.h"
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index f757844ebb8a..660dc4b16387 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -11,7 +11,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/adfs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index 8a0ce050c196..58912a4fd844 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -13,7 +13,7 @@
#include <linux/fs.h>
#include <linux/adfs_fs.h>
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
index bf53d87351e5..d0532a67af60 100644
--- a/fs/affs/amigaffs.c
+++ b/fs/affs/amigaffs.c
@@ -10,7 +10,7 @@
#include <stdarg.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/affs_fs.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/affs/bitmap.c b/fs/affs/bitmap.c
index 919309b100b1..1726db8a09a8 100644
--- a/fs/affs/bitmap.c
+++ b/fs/affs/bitmap.c
@@ -7,7 +7,7 @@
* block allocation, deallocation, calculation of free space.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/affs_fs.h>
#include <linux/stat.h>
#include <linux/kernel.h>
diff --git a/fs/affs/file.c b/fs/affs/file.c
index 510dffaf9c67..de3d019352a3 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -15,7 +15,7 @@
#include <asm/div64.h>
#include <asm/uaccess.h>
#include <asm/system.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/affs_fs.h>
#include <linux/fcntl.h>
#include <linux/kernel.h>
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index b804256a8da5..83e4ce9dd53d 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -15,7 +15,7 @@
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/affs_fs.h>
#include <linux/kernel.h>
#include <linux/mm.h>
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index cd32c3b8150b..b5eb611fc6ee 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -8,7 +8,7 @@
* (C) 1991 Linus Torvalds - minix filesystem
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/affs_fs.h>
#include <linux/kernel.h>
#include <linux/string.h>
diff --git a/fs/affs/super.c b/fs/affs/super.c
index ecf11f3de023..3d0b3824db45 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -15,7 +15,7 @@
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/affs_fs.h>
#include <linux/kernel.h>
#include <linux/mm.h>
diff --git a/fs/attr.c b/fs/attr.c
index eccf21e16ec7..acd18b0b2dce 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -5,7 +5,7 @@
* changes by Thomas Schoebel-Theuer
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/smp_lock.h>
diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index 354af8325576..51e754d5c70c 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -20,7 +20,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/string.h>
#include <linux/wait.h>
#include <asm/uaccess.h>
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index fe3db57a046e..66512c830722 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -13,7 +13,7 @@
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/param.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/smp_lock.h>
#include "autofs_i.h"
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index c7da7f518f05..b70b72d84072 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -11,7 +11,7 @@
* ------------------------------------------------------------------------- */
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/signal.h>
#include <linux/file.h>
#include "autofs_i.h"
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 7e43620bca87..e1c4fb912f7f 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -21,7 +21,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/string.h>
#include <linux/wait.h>
#include <asm/uaccess.h>
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 2a1a29b93d7a..09423a1afee3 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -14,7 +14,7 @@
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/param.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/smp_lock.h>
#include "autofs_i.h"
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 9e5fe900fa4c..74c010997c59 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -11,7 +11,7 @@
* ------------------------------------------------------------------------- */
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/signal.h>
#include <linux/file.h>
#include "autofs_i.h"
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 2ff8ae8f2a67..e44c02ac2283 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -8,7 +8,7 @@
#include <linux/fs.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
/*
* The follow_link operation is special: it must behave as a no-op
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index cc46c91705f6..6445ca7e6ddf 100644
--- a/fs/bfs/dir.c
+++ b/fs/bfs/dir.c
@@ -4,7 +4,7 @@
* Copyright (C) 1999,2000 Tigran Aivazian <tigran@veritas.com>
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/string.h>
#include <linux/bfs_fs.h>
#include <linux/locks.h>
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index 9f8a58578b8c..018cfc13bb6e 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -6,7 +6,7 @@
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/mman.h>
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index b73559da90cd..00830386641c 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -13,7 +13,7 @@
#include <linux/fs.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/a.out.h>
diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c
index 2348332e4880..5121800fced0 100644
--- a/fs/binfmt_script.c
+++ b/fs/binfmt_script.c
@@ -13,6 +13,8 @@
#include <linux/init.h>
#include <linux/file.h>
#include <linux/smp_lock.h>
+#include <linux/err.h>
+#include <linux/fs.h>
static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
{
diff --git a/fs/buffer.c b/fs/buffer.c
index 866a5a41f905..0aef10bb45f2 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -29,7 +29,7 @@
/* async buffer flushing, 1999 Andrea Arcangeli <andrea@suse.de> */
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/locks.h>
diff --git a/fs/coda/cache.c b/fs/coda/cache.c
index 03ab04df4477..2b2d3fbd12f8 100644
--- a/fs/coda/cache.c
+++ b/fs/coda/cache.c
@@ -9,7 +9,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c
index 837072a79114..935fc18a97ea 100644
--- a/fs/coda/coda_linux.c
+++ b/fs/coda/coda_linux.c
@@ -10,7 +10,7 @@
#include <linux/version.h>
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 782f017ff7d0..bd9acec25b0f 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -10,7 +10,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/stat.h>
diff --git a/fs/coda/file.c b/fs/coda/file.c
index d3bc9a225c11..eeee82fbbb58 100644
--- a/fs/coda/file.c
+++ b/fs/coda/file.c
@@ -9,7 +9,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/stat.h>
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c
index 861a87741e40..cc29c5ec7db1 100644
--- a/fs/coda/pioctl.c
+++ b/fs/coda/pioctl.c
@@ -9,7 +9,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index add25fd1c6af..086622107920 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -21,7 +21,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/major.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/lp.h>
#include <linux/slab.h>
#include <linux/ioport.h>
diff --git a/fs/coda/symlink.c b/fs/coda/symlink.c
index f3318b82bd0e..15dc80abfbe7 100644
--- a/fs/coda/symlink.c
+++ b/fs/coda/symlink.c
@@ -9,7 +9,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c
index 231b7713ba3c..9491772ca9ba 100644
--- a/fs/coda/sysctl.c
+++ b/fs/coda/sysctl.c
@@ -12,7 +12,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/sysctl.h>
#include <linux/swapctl.h>
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index 9c87ee4de9e3..ea22075e39bb 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -21,7 +21,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/mm.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/stat.h>
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index 6372557356d9..0d595669d468 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -615,7 +615,7 @@
*/
#include <linux/types.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/tty.h>
#include <linux/timer.h>
#include <linux/config.h>
diff --git a/fs/devices.c b/fs/devices.c
index e859ba71db84..0447d805a77e 100644
--- a/fs/devices.c
+++ b/fs/devices.c
@@ -13,7 +13,7 @@
#include <linux/fs.h>
#include <linux/major.h>
#include <linux/string.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/errno.h>
diff --git a/fs/dquot.c b/fs/dquot.c
index a9a697a0a08a..2e4d5922f319 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -51,7 +51,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/fcntl.h>
diff --git a/fs/driverfs/inode.c b/fs/driverfs/inode.c
index 9502dc7cd85d..94d8b0d4e4a3 100644
--- a/fs/driverfs/inode.c
+++ b/fs/driverfs/inode.c
@@ -701,7 +701,8 @@ static void __remove_file(struct dentry * dentry)
vfs_unlink(dentry->d_parent->d_inode,dentry);
- unlock_dir(dentry);
+ up(&dentry->d_inode->i_sem);
+ dput(dentry);
/* remove reference count from when file was created */
dput(dentry);
@@ -741,7 +742,8 @@ void driverfs_remove_file(struct driver_dir_entry * dir, const char * name)
}
node = node->next;
}
- unlock_dir(dentry);
+ up(&dentry->d_inode->i_sem);
+ dput(dentry);
}
/**
@@ -760,8 +762,9 @@ void driverfs_remove_dir(struct driver_dir_entry * dir)
if (!dir->dentry)
goto done;
- /* lock the directory while we remove the files */
dentry = dget(dir->dentry);
+ dget(dentry->d_parent);
+ down(&dentry->d_parent->d_inode->i_sem);
down(&dentry->d_inode->i_sem);
node = dir->files.next;
@@ -776,11 +779,9 @@ void driverfs_remove_dir(struct driver_dir_entry * dir)
node = dir->files.next;
}
- /* now lock the parent, so we can remove this directory */
- lock_parent(dentry);
-
vfs_rmdir(dentry->d_parent->d_inode,dentry);
- double_unlock(dentry,dentry->d_parent);
+ up(&dentry->d_parent->d_inode->i_sem);
+ up(&dentry->d_inode->i_sem);
/* remove reference count from when directory was created */
dput(dentry);
diff --git a/fs/efs/inode.c b/fs/efs/inode.c
index 67d050f22783..4af8ea9eb8c5 100644
--- a/fs/efs/inode.c
+++ b/fs/efs/inode.c
@@ -10,6 +10,7 @@
#include <linux/efs_fs.h>
#include <linux/efs_fs_sb.h>
#include <linux/module.h>
+#include <linux/fs.h>
extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
diff --git a/fs/exec.c b/fs/exec.c
index 0167e7c5b891..26f9df878d78 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -35,6 +35,7 @@
#include <linux/highmem.h>
#include <linux/spinlock.h>
#include <linux/personality.h>
+#include <linux/binfmts.h>
#define __NO_VERSION__
#include <linux/module.h>
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 5d3f1486f2a2..92e672ac8b26 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -32,15 +32,15 @@
*/
-#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
+#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
unsigned int block_group,
struct buffer_head ** bh)
{
unsigned long group_desc;
- unsigned long desc;
- struct ext2_group_desc * gdp;
+ unsigned long offset;
+ struct ext2_group_desc * desc;
struct ext2_sb_info *sbi = &sb->u.ext2_sb;
if (block_group >= sbi->s_groups_count) {
@@ -53,19 +53,19 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
}
group_desc = block_group / EXT2_DESC_PER_BLOCK(sb);
- desc = block_group % EXT2_DESC_PER_BLOCK(sb);
+ offset = block_group % EXT2_DESC_PER_BLOCK(sb);
if (!sbi->s_group_desc[group_desc]) {
ext2_error (sb, "ext2_get_group_desc",
"Group descriptor not loaded - "
"block_group = %d, group_desc = %lu, desc = %lu",
- block_group, group_desc, desc);
+ block_group, group_desc, offset);
return NULL;
}
- gdp = (struct ext2_group_desc *) sbi->s_group_desc[group_desc]->b_data;
+ desc = (struct ext2_group_desc *) sbi->s_group_desc[group_desc]->b_data;
if (bh)
*bh = sbi->s_group_desc[group_desc];
- return gdp + desc;
+ return desc + offset;
}
/*
@@ -78,18 +78,18 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
static struct buffer_head *read_block_bitmap(struct super_block *sb,
unsigned int block_group)
{
- struct ext2_group_desc * gdp;
+ struct ext2_group_desc * desc;
struct buffer_head * bh = NULL;
- gdp = ext2_get_group_desc (sb, block_group, NULL);
- if (!gdp)
+ desc = ext2_get_group_desc (sb, block_group, NULL);
+ if (!desc)
goto error_out;
- bh = sb_bread(sb, le32_to_cpu(gdp->bg_block_bitmap));
+ bh = sb_bread(sb, le32_to_cpu(desc->bg_block_bitmap));
if (!bh)
ext2_error (sb, "read_block_bitmap",
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %lu",
- block_group, (unsigned long) gdp->bg_block_bitmap);
+ block_group, (unsigned long) desc->bg_block_bitmap);
error_out:
return bh;
}
@@ -135,7 +135,7 @@ static struct buffer_head *load_block_bitmap(struct super_block * sb,
goto read_it;
if (sbi->s_block_bitmap_number[slot] == slot)
goto found;
- ext2_panic (sb, "__load_block_bitmap",
+ ext2_panic (sb, "load_block_bitmap",
"block_group != block_bitmap_number");
}
@@ -166,6 +166,73 @@ found:
return bh;
}
+static inline int reserve_blocks(struct super_block *sb, int count)
+{
+ struct ext2_sb_info * sbi = EXT2_SB(sb);
+ struct ext2_super_block * es = sbi->s_es;
+ unsigned free_blocks = le32_to_cpu(es->s_free_blocks_count);
+ unsigned root_blocks = le32_to_cpu(es->s_r_blocks_count);
+
+ if (free_blocks < count)
+ count = free_blocks;
+
+ if (free_blocks < root_blocks + count && !capable(CAP_SYS_RESOURCE) &&
+ sbi->s_resuid != current->fsuid &&
+ (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
+ /*
+ * We are too close to reserve and we are not privileged.
+ * Can we allocate anything at all?
+ */
+ if (free_blocks > root_blocks)
+ count = free_blocks - root_blocks;
+ else
+ return 0;
+ }
+
+ es->s_free_blocks_count = cpu_to_le32(free_blocks - count);
+ mark_buffer_dirty(sbi->s_sbh);
+ sb->s_dirt = 1;
+ return count;
+}
+
+static inline void release_blocks(struct super_block *sb, int count)
+{
+ if (count) {
+ struct ext2_sb_info * sbi = EXT2_SB(sb);
+ struct ext2_super_block * es = sbi->s_es;
+ unsigned free_blocks = le32_to_cpu(es->s_free_blocks_count);
+ es->s_free_blocks_count = cpu_to_le32(free_blocks + count);
+ mark_buffer_dirty(sbi->s_sbh);
+ sb->s_dirt = 1;
+ }
+}
+
+static inline int group_reserve_blocks(struct ext2_group_desc *desc,
+ struct buffer_head *bh, int count)
+{
+ unsigned free_blocks;
+
+ if (!desc->bg_free_blocks_count)
+ return 0;
+
+ free_blocks = le16_to_cpu(desc->bg_free_blocks_count);
+ if (free_blocks < count)
+ count = free_blocks;
+ desc->bg_free_blocks_count = cpu_to_le16(free_blocks - count);
+ mark_buffer_dirty(bh);
+ return count;
+}
+
+static inline void group_release_blocks(struct ext2_group_desc *desc,
+ struct buffer_head *bh, int count)
+{
+ if (count) {
+ unsigned free_blocks = le16_to_cpu(desc->bg_free_blocks_count);
+ desc->bg_free_blocks_count = cpu_to_le16(free_blocks + count);
+ mark_buffer_dirty(bh);
+ }
+}
+
/* Free given blocks, update quota and i_blocks field */
void ext2_free_blocks (struct inode * inode, unsigned long block,
unsigned long count)
@@ -176,15 +243,11 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
unsigned long bit;
unsigned long i;
unsigned long overflow;
- struct super_block * sb;
- struct ext2_group_desc * gdp;
+ struct super_block * sb = inode->i_sb;
+ struct ext2_group_desc * desc;
struct ext2_super_block * es;
+ unsigned freed = 0, group_freed;
- sb = inode->i_sb;
- if (!sb) {
- printk ("ext2_free_blocks: nonexistent device");
- return;
- }
lock_super (sb);
es = sb->u.ext2_sb.s_es;
if (block < le32_to_cpu(es->s_first_data_block) ||
@@ -214,53 +277,99 @@ do_more:
bh = load_block_bitmap (sb, block_group);
if (IS_ERR(bh))
goto error_return;
-
- gdp = ext2_get_group_desc (sb, block_group, &bh2);
- if (!gdp)
+
+ desc = ext2_get_group_desc (sb, block_group, &bh2);
+ if (!desc)
goto error_return;
- if (in_range (le32_to_cpu(gdp->bg_block_bitmap), block, count) ||
- in_range (le32_to_cpu(gdp->bg_inode_bitmap), block, count) ||
- in_range (block, le32_to_cpu(gdp->bg_inode_table),
+ if (in_range (le32_to_cpu(desc->bg_block_bitmap), block, count) ||
+ in_range (le32_to_cpu(desc->bg_inode_bitmap), block, count) ||
+ in_range (block, le32_to_cpu(desc->bg_inode_table),
sb->u.ext2_sb.s_itb_per_group) ||
- in_range (block + count - 1, le32_to_cpu(gdp->bg_inode_table),
+ in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table),
sb->u.ext2_sb.s_itb_per_group))
ext2_error (sb, "ext2_free_blocks",
"Freeing blocks in system zones - "
"Block = %lu, count = %lu",
block, count);
- for (i = 0; i < count; i++) {
+ for (i = 0, group_freed = 0; i < count; i++) {
if (!ext2_clear_bit (bit + i, bh->b_data))
ext2_error (sb, "ext2_free_blocks",
"bit already cleared for block %lu",
block + i);
- else {
- DQUOT_FREE_BLOCK(inode, 1);
- gdp->bg_free_blocks_count =
- cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count)+1);
- es->s_free_blocks_count =
- cpu_to_le32(le32_to_cpu(es->s_free_blocks_count)+1);
- }
+ else
+ group_freed++;
}
-
- mark_buffer_dirty(bh2);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
mark_buffer_dirty(bh);
if (sb->s_flags & MS_SYNCHRONOUS) {
ll_rw_block (WRITE, 1, &bh);
wait_on_buffer (bh);
}
+
+ group_release_blocks(desc, bh2, group_freed);
+ freed += group_freed;
+
if (overflow) {
block += count;
count = overflow;
goto do_more;
}
- sb->s_dirt = 1;
error_return:
+ release_blocks(sb, freed);
unlock_super (sb);
- return;
+ DQUOT_FREE_BLOCK(inode, freed);
+}
+
+static int grab_block(char *map, unsigned size, int goal)
+{
+ int k;
+ char *p, *r;
+
+ if (!ext2_test_bit(goal, map))
+ goto got_it;
+ if (goal) {
+ /*
+ * The goal was occupied; search forward for a free
+ * block within the next XX blocks.
+ *
+ * end_goal is more or less random, but it has to be
+ * less than EXT2_BLOCKS_PER_GROUP. Aligning up to the
+ * next 64-bit boundary is simple..
+ */
+ k = (goal + 63) & ~63;
+ goal = ext2_find_next_zero_bit(map, k, goal);
+ if (goal < k)
+ goto got_it;
+ /*
+ * Search in the remainder of the current group.
+ */
+ }
+
+ p = map + (goal >> 3);
+ r = memscan(p, 0, (size - goal + 7) >> 3);
+ k = (r - map) << 3;
+ if (k < size) {
+ /*
+ * We have succeeded in finding a free byte in the block
+ * bitmap. Now search backwards to find the start of this
+ * group of free blocks - won't take more than 7 iterations.
+ */
+ for (goal = k; goal && !ext2_test_bit (goal - 1, map); goal--)
+ ;
+ goto got_it;
+ }
+
+ k = ext2_find_next_zero_bit ((u32 *)map, size, goal);
+ if (k < size) {
+ goal = k;
+ goto got_it;
+ }
+ return -1;
+got_it:
+ ext2_set_bit(goal, map);
+ return goal;
}
/*
@@ -274,224 +383,148 @@ error_return:
int ext2_new_block (struct inode * inode, unsigned long goal,
u32 * prealloc_count, u32 * prealloc_block, int * err)
{
- struct buffer_head * bh;
- struct buffer_head * bh2;
- char * p, * r;
+ struct buffer_head *bh;
+ struct buffer_head *bh2;
+ struct ext2_group_desc *desc;
int i, j, k, tmp;
- struct super_block * sb;
- struct ext2_group_desc * gdp;
- struct ext2_super_block * es;
-#ifdef EXT2FS_DEBUG
- static int goal_hits = 0, goal_attempts = 0;
-#endif
+ int block = 0;
+ struct super_block *sb = inode->i_sb;
+ struct ext2_sb_info *sbi = EXT2_SB(sb);
+ struct ext2_super_block *es = sbi->s_es;
+ unsigned group_size = EXT2_BLOCKS_PER_GROUP(sb);
+ unsigned prealloc_goal = es->s_prealloc_blocks;
+ unsigned group_alloc = 0, es_alloc, dq_alloc;
+
+ if (!prealloc_goal--)
+ prealloc_goal = EXT2_DEFAULT_PREALLOC_BLOCKS - 1;
+ if (!prealloc_count || *prealloc_count)
+ prealloc_goal = 0;
+
+ *err = -EDQUOT;
+ if (DQUOT_ALLOC_BLOCK(inode, 1))
+ goto out;
+
+ while (prealloc_goal && !DQUOT_PREALLOC_BLOCK(inode, prealloc_goal))
+ prealloc_goal--;
+
+ dq_alloc = prealloc_goal + 1;
+
*err = -ENOSPC;
- sb = inode->i_sb;
- if (!sb) {
- printk ("ext2_new_block: nonexistent device");
- return 0;
- }
lock_super (sb);
- es = sb->u.ext2_sb.s_es;
- if (le32_to_cpu(es->s_free_blocks_count) <= le32_to_cpu(es->s_r_blocks_count) &&
- ((sb->u.ext2_sb.s_resuid != current->fsuid) &&
- (sb->u.ext2_sb.s_resgid == 0 ||
- !in_group_p (sb->u.ext2_sb.s_resgid)) &&
- !capable(CAP_SYS_RESOURCE)))
- goto out;
+
+ es_alloc = reserve_blocks(sb, dq_alloc);
+ if (!es_alloc)
+ goto out_unlock;
ext2_debug ("goal=%lu.\n", goal);
-repeat:
- /*
- * First, test whether the goal block is free.
- */
if (goal < le32_to_cpu(es->s_first_data_block) ||
goal >= le32_to_cpu(es->s_blocks_count))
goal = le32_to_cpu(es->s_first_data_block);
- i = (goal - le32_to_cpu(es->s_first_data_block)) / EXT2_BLOCKS_PER_GROUP(sb);
- gdp = ext2_get_group_desc (sb, i, &bh2);
- if (!gdp)
+ i = (goal - le32_to_cpu(es->s_first_data_block)) / group_size;
+ desc = ext2_get_group_desc (sb, i, &bh2);
+ if (!desc)
goto io_error;
- if (le16_to_cpu(gdp->bg_free_blocks_count) > 0) {
- j = ((goal - le32_to_cpu(es->s_first_data_block)) % EXT2_BLOCKS_PER_GROUP(sb));
-#ifdef EXT2FS_DEBUG
- if (j)
- goal_attempts++;
-#endif
+ group_alloc = group_reserve_blocks(desc, bh2, es_alloc);
+ if (group_alloc) {
+ j = ((goal - le32_to_cpu(es->s_first_data_block)) % group_size);
bh = load_block_bitmap (sb, i);
if (IS_ERR(bh))
goto io_error;
ext2_debug ("goal is at %d:%d.\n", i, j);
- if (!ext2_test_bit(j, bh->b_data)) {
- ext2_debug("goal bit allocated, %d hits\n",++goal_hits);
+ j = grab_block(bh->b_data, group_size, j);
+ if (j >= 0)
goto got_block;
- }
- if (j) {
- /*
- * The goal was occupied; search forward for a free
- * block within the next XX blocks.
- *
- * end_goal is more or less random, but it has to be
- * less than EXT2_BLOCKS_PER_GROUP. Aligning up to the
- * next 64-bit boundary is simple..
- */
- int end_goal = (j + 63) & ~63;
- j = ext2_find_next_zero_bit(bh->b_data, end_goal, j);
- if (j < end_goal)
- goto got_block;
- }
-
- ext2_debug ("Bit not found near goal\n");
-
- /*
- * There has been no free block found in the near vicinity
- * of the goal: do a search forward through the block groups,
- * searching in each group first for an entire free byte in
- * the bitmap and then for any free bit.
- *
- * Search first in the remainder of the current group; then,
- * cyclicly search through the rest of the groups.
- */
- p = ((char *) bh->b_data) + (j >> 3);
- r = memscan(p, 0, (EXT2_BLOCKS_PER_GROUP(sb) - j + 7) >> 3);
- k = (r - ((char *) bh->b_data)) << 3;
- if (k < EXT2_BLOCKS_PER_GROUP(sb)) {
- j = k;
- goto search_back;
- }
-
- k = ext2_find_next_zero_bit ((unsigned long *) bh->b_data,
- EXT2_BLOCKS_PER_GROUP(sb),
- j);
- if (k < EXT2_BLOCKS_PER_GROUP(sb)) {
- j = k;
- goto got_block;
- }
+ group_release_blocks(desc, bh2, group_alloc);
+ group_alloc = 0;
}
ext2_debug ("Bit not found in block group %d.\n", i);
/*
* Now search the rest of the groups. We assume that
- * i and gdp correctly point to the last group visited.
+ * i and desc correctly point to the last group visited.
*/
- for (k = 0; k < sb->u.ext2_sb.s_groups_count; k++) {
+ for (k = 0; !group_alloc && k < sbi->s_groups_count; k++) {
i++;
- if (i >= sb->u.ext2_sb.s_groups_count)
+ if (i >= sbi->s_groups_count)
i = 0;
- gdp = ext2_get_group_desc (sb, i, &bh2);
- if (!gdp)
+ desc = ext2_get_group_desc (sb, i, &bh2);
+ if (!desc)
goto io_error;
- if (le16_to_cpu(gdp->bg_free_blocks_count) > 0)
- break;
+ group_alloc = group_reserve_blocks(desc, bh2, es_alloc);
}
- if (k >= sb->u.ext2_sb.s_groups_count)
- goto out;
+ if (k >= sbi->s_groups_count)
+ goto out_release;
bh = load_block_bitmap (sb, i);
if (IS_ERR(bh))
goto io_error;
- r = memscan(bh->b_data, 0, EXT2_BLOCKS_PER_GROUP(sb) >> 3);
- j = (r - bh->b_data) << 3;
- if (j < EXT2_BLOCKS_PER_GROUP(sb))
- goto search_back;
- else
- j = ext2_find_first_zero_bit ((unsigned long *) bh->b_data,
- EXT2_BLOCKS_PER_GROUP(sb));
- if (j >= EXT2_BLOCKS_PER_GROUP(sb)) {
+ j = grab_block(bh->b_data, group_size, 0);
+ if (j < 0) {
ext2_error (sb, "ext2_new_block",
"Free blocks count corrupted for block group %d", i);
- goto out;
+ group_alloc = 0;
+ goto out_release;
}
-search_back:
- /*
- * We have succeeded in finding a free byte in the block
- * bitmap. Now search backwards up to 7 bits to find the
- * start of this group of free blocks.
- */
- for (k = 0; k < 7 && j > 0 && !ext2_test_bit (j - 1, bh->b_data); k++, j--);
-
got_block:
+ ext2_debug("using block group %d(%d)\n", i, desc->bg_free_blocks_count);
- ext2_debug ("using block group %d(%d)\n", i, gdp->bg_free_blocks_count);
-
- /*
- * Check quota for allocation of this block.
- */
- if(DQUOT_ALLOC_BLOCK(inode, 1)) {
- *err = -EDQUOT;
- goto out;
- }
-
- tmp = j + i * EXT2_BLOCKS_PER_GROUP(sb) + le32_to_cpu(es->s_first_data_block);
+ tmp = j + i * group_size + le32_to_cpu(es->s_first_data_block);
- if (tmp == le32_to_cpu(gdp->bg_block_bitmap) ||
- tmp == le32_to_cpu(gdp->bg_inode_bitmap) ||
- in_range (tmp, le32_to_cpu(gdp->bg_inode_table),
- sb->u.ext2_sb.s_itb_per_group))
+ if (tmp == le32_to_cpu(desc->bg_block_bitmap) ||
+ tmp == le32_to_cpu(desc->bg_inode_bitmap) ||
+ in_range (tmp, le32_to_cpu(desc->bg_inode_table),
+ sbi->s_itb_per_group))
ext2_error (sb, "ext2_new_block",
"Allocating block in system zone - "
"block = %u", tmp);
- if (ext2_set_bit (j, bh->b_data)) {
- ext2_warning (sb, "ext2_new_block",
- "bit already set for block %d", j);
- DQUOT_FREE_BLOCK(inode, 1);
- goto repeat;
+ if (tmp >= le32_to_cpu(es->s_blocks_count)) {
+ ext2_error (sb, "ext2_new_block",
+ "block(%d) >= blocks count(%d) - "
+ "block_group = %d, es == %p ",j,
+ le32_to_cpu(es->s_blocks_count), i, es);
+ goto out_release;
}
+ block = tmp;
+ /* OK, we _had_ allocated something */
ext2_debug ("found bit %d\n", j);
+ dq_alloc--;
+ es_alloc--;
+ group_alloc--;
+
/*
* Do block preallocation now if required.
*/
-#ifdef EXT2_PREALLOCATE
/* Writer: ->i_prealloc* */
- if (prealloc_count && !*prealloc_count) {
- int prealloc_goal;
- unsigned long next_block = tmp + 1;
-
- prealloc_goal = es->s_prealloc_blocks ?
- es->s_prealloc_blocks : EXT2_DEFAULT_PREALLOC_BLOCKS;
+ if (group_alloc && !*prealloc_count) {
+ unsigned long next_block = block + 1;
*prealloc_block = next_block;
/* Writer: end */
- for (k = 1;
- k < prealloc_goal && (j + k) < EXT2_BLOCKS_PER_GROUP(sb);
- k++, next_block++) {
- if (DQUOT_PREALLOC_BLOCK(inode, 1))
- break;
+ while (group_alloc && ++j < group_size) {
/* Writer: ->i_prealloc* */
if (*prealloc_block + *prealloc_count != next_block ||
- ext2_set_bit (j + k, bh->b_data)) {
+ ext2_set_bit (j, bh->b_data)) {
/* Writer: end */
- DQUOT_FREE_BLOCK(inode, 1);
break;
}
(*prealloc_count)++;
/* Writer: end */
+ next_block++;
+ es_alloc--;
+ dq_alloc--;
+ group_alloc--;
}
- /*
- * As soon as we go for per-group spinlocks we'll need these
- * done inside the loop above.
- */
- gdp->bg_free_blocks_count =
- cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count) -
- (k - 1));
- es->s_free_blocks_count =
- cpu_to_le32(le32_to_cpu(es->s_free_blocks_count) -
- (k - 1));
- ext2_debug ("Preallocated a further %lu bits.\n",
- (k - 1));
}
-#endif
-
- j = tmp;
mark_buffer_dirty(bh);
if (sb->s_flags & MS_SYNCHRONOUS) {
@@ -499,32 +532,21 @@ got_block:
wait_on_buffer (bh);
}
- if (j >= le32_to_cpu(es->s_blocks_count)) {
- ext2_error (sb, "ext2_new_block",
- "block(%d) >= blocks count(%d) - "
- "block_group = %d, es == %p ",j,
- le32_to_cpu(es->s_blocks_count), i, es);
- goto out;
- }
-
- ext2_debug ("allocating block %d. "
- "Goal hits %d of %d.\n", j, goal_hits, goal_attempts);
+ ext2_debug ("allocating block %d. ", block);
- gdp->bg_free_blocks_count = cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count) - 1);
- mark_buffer_dirty(bh2);
- es->s_free_blocks_count = cpu_to_le32(le32_to_cpu(es->s_free_blocks_count) - 1);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
- sb->s_dirt = 1;
- unlock_super (sb);
+out_release:
+ group_release_blocks(desc, bh2, group_alloc);
+ release_blocks(sb, es_alloc);
*err = 0;
- return j;
-
+out_unlock:
+ unlock_super (sb);
+ DQUOT_FREE_BLOCK(inode, dq_alloc);
+out:
+ return block;
+
io_error:
*err = -EIO;
-out:
- unlock_super (sb);
- return 0;
-
+ goto out_release;
}
unsigned long ext2_count_free_blocks (struct super_block * sb)
@@ -532,27 +554,27 @@ unsigned long ext2_count_free_blocks (struct super_block * sb)
#ifdef EXT2FS_DEBUG
struct ext2_super_block * es;
unsigned long desc_count, bitmap_count, x;
- struct ext2_group_desc * gdp;
+ struct ext2_group_desc * desc;
int i;
lock_super (sb);
es = sb->u.ext2_sb.s_es;
desc_count = 0;
bitmap_count = 0;
- gdp = NULL;
+ desc = NULL;
for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) {
struct buffer_head *bh;
- gdp = ext2_get_group_desc (sb, i, NULL);
- if (!gdp)
+ desc = ext2_get_group_desc (sb, i, NULL);
+ if (!desc)
continue;
- desc_count += le16_to_cpu(gdp->bg_free_blocks_count);
+ desc_count += le16_to_cpu(desc->bg_free_blocks_count);
bh = load_block_bitmap (sb, i);
if (IS_ERR(bh))
continue;
x = ext2_count_free (bh, sb->s_blocksize);
printk ("group %d: stored = %d, counted = %lu\n",
- i, le16_to_cpu(gdp->bg_free_blocks_count), x);
+ i, le16_to_cpu(desc->bg_free_blocks_count), x);
bitmap_count += x;
}
printk("ext2_count_free_blocks: stored = %lu, computed = %lu, %lu\n",
@@ -632,18 +654,18 @@ void ext2_check_blocks_bitmap (struct super_block * sb)
struct ext2_super_block * es;
unsigned long desc_count, bitmap_count, x, j;
unsigned long desc_blocks;
- struct ext2_group_desc * gdp;
+ struct ext2_group_desc * desc;
int i;
es = sb->u.ext2_sb.s_es;
desc_count = 0;
bitmap_count = 0;
- gdp = NULL;
+ desc = NULL;
for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) {
- gdp = ext2_get_group_desc (sb, i, NULL);
- if (!gdp)
+ desc = ext2_get_group_desc (sb, i, NULL);
+ if (!desc)
continue;
- desc_count += le16_to_cpu(gdp->bg_free_blocks_count);
+ desc_count += le16_to_cpu(desc->bg_free_blocks_count);
bh = load_block_bitmap (sb, i);
if (IS_ERR(bh))
continue;
@@ -659,28 +681,28 @@ void ext2_check_blocks_bitmap (struct super_block * sb)
"Descriptor block #%ld in group "
"%d is marked free", j, i);
- if (!block_in_use (le32_to_cpu(gdp->bg_block_bitmap), sb, bh->b_data))
+ if (!block_in_use (le32_to_cpu(desc->bg_block_bitmap), sb, bh->b_data))
ext2_error (sb, "ext2_check_blocks_bitmap",
"Block bitmap for group %d is marked free",
i);
- if (!block_in_use (le32_to_cpu(gdp->bg_inode_bitmap), sb, bh->b_data))
+ if (!block_in_use (le32_to_cpu(desc->bg_inode_bitmap), sb, bh->b_data))
ext2_error (sb, "ext2_check_blocks_bitmap",
"Inode bitmap for group %d is marked free",
i);
for (j = 0; j < sb->u.ext2_sb.s_itb_per_group; j++)
- if (!block_in_use (le32_to_cpu(gdp->bg_inode_table) + j, sb, bh->b_data))
+ if (!block_in_use (le32_to_cpu(desc->bg_inode_table) + j, sb, bh->b_data))
ext2_error (sb, "ext2_check_blocks_bitmap",
"Block #%ld of the inode table in "
"group %d is marked free", j, i);
x = ext2_count_free (bh, sb->s_blocksize);
- if (le16_to_cpu(gdp->bg_free_blocks_count) != x)
+ if (le16_to_cpu(desc->bg_free_blocks_count) != x)
ext2_error (sb, "ext2_check_blocks_bitmap",
"Wrong free blocks count for group %d, "
"stored = %d, counted = %lu", i,
- le16_to_cpu(gdp->bg_free_blocks_count), x);
+ le16_to_cpu(desc->bg_free_blocks_count), x);
bitmap_count += x;
}
if (le32_to_cpu(es->s_free_blocks_count) != bitmap_count)
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 9843debce62f..e005965f6182 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -19,7 +19,7 @@
*/
#include "ext2.h"
-#include <linux/sched.h>
+#include <linux/time.h>
/*
* Called when an inode is released. Note that this is different
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index c355f6cbfb4b..76074e943991 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -25,7 +25,7 @@
#include "ext2.h"
#include <linux/locks.h>
#include <linux/smp_lock.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/highuid.h>
#include <linux/quotaops.h>
#include <linux/module.h>
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c
index 07e9aafbc159..680eb331a821 100644
--- a/fs/ext2/ioctl.c
+++ b/fs/ext2/ioctl.c
@@ -8,7 +8,7 @@
*/
#include "ext2.h"
-#include <linux/sched.h>
+#include <linux/time.h>
#include <asm/uaccess.h>
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index f4f87da52c37..24336e4c8b3a 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -12,7 +12,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/ext3_fs.h>
diff --git a/fs/ext3/file.c b/fs/ext3/file.c
index 65ee4b28dc3d..3ed85a1adcf8 100644
--- a/fs/ext3/file.c
+++ b/fs/ext3/file.c
@@ -18,7 +18,7 @@
* (jj@sunsite.ms.mff.cuni.cz)
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/locks.h>
#include <linux/jbd.h>
diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c
index 79f4f838514f..e474547eb3e2 100644
--- a/fs/ext3/fsync.c
+++ b/fs/ext3/fsync.c
@@ -22,7 +22,7 @@
* we can depend on generic_block_fdatasync() to sync the data blocks.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/ext3_fs.h>
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 20e8aea82fd2..2febb54950ae 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -12,7 +12,7 @@
* David S. Miller (davem@caip.rutgers.edu), 1995
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/ext3_fs.h>
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 4398759a120c..83cc1283e7a6 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -23,7 +23,7 @@
*/
#include <linux/fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/ext3_jbd.h>
#include <linux/jbd.h>
#include <linux/locks.h>
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index 07f7fdd93828..beca674d3d73 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -11,7 +11,7 @@
#include <linux/jbd.h>
#include <linux/ext3_fs.h>
#include <linux/ext3_jbd.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <asm/uaccess.h>
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index ca49f46f9b03..7b9e7c9d8efd 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -20,7 +20,7 @@
#include <linux/fs.h>
#include <linux/jbd.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/ext3_fs.h>
#include <linux/ext3_jbd.h>
#include <linux/fcntl.h>
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 24ddd1d434f3..009ee4622eec 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -20,7 +20,7 @@
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/jbd.h>
#include <linux/ext3_fs.h>
#include <linux/ext3_jbd.h>
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index a1ee11a74b42..6a81b8259688 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -14,7 +14,7 @@
*/
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/msdos_fs.h>
#include <linux/dirent.h>
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 27911fbd96fa..942fdebef2d9 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -6,7 +6,7 @@
* regular file handling primitives for fat-based filesystems
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/locks.h>
#include <linux/msdos_fs.h>
#include <linux/fat_cvf.h>
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 8755a715a2c8..9e3b7ec8235c 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -11,7 +11,7 @@
*/
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/locks.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
diff --git a/fs/fifo.c b/fs/fifo.c
index f5738c126bce..46eb3ca19420 100644
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -12,6 +12,7 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
+#include <linux/fs.h>
static void wait_for_partner(struct inode* inode, unsigned int* cnt)
{
diff --git a/fs/file.c b/fs/file.c
index 200d7b1bf929..d89c8a6308ce 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -8,7 +8,7 @@
#include <linux/fs.h>
#include <linux/mm.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/file.h>
diff --git a/fs/file_table.c b/fs/file_table.c
index e7248739e3d4..d9e8a5b3d2eb 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/smp_lock.h>
#include <linux/iobuf.h>
+#include <linux/fs.h>
/* sysctl tunables... */
struct files_stat_struct files_stat = {0, 0, NR_FILE};
diff --git a/fs/filesystems.c b/fs/filesystems.c
index 98be56d1fb69..beb785f3cc3d 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -8,10 +8,11 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/smp_lock.h>
#include <linux/kmod.h>
#include <linux/nfsd/interface.h>
+#include <linux/linkage.h>
#if defined(CONFIG_NFSD_MODULE)
struct nfsd_linkage *nfsd_linkage = NULL;
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c
index 2942766f27f4..9d52234f9849 100644
--- a/fs/freevxfs/vxfs_lookup.c
+++ b/fs/freevxfs/vxfs_lookup.c
@@ -33,7 +33,7 @@
* Veritas filesystem driver - lookup and other directory related code.
*/
#include <linux/fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/kernel.h>
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c
index 8943d6d15280..513f2bd2ad8b 100644
--- a/fs/hpfs/dir.c
+++ b/fs/hpfs/dir.c
@@ -7,7 +7,7 @@
*/
#include "hpfs_fn.h"
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/smp_lock.h>
int hpfs_dir_release(struct inode *inode, struct file *filp)
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index d841654edaa0..10bc9d88782a 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -7,7 +7,7 @@
*/
#include <linux/string.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/smp_lock.h>
#include "hpfs_fn.h"
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index ce0c2b0f24a6..a6cb5a596827 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -15,7 +15,7 @@
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/locks.h>
#include <linux/stat.h>
#include <linux/string.h>
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index a45a3303be12..c1411921e6da 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -6,7 +6,7 @@
* inode VFS functions
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/smp_lock.h>
#include "hpfs_fn.h"
diff --git a/fs/intermezzo/cache.c b/fs/intermezzo/cache.c
index b7ef2eb4926e..0526fd33a351 100644
--- a/fs/intermezzo/cache.c
+++ b/fs/intermezzo/cache.c
@@ -19,7 +19,7 @@
#include <linux/ext2_fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/intermezzo/dcache.c b/fs/intermezzo/dcache.c
index 4b94a8ec3cf1..eca114afc4fa 100644
--- a/fs/intermezzo/dcache.c
+++ b/fs/intermezzo/dcache.c
@@ -10,7 +10,7 @@
#define __NO_VERSION__
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
diff --git a/fs/intermezzo/dir.c b/fs/intermezzo/dir.c
index 25f7f1810d01..de2d4afc07fb 100644
--- a/fs/intermezzo/dir.c
+++ b/fs/intermezzo/dir.c
@@ -21,7 +21,7 @@
#include <linux/ext2_fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/intermezzo/file.c b/fs/intermezzo/file.c
index 8464b2618cd4..68084e55ef73 100644
--- a/fs/intermezzo/file.c
+++ b/fs/intermezzo/file.c
@@ -28,7 +28,7 @@
#include <linux/ext2_fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/intermezzo/journal_ext2.c b/fs/intermezzo/journal_ext2.c
index ceeb9f941b82..dfe97bbe749b 100644
--- a/fs/intermezzo/journal_ext2.c
+++ b/fs/intermezzo/journal_ext2.c
@@ -5,7 +5,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
diff --git a/fs/intermezzo/journal_ext3.c b/fs/intermezzo/journal_ext3.c
index eadd1d857e19..58ab5f50dccc 100644
--- a/fs/intermezzo/journal_ext3.c
+++ b/fs/intermezzo/journal_ext3.c
@@ -10,7 +10,7 @@
#include <linux/types.h>
#include <linux/param.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
diff --git a/fs/intermezzo/journal_obdfs.c b/fs/intermezzo/journal_obdfs.c
index bda86f328a44..c6d239b2685e 100644
--- a/fs/intermezzo/journal_obdfs.c
+++ b/fs/intermezzo/journal_obdfs.c
@@ -10,7 +10,7 @@
#include <linux/types.h>
#include <linux/param.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
diff --git a/fs/intermezzo/journal_reiserfs.c b/fs/intermezzo/journal_reiserfs.c
index 780d9daa176e..6531887ad3f5 100644
--- a/fs/intermezzo/journal_reiserfs.c
+++ b/fs/intermezzo/journal_reiserfs.c
@@ -9,7 +9,7 @@
#include <linux/types.h>
#include <linux/param.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
diff --git a/fs/intermezzo/journal_xfs.c b/fs/intermezzo/journal_xfs.c
index fed141fdc2dc..0ec4372e918a 100644
--- a/fs/intermezzo/journal_xfs.c
+++ b/fs/intermezzo/journal_xfs.c
@@ -5,7 +5,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
diff --git a/fs/intermezzo/methods.c b/fs/intermezzo/methods.c
index 09496b3caef7..05af7f28bdf9 100644
--- a/fs/intermezzo/methods.c
+++ b/fs/intermezzo/methods.c
@@ -20,7 +20,7 @@
#include <linux/ext2_fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/intermezzo/presto.c b/fs/intermezzo/presto.c
index 1eba374ae559..ad89030bec0d 100644
--- a/fs/intermezzo/presto.c
+++ b/fs/intermezzo/presto.c
@@ -10,7 +10,7 @@
*/
#include <linux/types.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
diff --git a/fs/intermezzo/psdev.c b/fs/intermezzo/psdev.c
index 0384ab5c3c29..b7501c1a4a61 100644
--- a/fs/intermezzo/psdev.c
+++ b/fs/intermezzo/psdev.c
@@ -32,7 +32,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/major.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/lp.h>
#include <linux/slab.h>
#include <asm/ioctls.h>
diff --git a/fs/intermezzo/super.c b/fs/intermezzo/super.c
index 2b011f1711f2..7081dbdd22c6 100644
--- a/fs/intermezzo/super.c
+++ b/fs/intermezzo/super.c
@@ -20,7 +20,7 @@
#include <linux/ext2_fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/intermezzo/sysctl.c b/fs/intermezzo/sysctl.c
index 212e4c19f71c..ec438c487730 100644
--- a/fs/intermezzo/sysctl.c
+++ b/fs/intermezzo/sysctl.c
@@ -5,7 +5,7 @@
#define __NO_VERSION__
#include <linux/config.h> /* for CONFIG_PROC_FS */
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/sysctl.h>
#include <linux/swapctl.h>
diff --git a/fs/intermezzo/upcall.c b/fs/intermezzo/upcall.c
index 95ecdef0b5a8..37491a4c3dd0 100644
--- a/fs/intermezzo/upcall.c
+++ b/fs/intermezzo/upcall.c
@@ -28,7 +28,7 @@
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
diff --git a/fs/ioctl.c b/fs/ioctl.c
index f46bdb1edb0f..a36c61f18769 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -7,6 +7,7 @@
#include <linux/mm.h>
#include <linux/smp_lock.h>
#include <linux/file.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/ioctls.h>
diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
index 595599161126..bc977336454c 100644
--- a/fs/isofs/compress.c
+++ b/fs/isofs/compress.c
@@ -20,7 +20,7 @@
#include <linux/module.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/iso_fs.h>
#include <linux/kernel.h>
#include <linux/major.h>
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index 29db6b6c01ee..9c7ff0c3b349 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -18,7 +18,7 @@
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/locks.h>
#include <linux/config.h>
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 66ea867e71f8..eca947cb9152 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -13,7 +13,7 @@
#include <linux/module.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/iso_fs.h>
#include <linux/kernel.h>
#include <linux/major.h>
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c
index a9aa148926f9..0b952b365372 100644
--- a/fs/isofs/namei.c
+++ b/fs/isofs/namei.c
@@ -6,7 +6,7 @@
* (C) 1991 Linus Torvalds - minix filesystem
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/iso_fs.h>
#include <linux/kernel.h>
#include <linux/string.h>
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index 08a6c8a3e37b..5065d2fdccc6 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -7,7 +7,7 @@
*/
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/iso_fs.h>
#include <linux/string.h>
#include <linux/mm.h>
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index e682155bff8f..895bd40537c0 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -17,7 +17,7 @@
* reused.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/errno.h>
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index ee8f2248cff0..94900b3406f6 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -13,7 +13,7 @@
* part of the ext2fs journaling system.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/errno.h>
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 92388ce7e126..32801472a1b4 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -23,14 +23,13 @@
*/
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/locks.h>
#include <linux/smp_lock.h>
-#include <linux/sched.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/slab.h>
diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c
index b4f2cd89099c..68b2137abde9 100644
--- a/fs/jbd/recovery.c
+++ b/fs/jbd/recovery.c
@@ -16,7 +16,7 @@
#ifndef __KERNEL__
#include "jfs_user.h"
#else
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/errno.h>
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 43987b60f6e2..77efb355287a 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -60,7 +60,7 @@
#ifndef __KERNEL__
#include "jfs_user.h"
#else
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/errno.h>
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 1b113947ccdf..859c45380ef0 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -17,7 +17,7 @@
* filesystem).
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/errno.h>
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index 2bc47cf0481c..dd2351582c1d 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -32,7 +32,7 @@
dwmw2
*/
#define __KERNEL_SYSCALLS__
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/unistd.h>
#include <linux/module.h>
diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c
index 64b5898d2784..39b6c3730b2d 100644
--- a/fs/jffs/intrep.c
+++ b/fs/jffs/intrep.c
@@ -68,7 +68,7 @@
#include <asm/byteorder.h>
#include <linux/version.h>
#include <linux/smp_lock.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/ctype.h>
#include "intrep.h"
diff --git a/fs/jffs/jffs_proc.c b/fs/jffs/jffs_proc.c
index 22107954fb0f..b100bff2c49e 100644
--- a/fs/jffs/jffs_proc.c
+++ b/fs/jffs/jffs_proc.c
@@ -26,7 +26,7 @@
#include <linux/jffs.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/types.h>
#include "jffs_fm.h"
#include "jffs_proc.h"
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c
index be5f8be03bbb..ac1a66b9acd9 100644
--- a/fs/jffs2/background.c
+++ b/fs/jffs2/background.c
@@ -38,7 +38,7 @@
#define __KERNEL_SYSCALLS__
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/unistd.h>
#include <linux/jffs2.h>
#include <linux/mtd/mtd.h>
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index 4712eb7fd913..8d5c142683f0 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -42,7 +42,7 @@
#include <linux/jffs2.h>
#include <linux/jffs2_fs_i.h>
#include <linux/jffs2_fs_sb.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include "nodelist.h"
static int jffs2_readdir (struct file *, void *, filldir_t);
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
index 9294e584c4d4..fc4ab75ea921 100644
--- a/fs/jffs2/gc.c
+++ b/fs/jffs2/gc.c
@@ -39,7 +39,7 @@
#include <linux/mtd/mtd.h>
#include <linux/slab.h>
#include <linux/jffs2.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/interrupt.h>
#include <linux/pagemap.h>
#include <linux/crc32.h>
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index f092bfa9c295..f38a040578fd 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -10,7 +10,7 @@
#include <linux/module.h>
#include <linux/types.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/nfs_fs.h>
#include <linux/unistd.h>
#include <linux/sunrpc/clnt.h>
diff --git a/fs/lockd/lockd_syms.c b/fs/lockd/lockd_syms.c
index 2de24bbfd29c..c8c4a603a5ce 100644
--- a/fs/lockd/lockd_syms.c
+++ b/fs/lockd/lockd_syms.c
@@ -16,7 +16,7 @@
#include <linux/types.h>
#include <linux/socket.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/uio.h>
#include <linux/unistd.h>
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 28d8cbf1e063..6ef8cb8c2e33 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -8,7 +8,7 @@
*/
#include <linux/types.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/slab.h>
#include <linux/in.h>
#include <linux/sunrpc/svc.h>
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index a5283be9b170..9eb58661273e 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -9,7 +9,7 @@
#include <linux/config.h>
#include <linux/types.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/slab.h>
#include <linux/in.h>
#include <linux/sunrpc/svc.h>
diff --git a/fs/lockd/svcshare.c b/fs/lockd/svcshare.c
index 73fbb1ba414b..ef24965f997b 100644
--- a/fs/lockd/svcshare.c
+++ b/fs/lockd/svcshare.c
@@ -6,7 +6,7 @@
* Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/unistd.h>
#include <linux/string.h>
#include <linux/slab.h>
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
index e7bcab77540c..59ed7ae53cd4 100644
--- a/fs/lockd/svcsubs.c
+++ b/fs/lockd/svcsubs.c
@@ -9,7 +9,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/string.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/in.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/clnt.h>
diff --git a/fs/locks.c b/fs/locks.c
index eeaa45b14931..2c6d2d30540c 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -120,7 +120,8 @@
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/capability.h>
-#include <linux/sched.h>
+#include <linux/time.h>
+#include <linux/fs.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>
diff --git a/fs/msdos/namei.c b/fs/msdos/namei.c
index 6b136aad9179..77ec25b61d81 100644
--- a/fs/msdos/namei.c
+++ b/fs/msdos/namei.c
@@ -10,7 +10,7 @@
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/msdos_fs.h>
#define MSDOS_DEBUG 0
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 25ac483a1d81..929d6df7efdb 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -11,7 +11,7 @@
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/kernel.h>
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c
index bc7b38e5530c..0b5f437715e2 100644
--- a/fs/ncpfs/file.c
+++ b/fs/ncpfs/file.c
@@ -9,7 +9,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 4e79dcb47a76..b3882c7d64d1 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -15,7 +15,7 @@
#include <asm/uaccess.h>
#include <asm/byteorder.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index f10cb81a9713..d923de41ec13 100644
--- a/fs/ncpfs/ioctl.c
+++ b/fs/ncpfs/ioctl.c
@@ -13,7 +13,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/ioctl.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/highuid.h>
#include <linux/vmalloc.h>
diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c
index 7d9bc345d4f0..57573efb20dd 100644
--- a/fs/ncpfs/mmap.c
+++ b/fs/ncpfs/mmap.c
@@ -7,7 +7,7 @@
*/
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/shm.h>
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c
index 095498a2b5b8..a9c4a4c3b653 100644
--- a/fs/ncpfs/sock.c
+++ b/fs/ncpfs/sock.c
@@ -10,7 +10,7 @@
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/socket.h>
#include <linux/fcntl.h>
diff --git a/fs/ncpfs/symlink.c b/fs/ncpfs/symlink.c
index 843aed06432f..c1eb6d3a4866 100644
--- a/fs/ncpfs/symlink.c
+++ b/fs/ncpfs/symlink.c
@@ -25,7 +25,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/ncp_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/stat.h>
#include "ncplib_kernel.h"
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index bc193639e486..72b052b126fa 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -17,7 +17,7 @@
* 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index d25cb4968931..f7fa8ac1972f 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -16,7 +16,7 @@
* nfs regular file handling functions
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
diff --git a/fs/nfs/flushd.c b/fs/nfs/flushd.c
index 8dca7b945386..c1e64de64535 100644
--- a/fs/nfs/flushd.c
+++ b/fs/nfs/flushd.c
@@ -28,7 +28,7 @@
#include <linux/pagemap.h>
#include <linux/file.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/sunrpc/auth.h>
#include <linux/sunrpc/clnt.h>
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 28d57bf19bad..e2821e8a9cbd 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -17,7 +17,7 @@
#include <linux/module.h>
#include <linux/init.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 30ab0b8c4a9d..9f9b72bf5fa9 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -10,7 +10,7 @@
*/
#include <linux/param.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/utsname.h>
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 1936438a2790..a89441ec7c9f 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -7,7 +7,7 @@
*/
#include <linux/param.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/utsname.h>
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index 51fbb9be0ea7..5541efe6ee2a 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -70,7 +70,7 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/sunrpc/clnt.h>
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index e19009ea7e30..5cd3459fb1bc 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -30,7 +30,7 @@
#include <linux/types.h>
#include <linux/param.h>
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/utsname.h>
#include <linux/errno.h>
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 909f447128d2..87fe7389ffec 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -16,7 +16,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c
index 4350cf8e73e8..82203f1b2490 100644
--- a/fs/nfs/symlink.c
+++ b/fs/nfs/symlink.c
@@ -11,7 +11,7 @@
*/
#define NFS_NEED_XDR_TYPES
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfs.h>
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index c5253b5cfe4e..d117b4fbb126 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -7,7 +7,7 @@
*/
#include <linux/linkage.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/locks.h>
#include <linux/fs.h>
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 834974627f61..710132891d6e 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -7,7 +7,7 @@
*/
#include <linux/types.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/nfs3.h>
#include <linux/sunrpc/xdr.h>
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 2157f622ade5..1329160c9338 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -11,7 +11,7 @@
*/
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/slab.h>
#include <linux/string.h>
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index aad14fba76c8..d19e5cea34a1 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -11,7 +11,7 @@
#include <linux/version.h>
#include <linux/linkage.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/fcntl.h>
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 8c4599d20d4b..3e481a0519d5 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -8,7 +8,7 @@
*/
#include <linux/linkage.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/locks.h>
#include <linux/fs.h>
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index a4d9a9818580..cade5f6e1364 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -12,7 +12,7 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/nfs.h>
#include <linux/in.h>
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index d557f956fd3a..4611beb2f99e 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -7,7 +7,7 @@
*/
#include <linux/types.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/nfs.h>
#include <linux/sunrpc/xdr.h>
diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c
index 2bcffc4ee811..166c3e836997 100644
--- a/fs/nfsd/stats.c
+++ b/fs/nfsd/stats.c
@@ -24,7 +24,7 @@
*/
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#define __NO_VERSION__
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 245560649fef..f72b8a01a99c 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -18,7 +18,7 @@
#include <linux/config.h>
#include <linux/version.h>
#include <linux/string.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/locks.h>
#include <linux/fs.h>
diff --git a/fs/pipe.c b/fs/pipe.c
index 90734730ca62..596188fa639f 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -10,6 +10,7 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/ioctls.h>
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 08993e30dfb1..d1e5d9eede6c 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -55,7 +55,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
#include <linux/tty.h>
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 47c5cfdc6448..8358560d9e7e 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -17,7 +17,7 @@
#include <linux/config.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/init.h>
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index f50b13026f27..cf45ec098760 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -11,7 +11,7 @@
#include <asm/uaccess.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#define __NO_VERSION__
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index c96bde47f090..5c71d5ae71e1 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -4,7 +4,7 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
#include <linux/mm.h>
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c
index 69aeddd3f166..a2d8499cacf4 100644
--- a/fs/proc/kmsg.c
+++ b/fs/proc/kmsg.c
@@ -7,9 +7,10 @@
#include <linux/types.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/poll.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/io.h>
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index c64166f78aca..18917b6591df 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -4,7 +4,7 @@
* Copyright 1997 Paul Mackerras
*/
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/string.h>
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 5dc1a8f7b51c..e542e57a28c6 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -17,7 +17,7 @@
#include <linux/types.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
#include <linux/tty.h>
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index 1d55d4989317..9de90ed4b65d 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -8,7 +8,7 @@
#include <linux/init.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/tty.h>
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 666166bfcf57..98e089b34008 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -9,7 +9,7 @@
#include <asm/uaccess.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/config.h>
diff --git a/fs/qnx4/bitmap.c b/fs/qnx4/bitmap.c
index b06d5c1d9424..f45c43ddb309 100644
--- a/fs/qnx4/bitmap.c
+++ b/fs/qnx4/bitmap.c
@@ -14,7 +14,8 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
+#include <linux/fs.h>
#include <linux/qnx4_fs.h>
#include <linux/stat.h>
#include <linux/kernel.h>
diff --git a/fs/qnx4/file.c b/fs/qnx4/file.c
index ab5856ace4f2..ecf6d050697d 100644
--- a/fs/qnx4/file.c
+++ b/fs/qnx4/file.c
@@ -15,7 +15,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/qnx4_fs.h>
/*
diff --git a/fs/qnx4/fsync.c b/fs/qnx4/fsync.c
index f3d2301f1b47..56136f136665 100644
--- a/fs/qnx4/fsync.c
+++ b/fs/qnx4/fsync.c
@@ -12,7 +12,7 @@
#include <linux/config.h>
#include <linux/errno.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/locks.h>
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c
index f282935b7798..6af2f77145fd 100644
--- a/fs/qnx4/namei.c
+++ b/fs/qnx4/namei.c
@@ -13,7 +13,8 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
+#include <linux/fs.h>
#include <linux/qnx4_fs.h>
#include <linux/kernel.h>
#include <linux/string.h>
diff --git a/fs/readdir.c b/fs/readdir.c
index 7ec20be60a41..083165f37d85 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -4,12 +4,13 @@
* Copyright (C) 1995 Linus Torvalds
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/stat.h>
#include <linux/file.h>
#include <linux/smp_lock.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 427a00387824..1130f91cb8b3 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -3,7 +3,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
#include <linux/locks.h>
#include <asm/bitops.h>
diff --git a/fs/reiserfs/buffer2.c b/fs/reiserfs/buffer2.c
index 2d0b29a21bf6..b7025254a64b 100644
--- a/fs/reiserfs/buffer2.c
+++ b/fs/reiserfs/buffer2.c
@@ -3,7 +3,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/locks.h>
#include <linux/reiserfs_fs.h>
#include <linux/smp_lock.h>
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index 1c9e1bca9a68..0ae4d3482f42 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -18,7 +18,7 @@
#include <linux/config.h>
#include <asm/uaccess.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
#ifdef CONFIG_REISERFS_CHECK
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index f967d463b60e..91e51da6b48b 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -3,7 +3,7 @@
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
#include <linux/smp_lock.h>
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 5444f25fef12..5a8f9f6f6dca 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -36,7 +36,7 @@
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/string.h>
#include <linux/locks.h>
#include <linux/reiserfs_fs.h>
diff --git a/fs/reiserfs/ibalance.c b/fs/reiserfs/ibalance.c
index c77948ecf7bc..b4a4b2d3ed84 100644
--- a/fs/reiserfs/ibalance.c
+++ b/fs/reiserfs/ibalance.c
@@ -5,7 +5,7 @@
#include <linux/config.h>
#include <asm/uaccess.h>
#include <linux/string.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
/* this is one and only function that is used outside (do_balance.c) */
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index c35cb51a9a48..34462717de56 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -3,7 +3,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
#include <linux/locks.h>
#include <linux/smp_lock.h>
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index dccd1c3a07d5..a3c2d858dec0 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -4,7 +4,7 @@
#include <linux/fs.h>
#include <linux/reiserfs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <asm/uaccess.h>
#include <linux/smp_lock.h>
#include <linux/locks.h>
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
index 74305fa685e5..9881a2662a69 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -2,7 +2,7 @@
* Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
// this contains item handlers for old item types: sd, direct,
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 19967829278e..3bb94741c6c5 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -45,7 +45,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <asm/semaphore.h>
#include <linux/vmalloc.h>
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 64f2dba6062f..f39feaf13219 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -5,7 +5,7 @@
#include <linux/config.h>
#include <asm/uaccess.h>
#include <linux/string.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
/* these are used in do_balance.c */
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 9d2d24bd1136..ed3c0aaa919f 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -12,7 +12,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/bitops.h>
#include <linux/reiserfs_fs.h>
#include <linux/smp_lock.h>
diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c
index 45c2537fff2c..503ef628aa5b 100644
--- a/fs/reiserfs/objectid.c
+++ b/fs/reiserfs/objectid.c
@@ -6,7 +6,7 @@
#include <linux/string.h>
#include <linux/locks.h>
#include <linux/random.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/reiserfs_fs.h>
#include <linux/reiserfs_fs_sb.h>
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index c7c18e383156..16bf7ce51220 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -3,7 +3,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/reiserfs_fs.h>
#include <linux/string.h>
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index b6ef3e5a423c..2b6a8ada5444 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -12,7 +12,7 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <asm/uaccess.h>
#include <linux/reiserfs_fs.h>
#include <linux/reiserfs_fs_sb.h>
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index 5d3eee75a9cb..5ab2d7e57305 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -54,7 +54,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/string.h>
#include <linux/locks.h>
#include <linux/pagemap.h>
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index a9ae97dfc7d6..5051b81c3e4f 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -13,7 +13,7 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <asm/uaccess.h>
#include <linux/reiserfs_fs.h>
#include <linux/smp_lock.h>
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index 18f1bda12d0e..98106becb7cd 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -3,7 +3,7 @@
*/
#include <linux/config.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/pagemap.h>
#include <linux/reiserfs_fs.h>
#include <linux/locks.h>
diff --git a/fs/select.c b/fs/select.c
index b059b905f3f4..30c29f1e49f8 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -19,6 +19,7 @@
#include <linux/poll.h>
#include <linux/personality.h> /* for STICKY_TIMEOUTS */
#include <linux/file.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
diff --git a/fs/smbfs/cache.c b/fs/smbfs/cache.c
index 3e98f83ab19f..369c13927b74 100644
--- a/fs/smbfs/cache.c
+++ b/fs/smbfs/cache.c
@@ -9,7 +9,7 @@
* Please add a note about your changes to smbfs in the ChangeLog file.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/mm.h>
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c
index 53bedfd86b82..4ef7212a077c 100644
--- a/fs/smbfs/dir.c
+++ b/fs/smbfs/dir.c
@@ -7,7 +7,7 @@
* Please add a note about your changes to smbfs in the ChangeLog file.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/smp_lock.h>
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index 39badd71692f..63f6aaac3a00 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -7,7 +7,7 @@
* Please add a note about your changes to smbfs in the ChangeLog file.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index 688ba2df2e0e..7c964fe66164 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -9,7 +9,7 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c
index afc45b4f7fd9..e68ebd7df35b 100644
--- a/fs/smbfs/ioctl.c
+++ b/fs/smbfs/ioctl.c
@@ -10,7 +10,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/ioctl.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/highuid.h>
diff --git a/fs/smbfs/sock.c b/fs/smbfs/sock.c
index 8c66f4c5e655..78ea22184419 100644
--- a/fs/smbfs/sock.c
+++ b/fs/smbfs/sock.c
@@ -7,7 +7,8 @@
* Please add a note about your changes to smbfs in the ChangeLog file.
*/
-#include <linux/sched.h>
+#include <linux/fs.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/socket.h>
#include <linux/fcntl.h>
diff --git a/fs/stat.c b/fs/stat.c
index 20bd373580c5..3431914fb43a 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -10,6 +10,7 @@
#include <linux/file.h>
#include <linux/smp_lock.h>
#include <linux/highuid.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c
index 3254e530faf9..7a0eebeda03e 100644
--- a/fs/udf/symlink.c
+++ b/fs/udf/symlink.c
@@ -29,7 +29,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/udf_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/mm.h>
#include <linux/stat.h>
#include <linux/slab.h>
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index 8f82baf1f3b7..861593acde46 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -9,7 +9,7 @@
#include <linux/fs.h>
#include <linux/ufs_fs.h>
#include <linux/stat.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/string.h>
#include <linux/locks.h>
#include <linux/quotaops.h>
diff --git a/fs/ufs/cylinder.c b/fs/ufs/cylinder.c
index 97391b4d66c0..a0729feed07f 100644
--- a/fs/ufs/cylinder.c
+++ b/fs/ufs/cylinder.c
@@ -10,7 +10,7 @@
#include <linux/fs.h>
#include <linux/ufs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 3dca14b360e9..1171261073c6 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -13,7 +13,7 @@
* on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/locks.h>
#include <linux/fs.h>
#include <linux/ufs_fs.h>
diff --git a/fs/ufs/file.c b/fs/ufs/file.c
index 819e6945b112..fd6332175401 100644
--- a/fs/ufs/file.c
+++ b/fs/ufs/file.c
@@ -30,7 +30,7 @@
#include <linux/fs.h>
#include <linux/ufs_fs.h>
#include <linux/fcntl.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/locks.h>
#include <linux/mm.h>
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c
index d1eea1f58f69..c0a435a09a26 100644
--- a/fs/ufs/ialloc.c
+++ b/fs/ufs/ialloc.c
@@ -22,7 +22,7 @@
#include <linux/fs.h>
#include <linux/ufs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index cc08c9febd29..e11438305523 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -31,7 +31,7 @@
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/ufs_fs.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index 0a95f62f7780..3742b3ebe8e0 100644
--- a/fs/ufs/namei.c
+++ b/fs/ufs/namei.c
@@ -24,7 +24,7 @@
* David S. Miller (davem@caip.rutgers.edu), 1995
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/ufs_fs.h>
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index ef84557f120f..d07905696aff 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -74,7 +74,7 @@
#include <linux/fs.h>
#include <linux/ufs_fs.h>
#include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/locks.h>
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index 448466b31e01..2cec5fedfd71 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -33,7 +33,7 @@
#include <linux/fs.h>
#include <linux/ufs_fs.h>
#include <linux/fcntl.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/stat.h>
#include <linux/locks.h>
#include <linux/string.h>
diff --git a/fs/umsdos/dir.c b/fs/umsdos/dir.c
index 8d797bb6dafc..4586fc6841e0 100644
--- a/fs/umsdos/dir.c
+++ b/fs/umsdos/dir.c
@@ -7,7 +7,7 @@
* Extended MS-DOS directory handling functions
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <linux/msdos_fs.h>
diff --git a/fs/umsdos/emd.c b/fs/umsdos/emd.c
index 51d76ca24009..2b64394eba7c 100644
--- a/fs/umsdos/emd.c
+++ b/fs/umsdos/emd.c
@@ -9,7 +9,7 @@
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/msdos_fs.h>
diff --git a/fs/umsdos/inode.c b/fs/umsdos/inode.c
index befdd474f7d8..ad0104d26056 100644
--- a/fs/umsdos/inode.c
+++ b/fs/umsdos/inode.c
@@ -11,7 +11,7 @@
#include <linux/fs.h>
#include <linux/msdos_fs.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/errno.h>
#include <asm/uaccess.h>
#include <linux/string.h>
diff --git a/fs/umsdos/ioctl.c b/fs/umsdos/ioctl.c
index 13cd83d756f4..722581c1a53f 100644
--- a/fs/umsdos/ioctl.c
+++ b/fs/umsdos/ioctl.c
@@ -10,7 +10,7 @@
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/msdos_fs.h>
#include <linux/umsdos_fs.h>
diff --git a/fs/umsdos/namei.c b/fs/umsdos/namei.c
index 1e40fd8e96ef..f7640dbda210 100644
--- a/fs/umsdos/namei.c
+++ b/fs/umsdos/namei.c
@@ -13,7 +13,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/stat.h>
diff --git a/fs/umsdos/rdir.c b/fs/umsdos/rdir.c
index 372454a2e112..edd41d95a554 100644
--- a/fs/umsdos/rdir.c
+++ b/fs/umsdos/rdir.c
@@ -7,7 +7,7 @@
* (For directory without EMD file).
*/
-#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/fs.h>
#include <linux/msdos_fs.h>
#include <linux/errno.h>
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index b132819e0871..3e90f195defc 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -3,6 +3,7 @@
#include <linux/config.h>
#include <asm/types.h>
+#include <asm/mpspec.h>
/*
* Intel IO-APIC support for SMP and UP systems.
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index c932a698035d..7143971ad406 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -5,6 +5,7 @@
* User space memory access functions
*/
#include <linux/config.h>
+#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/prefetch.h>
#include <asm/page.h>
diff --git a/include/linux/affs_fs_i.h b/include/linux/affs_fs_i.h
index c32f69ca18f7..89872f778538 100644
--- a/include/linux/affs_fs_i.h
+++ b/include/linux/affs_fs_i.h
@@ -2,6 +2,8 @@
#define _AFFS_FS_I
#include <linux/a.out.h>
+#include <linux/fs.h>
+#include <asm/semaphore.h>
#define AFFS_CACHE_SIZE PAGE_SIZE
//#define AFFS_CACHE_SIZE (4*4)
diff --git a/include/linux/ax25.h b/include/linux/ax25.h
index 9191445bbcf1..6dfc8fc9116d 100644
--- a/include/linux/ax25.h
+++ b/include/linux/ax25.h
@@ -6,6 +6,8 @@
#ifndef AX25_KERNEL_H
#define AX25_KERNEL_H
+#include <linux/socket.h>
+
#define AX25_MTU 256
#define AX25_MAX_DIGIS 8
diff --git a/include/linux/bfs_fs_i.h b/include/linux/bfs_fs_i.h
index ca1432a1e792..5a85f1dc143f 100644
--- a/include/linux/bfs_fs_i.h
+++ b/include/linux/bfs_fs_i.h
@@ -6,6 +6,8 @@
#ifndef _LINUX_BFS_FS_I
#define _LINUX_BFS_FS_I
+#include <linux/fs.h>
+
/*
* BFS file system in-core inode info
*/
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 73e972803015..1cccb9db2334 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -14,7 +14,6 @@
#define _LINUX_CAPABILITY_H
#include <linux/types.h>
-#include <linux/fs.h>
/* User-level do most of the mapping between kernel and user
capabilities based on the version tag given by the kernel. The
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index c5cbc107cdb4..2f55b03f50c1 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -27,6 +27,7 @@ static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith@aes
#define EFS_BLOCKSIZE_BITS 9
#define EFS_BLOCKSIZE (1 << EFS_BLOCKSIZE_BITS)
+#include <linux/fs.h>
#include <linux/efs_fs_i.h>
#include <linux/efs_dir.h>
diff --git a/include/linux/err.h b/include/linux/err.h
new file mode 100644
index 000000000000..92cab64fdd83
--- /dev/null
+++ b/include/linux/err.h
@@ -0,0 +1,29 @@
+#ifndef _LINUX_ERR_H
+#define _LINUX_ERR_H
+
+#include <asm/errno.h>
+
+/*
+ * Kernel pointers have redundant information, so we can use a
+ * scheme where we can return either an error code or a dentry
+ * pointer with the same return value.
+ *
+ * This should be a per-architecture thing, to allow different
+ * error and pointer decisions.
+ */
+static inline void *ERR_PTR(long error)
+{
+ return (void *) error;
+}
+
+static inline long PTR_ERR(const void *ptr)
+{
+ return (long) ptr;
+}
+
+static inline long IS_ERR(const void *ptr)
+{
+ return (unsigned long)ptr > (unsigned long)-1000L;
+}
+
+#endif /* _LINUX_ERR_H */
diff --git a/include/linux/file.h b/include/linux/file.h
index 5e006ad08df0..067ca77739b8 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -8,6 +8,7 @@
#include <asm/atomic.h>
#include <linux/posix_types.h>
#include <linux/compiler.h>
+#include <linux/spinlock.h>
/*
* The default fd array needs to be at least BITS_PER_LONG,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 28027aaaf6a0..cc874fa9748b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1257,28 +1257,7 @@ extern struct file * open_exec(const char *);
extern int is_subdir(struct dentry *, struct dentry *);
extern ino_t find_inode_number(struct dentry *, struct qstr *);
-/*
- * Kernel pointers have redundant information, so we can use a
- * scheme where we can return either an error code or a dentry
- * pointer with the same return value.
- *
- * This should be a per-architecture thing, to allow different
- * error and pointer decisions.
- */
-static inline void *ERR_PTR(long error)
-{
- return (void *) error;
-}
-
-static inline long PTR_ERR(const void *ptr)
-{
- return (long) ptr;
-}
-
-static inline long IS_ERR(const void *ptr)
-{
- return (unsigned long)ptr > (unsigned long)-1000L;
-}
+#include <linux/err.h>
/*
* The bitmask for a lookup event:
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 3d2df3cf4202..1082b5b16694 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -2,6 +2,9 @@
#define _LINUX_FS_STRUCT_H
#ifdef __KERNEL__
+#include <linux/mount.h>
+#include <linux/dcache.h>
+
struct fs_struct {
atomic_t count;
rwlock_t lock;
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 118afad79eb4..c7651b47be5d 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -3,6 +3,7 @@
#include <linux/config.h>
#include <linux/bio.h>
+#include <linux/fs.h>
#include <asm/pgalloc.h>
#ifdef CONFIG_HIGHMEM
diff --git a/include/linux/in.h b/include/linux/in.h
index 1d5f14ad6286..f41a61dce932 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -19,6 +19,7 @@
#define _LINUX_IN_H
#include <linux/types.h>
+#include <linux/socket.h>
/* Standard well-defined IP protocols. */
enum {
diff --git a/include/linux/inet.h b/include/linux/inet.h
index acb93765fae4..940f3208aabe 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -44,6 +44,8 @@
#ifdef __KERNEL__
+#include <linux/net.h>
+
extern void inet_proto_init(struct net_proto *pro);
extern char *in_ntoa(__u32 in);
extern __u32 in_aton(const char *str);
diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h
index e4fc9d8e4d11..01a1ae26bceb 100644
--- a/include/linux/iso_fs_i.h
+++ b/include/linux/iso_fs_i.h
@@ -1,6 +1,8 @@
#ifndef _ISO_FS_I
#define _ISO_FS_I
+#include <linux/fs.h>
+
enum isofs_file_format {
isofs_file_normal = 0,
isofs_file_sparse = 1,
diff --git a/include/linux/lp.h b/include/linux/lp.h
index 9b04225db16d..521bcd2fecb1 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -98,6 +98,9 @@
#ifdef __KERNEL__
+#include <linux/wait.h>
+#include <asm/semaphore.h>
+
/* Magic numbers for defining port-device mappings */
#define LP_PARPORT_UNSPEC -4
#define LP_PARPORT_AUTO -3
diff --git a/include/linux/mm.h b/include/linux/mm.h
index ba870227f387..5377dd7836cc 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -13,6 +13,7 @@
#include <linux/mmzone.h>
#include <linux/swap.h>
#include <linux/rbtree.h>
+#include <linux/fs.h>
extern unsigned long max_mapnr;
extern unsigned long num_physpages;
diff --git a/include/linux/msdos_fs_i.h b/include/linux/msdos_fs_i.h
index 7b102ea2e976..438afd880ccc 100644
--- a/include/linux/msdos_fs_i.h
+++ b/include/linux/msdos_fs_i.h
@@ -1,6 +1,8 @@
#ifndef _MSDOS_FS_I
#define _MSDOS_FS_I
+#include <linux/fs.h>
+
/*
* MS-DOS file system inode data in memory
*/
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
index 8695e5f9682f..da92ede04064 100644
--- a/include/linux/namespace.h
+++ b/include/linux/namespace.h
@@ -9,6 +9,8 @@ struct namespace {
struct rw_semaphore sem;
};
+void umount_tree(struct vfsmount *mnt);
+
static inline void put_namespace(struct namespace *namespace)
{
if (atomic_dec_and_test(&namespace->count)) {
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index c22d9f32ef7a..0a1df9e1fe56 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -13,10 +13,10 @@
#include <linux/config.h>
#include <linux/smp_lock.h>
-#if defined(CONFIG_QUOTA)
-
#include <linux/fs.h>
+#if defined(CONFIG_QUOTA)
+
/*
* declaration of quota_function calls in kernel.
*/
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ad38cabb1619..dd6dc6983e04 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -6,7 +6,8 @@
extern unsigned long event;
#include <linux/config.h>
-#include <linux/binfmts.h>
+#include <linux/capability.h>
+#include <linux/tqueue.h>
#include <linux/threads.h>
#include <linux/kernel.h>
#include <linux/types.h>
@@ -509,15 +510,12 @@ extern void free_uid(struct user_struct *);
extern unsigned long volatile jiffies;
extern unsigned long itimer_ticks;
extern unsigned long itimer_next;
-extern struct timeval xtime;
extern void do_timer(struct pt_regs *);
extern unsigned int * prof_buffer;
extern unsigned long prof_len;
extern unsigned long prof_shift;
-#define CURRENT_TIME (xtime.tv_sec)
-
extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr));
extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr));
extern void FASTCALL(sleep_on(wait_queue_head_t *q));
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 183b1e49dbe8..46b6b67b0906 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -1,22 +1,12 @@
#ifndef __SHMEM_FS_H
#define __SHMEM_FS_H
+#include <linux/swap.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 mm.h is including fs.h via sched .h :-/
- */
-typedef struct {
- unsigned long val;
-} swp_entry_t;
-
extern atomic_t shmem_nrpages;
struct shmem_inode_info {
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a1d9d4e347ed..2bec5fabc4dc 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -25,6 +25,8 @@
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/highmem.h>
+#include <linux/poll.h>
+#include <linux/net.h>
#define HAVE_ALLOC_SKB /* For the drivers to know */
#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
diff --git a/include/linux/smb.h b/include/linux/smb.h
index 9cf2d068b7eb..d47f28f9fec5 100644
--- a/include/linux/smb.h
+++ b/include/linux/smb.h
@@ -10,6 +10,7 @@
#define _LINUX_SMB_H
#include <linux/types.h>
+#include <linux/kdev_t.h>
enum smb_protocol {
SMB_PROTOCOL_NONE,
diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h
index 309e8b973e86..8516954a5141 100644
--- a/include/linux/smb_fs_i.h
+++ b/include/linux/smb_fs_i.h
@@ -11,6 +11,7 @@
#ifdef __KERNEL__
#include <linux/types.h>
+#include <linux/fs.h>
/*
* smb fs inode data (in memory only)
diff --git a/include/linux/sound.h b/include/linux/sound.h
index 18a67332039a..428f59794f48 100644
--- a/include/linux/sound.h
+++ b/include/linux/sound.h
@@ -3,6 +3,8 @@
* Minor numbers for the sound driver.
*/
+#include <linux/fs.h>
+
#define SND_DEV_CTL 0 /* Control port /dev/mixer */
#define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
synthesizer and MIDI output) */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index fb33c6b5fb64..f6439cb4facf 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -14,6 +14,7 @@
#include <linux/sunrpc/types.h>
#include <linux/sunrpc/xdr.h>
#include <linux/sunrpc/svcauth.h>
+#include <linux/wait.h>
/*
* RPC service.
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index facaddcd50c8..69827d88dcae 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -10,6 +10,7 @@
#ifdef __KERNEL__
#include <linux/uio.h>
+#include <asm/byteorder.h>
/*
* Buffer adjustment
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 3535d0dbafe5..6c149d15e443 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -2,6 +2,9 @@
#define _LINUX_SWAP_H
#include <linux/spinlock.h>
+#include <linux/kdev_t.h>
+#include <linux/linkage.h>
+#include <linux/mmzone.h>
#include <asm/page.h>
#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */
@@ -39,6 +42,14 @@ union swap_header {
} info;
};
+ /* 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;
+
#ifdef __KERNEL__
/*
diff --git a/include/linux/time.h b/include/linux/time.h
index 15ba838c26b9..e7447958ece1 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -82,6 +82,10 @@ mktime (unsigned int year, unsigned int mon,
)*60 + sec; /* finally seconds */
}
+extern struct timeval xtime;
+
+#define CURRENT_TIME (xtime.tv_sec)
+
#endif /* __KERNEL__ */
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 3a00a26e2da1..b82cbdc776f7 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -51,6 +51,7 @@
#ifndef _LINUX_TIMEX_H
#define _LINUX_TIMEX_H
+#include <linux/time.h>
#include <asm/param.h>
/*
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index f87bd857133b..e08fcf85c24f 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -1,7 +1,6 @@
#ifndef __LINUX_VMALLOC_H
#define __LINUX_VMALLOC_H
-#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 1a60139a35cf..bfcc2fa802bd 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -46,6 +46,8 @@
#include <asm/atomic.h>
#include <linux/skbuff.h>
+#include <linux/err.h>
+
#define NUD_IN_TIMER (NUD_INCOMPLETE|NUD_DELAY|NUD_PROBE)
#define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY)
#define NUD_CONNECTED (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE)
diff --git a/include/net/scm.h b/include/net/scm.h
index e26b43f5eb93..214707434532 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -1,6 +1,8 @@
#ifndef __LINUX_NET_SCM_H
#define __LINUX_NET_SCM_H
+#include <linux/limits.h>
+
/* Well, we should have at least one descriptor open
* to accept passed FDs 8)
*/
diff --git a/include/net/sock.h b/include/net/sock.h
index c5e1646d8f75..b8e86c429824 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -106,6 +106,8 @@ struct atm_vcc;
#include <asm/atomic.h>
#include <net/dst.h>
+#include <linux/fs.h> /* just for inode - yeuch.*/
+
/* The AF_UNIX specific socket options */
struct unix_opt {
diff --git a/kernel/exit.c b/kernel/exit.c
index e5e631714afc..2566c5c5ba5a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -18,6 +18,7 @@
#include <linux/acct.h>
#endif
#include <linux/file.h>
+#include <linux/binfmts.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
diff --git a/kernel/fork.c b/kernel/fork.c
index 9ac534b70d1f..94ccd2aead70 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -22,6 +22,8 @@
#include <linux/namespace.h>
#include <linux/personality.h>
#include <linux/file.h>
+#include <linux/binfmts.h>
+#include <linux/fs.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index 41635b99dafe..e53859ff27af 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -47,6 +47,7 @@
#include <linux/in6.h>
#include <linux/completion.h>
#include <linux/seq_file.h>
+#include <linux/binfmts.h>
#include <asm/checksum.h>
#if defined(CONFIG_PROC_FS)
diff --git a/kernel/module.c b/kernel/module.c
index 34bb9edaa2b3..9d310463bfdb 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -10,6 +10,7 @@
#include <linux/slab.h>
#include <linux/kmod.h>
#include <linux/seq_file.h>
+#include <linux/fs.h>
/*
* Originally by Anonymous (as far as I know...)
diff --git a/kernel/sched.c b/kernel/sched.c
index a8cf63321a11..19d54511d252 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -18,6 +18,7 @@
#include <asm/uaccess.h>
#include <linux/smp_lock.h>
#include <linux/interrupt.h>
+#include <linux/completion.h>
#include <asm/mmu_context.h>
#define BITMAP_SIZE ((((MAX_PRIO+7)/8)+sizeof(long)-1)/sizeof(long))
diff --git a/kernel/signal.c b/kernel/signal.c
index 74d783557a24..78a9be269db3 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -13,6 +13,7 @@
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/sched.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
diff --git a/kernel/sys.c b/kernel/sys.c
index 21c21ca8bbe6..15e7e3455ecf 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -14,6 +14,7 @@
#include <linux/prctl.h>
#include <linux/init.h>
#include <linux/highuid.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/io.h>
diff --git a/kernel/time.c b/kernel/time.c
index 461a87de346d..8c5450db79ed 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -24,7 +24,6 @@
* (Even though the technical memorandum forbids it)
*/
-#include <linux/mm.h>
#include <linux/timex.h>
#include <linux/smp_lock.h>
diff --git a/mm/filemap.c b/mm/filemap.c
index 7fdfbdf974ee..16b924b0c5ba 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -24,6 +24,7 @@
#include <linux/mm.h>
#include <linux/iobuf.h>
#include <linux/compiler.h>
+#include <linux/fs.h>
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 895ba466e602..d6cd10db9724 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -8,6 +8,7 @@
#include <linux/smp_lock.h>
#include <linux/shm.h>
#include <linux/mman.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
diff --git a/mm/mremap.c b/mm/mremap.c
index 0a42e05cb0da..055cdfa0f417 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -10,6 +10,7 @@
#include <linux/shm.h>
#include <linux/mman.h>
#include <linux/swap.h>
+#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index 42813acfad27..3b0c40040d74 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -15,6 +15,7 @@
#include <linux/sunrpc/xdr.h>
#include <linux/sunrpc/svcauth.h>
#include <linux/sunrpc/svcsock.h>
+#include <linux/err.h>
#define RPCDBG_FACILITY RPCDBG_AUTH