]> git.neil.brown.name Git - history.git/commitdiff
Import 2.1.108pre1 2.1.108pre1
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:15:48 +0000 (15:15 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:15:48 +0000 (15:15 -0500)
48 files changed:
Documentation/filesystems/vfs.txt [deleted file]
Makefile
arch/i386/kernel/entry.S
arch/i386/kernel/setup.c
arch/m68k/hp300/ints.c
arch/m68k/hp300/time.c
arch/m68k/kernel/m68k_ksyms.c
arch/m68k/mac/macints.c
arch/m68k/mac/via6522.c
arch/ppc/chrp_defconfig
arch/ppc/common_defconfig
arch/ppc/prep_defconfig
drivers/char/conmakehash.c
drivers/char/fbmem.c
drivers/char/vc_screen.c
drivers/macintosh/chips.c
drivers/net/7990.c
drivers/net/hamradio/baycom_epp.c
drivers/net/hamradio/soundmodem/gentbl.c
drivers/net/hplance.c
drivers/net/sktr.c
drivers/scsi/NCR53C9x.h
drivers/scsi/pluto.c
drivers/sound/msnd.c
drivers/sound/msnd_classic.c
drivers/sound/msnd_classic.h
drivers/sound/msnd_pinnacle.c
drivers/sound/msnd_pinnacle.h
drivers/sound/sound_core.c
drivers/video/S3triofb.c
drivers/video/fbcon-ilbm.c
drivers/video/fbcon-iplan2p2.c
drivers/video/fbcon-iplan2p4.c
drivers/video/fbcon-iplan2p8.c
drivers/video/hpfb.c
fs/coda/stats.c
fs/proc/array.c
fs/select.c
fs/sysv/CHANGES
fs/sysv/Makefile
fs/sysv/file.c
fs/sysv/truncate.c
include/asm-i386/unistd.h
include/asm-m68k/pgtable.h
include/linux/console_compat.h
include/linux/console_struct.h
include/linux/selection.h
mm/filemap.c

diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
deleted file mode 100644 (file)
index 7d0951c..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-A Brief Overview of the Virtual File System
-===========================================
-       by Benjamin LaHaise (blah@dot.superaje.com)
-
-No one else seems to be writing this, so here's a quick description of what
-I've learned while writing lofs.
-
-The VFS is relatively simple, but it is nice not to have to browse through
-pages of code to determine what is expected when writing a filesystem.
-This document is meant to help anyone attempting such a feat, and to clarify 
-a few important points and dependencies.
-
-register_filesystem (struct file_system_type *fstype)
-=====================================================
-
-All filesystems are created equal, or at least they start out that way.
-A filesystem, whether in module form or linked into the kernel, needs to add
-itself to the table of filesystems by calling register_filesystem with an
-initialized file_system_type structure.  Any further functions of the
-filesystem are accessed through the following function tables:
-
-
-struct file_system_type
-=======================
-
-       struct super_block *(*read_super) (struct super_block *sb, void *options, int silent);
-
-               This is the entry point of all filesystems.  If the filesystem succeeds
-               in mounting itself, sb should be returned, otherwise NULL.  options is
-               a pointer to a maximum of PAGE_SIZE-1 bytes of options, typically a zero
-               terminated string passed from mount.  This page is freed after read_super
-               returns, so do not use any pointers into it.
-
-               This routine _must_ set the s_op member of sb to point to a valid
-               super_operations structure.
-
-       const char *name;
-
-               Name points to a string that the system will know the filesystem by.
-
-       int requires_dev;
-
-               Set this flag to 1 if the filesystem requires a block device to be mounted
-               on.
-
-       struct file_system_type * next;
-
-               This field points to the next file_system_type that is present in the system,
-               and should be initialized to NULL.
-
-struct super_operations
-=======================
-
-The super_operations structure is found through the s_op member of the
-super_block structure.
-
-       void (*read_inode) (struct inode *inode);
-       [optional - doesn't quite make sense]
-               read_inode is called by the VFS when iget is called requesting an inode
-               not already present in the inode table.  i_ino is set to the number of the
-               inode requested.
-
-               The i_op member of inode should be set to a valid inode_operations
-               structure.  Typically filesystems have separate inode_operations for
-               directories, files and symlinks.  i_op can be NULL.
-
-       int (*notify_change) (struct inode *, struct iattr *);
-       [optional]
-       void (*write_inode) (struct inode *);
-       [optional]
-
-       int (*put_inode) (struct inode *inode);
-       [optional]
-               put_inode is called by the VFS when the last instance of inode is released
-               with a call to iput.  The only special consideration that should be made
-               is that iget may reuse inode without calling read_inode unless clear_inode
-               is called.  put_inode MUST return 1 if it called clear_inode on the inode,
-               otherwise zero.
-
-       void (*put_super) (struct super_block *);
-       [optional]
-       void (*write_super) (struct super_block *);
-       [optional]
-       void (*statfs) (struct super_block *, struct statfs *, int);
-       [optional]
-       int (*remount_fs) (struct super_block *, int *, char *);
-       [optional]
-
-
-struct inode_operations
-=======================
-
-       struct file_operations * default_file_ops;
-       [mandatory]
-               All inode_operations structures must have default_file_ops pointing to
-               a valid file_operations structure.
-
-       int (*create) (struct inode *,const char *,int,int,struct inode **);
-       [optional]
-
-       int (*lookup) (struct inode *dir, const char *name, int len, struct inode **result);
-       [optional]
-               lookup is called when the VFS wishes to have the filesystem resolve a name
-               into an inode.  Dir is a directory on the filesystem that--we hope--contains
-               the zero-terminated string name (length len).  A return value of zero indicates
-               that there is a valid inode stored in *result.
-
-***            Note: lofs assumes that any filesystem returns an inode within the filesystem
-               for all directory inodes.  Therefore, __iget(sb,ino,0) should be used to fetch
-               the inode in a filesystem's lookup routine.
-
-       int (*link) (struct inode *,struct inode *,const char *,int);
-       [optional]
-       int (*unlink) (struct inode *,const char *,int);
-       [optional]
-       int (*symlink) (struct inode *,const char *,int,const char *);
-       [optional]
-       int (*mkdir) (struct inode *,const char *,int,int);
-       [optional]
-       int (*rmdir) (struct inode *,const char *,int);
-       [optional]
-       int (*mknod) (struct inode *,const char *,int,int,int);
-       [optional]
-       int (*rename) (struct inode *,const char *,int,struct inode *,const char *,int, int);
-       [optional]
-
-       int (*readlink) (struct inode *inode, char *buf, int len);
-       [optional]
-               readlink is called by the VFS to read the contents of a symbolic link.
-               inode is an inode that meets the S_ISLNK test, and buf points to a buffer
-               of len bytes.
-
-       int (*follow_link) (struct inode *,struct inode *,int,int,struct inode **);
-       [optional]
-               follow_link must be implemented if readlink is implemented.
-               Note that follow_link can return a different inode than a
-               lookup_dentry() on the result of readlink() would return.
-               The proc filesystem, in particular, uses this feature heavily.
-               For most user filesystems, however, follow_link() and readlink()
-               should return consistent results.
-
-       int (*readpage) (struct inode *, struct page *);        [optional]
-       int (*writepage) (struct inode *, struct page *);       [mandatory with readpage]
-
-               In order for files to be mmap'd, readpage and writepage are required.
-               A filesystem can use generic_readpage/writepage if it supports the bmap
-               function.  Otherwise, a custom version must be written. 
-
-       int (*bmap) (struct inode *,int);
-       [optional]
-       void (*truncate) (struct inode *);
-       [optional]
-       int (*permission) (struct inode *, int);
-       [optional]
-       int (*smap) (struct inode *,int);
-       [optional]
-
-struct file_operations
-======================
-
-       int (*lseek) (struct inode *, struct file *, off_t, int);
-       int (*read) (struct inode *, struct file *, char *, int);
-       int (*write) (struct inode *, struct file *, const char *, int);
-       int (*readdir) (struct inode *, struct file *, void *, filldir_t);
-       unsigned int (*poll) (struct file *, poll_table *);
-       int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
-       int (*mmap) (struct inode *, struct file *, struct vm_area_struct *);
-       int (*open) (struct inode *, struct file *);
-       void (*release) (struct inode *, struct file *);
-       int (*fsync) (struct inode *, struct file *);
-       int (*fasync) (struct inode *, struct file *, int);
-       int (*check_media_change) (kdev_t dev);
-       int (*revalidate) (kdev_t dev);
-
index 94cf2ea4e66a10ec712aa47eccd12992ee49b5c2..7719d69fb44b01a5705089572c62c87ba73b885e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 1
-SUBLEVEL = 107
+SUBLEVEL = 108
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
index 80a7434fbdb2b49430cdc23b89c138740750aad1..fb8dfeb3518f58b543a5681bb3444566a3363a08 100644 (file)
@@ -547,7 +547,8 @@ ENTRY(sys_call_table)
        .long SYMBOL_NAME(sys_capget)
        .long SYMBOL_NAME(sys_capset)           /* 185 */
        .long SYMBOL_NAME(sys_sigaltstack)
+       .long SYMBOL_NAME(sys_sendfile)
        
-       .rept NR_syscalls-186
+       .rept NR_syscalls-187
                .long SYMBOL_NAME(sys_ni_syscall)
        .endr
index a18f4091c3732efb716e7bca455a48a248db8b32..ecd413e5811933d9c56f3048dbc171e04e20efcb 100644 (file)
@@ -466,7 +466,7 @@ int get_cpuinfo(char * buffer)
                        continue;
 #endif
                p += sprintf(p, "processor\t: %d\n"
-                              "CPU family\t: %c\n"
+                              "cpu family\t: %c\n"
                               "model\t\t: %s\n"
                               "vendor_id\t: %s\n",
                               n,
@@ -512,9 +512,9 @@ int get_cpuinfo(char * buffer)
                                "hlt_bug\t\t: %s\n"
                                "sep_bug\t\t: %s\n"
                                "f00f_bug\t: %s\n"
-                               "FPU\t\t: %s\n"
-                               "FPU_exception\t: %s\n"
-                               "CPUID level\t: %d\n"
+                               "fpu\t\t: %s\n"
+                               "fpu_exception\t: %s\n"
+                               "cpuid level\t: %d\n"
                                "wp\t\t: %s\n"
                                "flags\t\t:",
                             c->fdiv_bug ? "yes" : "no",
index 59a605d7196d98052b8d9d13a3f211408dcdba47..9f1a1a6a531f1d1932b4132f78039f9f5b0eb533 100644 (file)
@@ -8,7 +8,6 @@
  *  moment everything difficult is handled by the generic code.
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <linux/types.h>
 #include <linux/init.h>
index d854a46cd3f3336ec5274f0545f678dced01fad9..2a60c5621a841df85f78b56d68e4516fb9ae9a43 100644 (file)
@@ -6,7 +6,6 @@
  *  This file contains the HP300-specific time handling code.
  */
 
-#include <linux/config.h>
 #include <asm/ptrace.h>
 #include <linux/types.h>
 #include <linux/init.h>
index 633fd10a2646a2da009a0b106333255126d8ee98..9d66a42232818ba3b0896d5959b72c816290942b 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/linkage.h>
 #include <linux/sched.h>
index ed3720863caf8e66dbf32bdfaf8a97497edf1150..9ee60f0a4c5309837e9b998c4fd6a61cbbbb6a95 100644 (file)
@@ -69,6 +69,7 @@
  * - 
  */
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index c464811d7a53178ff8a1437fb0fa453fed298f72..7c99532a751aa44f6ba3d226638d04688b95f606 100644 (file)
@@ -5,7 +5,6 @@
  *     via them as are assorted bits and bobs - eg rtc, adb.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
index e005ec53c2458102e7c02589b65d1af40fbc92c2..9db5af9ccc9c7a745da9b40de99b9780c4c823ae 100644 (file)
@@ -21,7 +21,7 @@ CONFIG_MACH_SPECIFIC=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_MODULES=y
 # CONFIG_MODVERSIONS is not set
-CONFIG_KERNELD=y
+CONFIG_KMOD=y
 CONFIG_PCI=y
 CONFIG_PCI_OLD_PROC=y
 CONFIG_NET=y
index 998030909feba71ab7e0f1d5dd730efd3464c093..c846c732c9441ad9ca047567e958c6a6250f5d22 100644 (file)
@@ -20,7 +20,7 @@ CONFIG_ALL_PPC=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_MODULES=y
 CONFIG_MODVERSIONS=y
-CONFIG_KERNELD=y
+CONFIG_KMOD=y
 CONFIG_PCI=y
 CONFIG_PCI_OLD_PROC=y
 CONFIG_NET=y
index 73300f68e62a359c63bc5e5398f4c31f3670d305..7b16fe122e0d92d74dbe544e573069a11ffe5205 100644 (file)
@@ -21,7 +21,7 @@ CONFIG_MACH_SPECIFIC=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_MODULES=y
 CONFIG_MODVERSIONS=y
-CONFIG_KERNELD=y
+CONFIG_KMOD=y
 CONFIG_PCI=y
 # CONFIG_PCI_OPTIMIZE is not set
 CONFIG_PCI_OLD_PROC=y
index 4d3958fd95992805ccbb1632f182b8fc2b702954..e0c6891a9ad4f5b35c7bb96b381a171f32887d99 100644 (file)
@@ -52,7 +52,6 @@ int unicount[MAX_FONTLEN];
 void addpair(int fp, int un)
 {
   int i;
-  unicode hu;
 
   if ( un <= 0xfffe )
     {
index 3a49144c6e3384feea9f1409df49ad1d614b002e..867ae096cb59fe91117301a8e7feaa3a3f4d0659 100644 (file)
@@ -23,8 +23,8 @@
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
 #endif
-#ifdef CONFIG_KERNELD
-#include <linux/kerneld.h>
+#ifdef CONFIG_KMOD
+#include <linux/kmod.h>
 #endif
 
 #ifdef __mc68000__
@@ -262,7 +262,7 @@ static void set_con2fb_map(int unit, int newidx)
     }
 }
 
-#ifdef CONFIG_KERNELD
+#ifdef CONFIG_KMOD
 static void try_to_load(int fb)
 {
        char modname[16];
@@ -337,7 +337,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                    return -EINVAL;
                if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
                    return -EINVAL;
-#ifdef CONFIG_KERNELD
+#ifdef CONFIG_KMOD
                if (!registered_fb[con2fb.framebuffer])
                    try_to_load(con2fb.framebuffer);
 #endif
@@ -419,7 +419,7 @@ fb_open(struct inode *inode, struct file *file)
        int fbidx = GET_FB_IDX(inode->i_rdev);
        struct fb_info *info;
 
-#ifdef CONFIG_KERNELD
+#ifdef CONFIG_KMOD
        if (!(info = registered_fb[fbidx]))
                try_to_load(fbidx);
 #endif
index deb651e4b76f4d6839ed6a3bf9b53b19f704c004..e84fc6ccd140b28d3461fa51c7670a2ffea13519 100644 (file)
@@ -20,8 +20,6 @@
  *      - making it shorter - scr_readw are macros which expand in PRETTY long code
  */
 
-#include <linux/config.h>
-
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/errno.h>
index 0ea2987672c479fec3bb448f60358e1991847eee..215b0bc9e6d368c93e3abb91309743c9292ff53b 100644 (file)
@@ -8,7 +8,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index 149479b3c7cf00786fcc045bce0489f1c8cc88a4..1991659f007146673912cedc7ff3c3e32a83c186 100644 (file)
@@ -12,9 +12,7 @@
  * most of a2025 and sunlance with the aim of merging them, so the 
  * common code was pretty obvious.
  */
-#include <linux/config.h>
 #include <linux/module.h>
-
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/types.h>
index 23f9bbc1dd0193c71a819ce30299f92d03c59fed..82881604aaa9c03ad1c51c81901ab376ca4ce52e 100644 (file)
@@ -35,6 +35,7 @@
 
 /*****************************************************************************/
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index e6773383125683cd0f230d9ce456a0bdba96675e..a481a56f9a8fa259ee5bf63f7fbe9e7a54f8f3aa 100644 (file)
@@ -438,7 +438,7 @@ static void gentbl_hapn4800(FILE *f)
 {
         int i, j, k, l;
        float s;
-       float c[40];
+       float c[44];
        float min, max;
 
        fprintf(f, "\n/*\n * hapn4800 specific tables\n */\n\n");
index 0c3f51724aab3bde5aa790c11ca3077451c9b0f0..fb7f617296001484a730da68aa4b587751594fe4 100644 (file)
@@ -5,9 +5,7 @@
  * Uses the generic 7990.c LANCE code.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
-
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/types.h>
index 8b8f5358bb5a9bd1864b2ab8aa933d461320f03e..82880703372eb1612edb34c52d39873eb2d77760 100644 (file)
@@ -42,7 +42,6 @@
 
 static const char *version = "sktr.c: v1.01 08/29/97 by Christoph Goos\n";
 
-#include <linux/config.h>
 #ifdef MODULE
 #include <linux/module.h>
 #include <linux/version.h>
index 2a5ff92a65b85df55e876009661592b263a3c9a9..4d2a787171a1048ffc3a536d627b502cc6cb6dd4 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef NCR53C9X_H
 #define NCR53C9X_H
 
+#include <linux/config.h>
+
 /* Macros for debugging messages */
 
 /* #define DEBUG_ESP */
index bfbddd0c97b93e46ab10186d5e6f3a798822b239..9b2aad5c2eae79b957ca3048c5dddb9109938f45 100644 (file)
@@ -14,8 +14,8 @@
 #include <linux/stat.h>
 #include <linux/init.h>
 #include <linux/config.h>
-#ifdef CONFIG_KERNELD
-#include <linux/kerneld.h>
+#ifdef CONFIG_KMOD
+#include <linux/kmod.h>
 #endif
 
 #include <asm/irq.h>
@@ -104,7 +104,7 @@ __initfunc(int pluto_detect(Scsi_Host_Template *tpnt))
                fcscount++;
        PLND(("%d channels online\n", fcscount))
        if (!fcscount) {
-#if defined(MODULE) && defined(CONFIG_FC4_SOC_MODULE) && defined(CONFIG_KERNELD)
+#if defined(MODULE) && defined(CONFIG_FC4_SOC_MODULE) && defined(CONFIG_KMOD)
                request_module("soc");
                
                for_each_online_fc_channel(fc)
index 11a69533e559856fe018da598ef47129f1202c55..27ebabbaf23f2706ac433611b15841e5d938ed68 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/malloc.h>
index e908e0b5bd86647230f3e532f8f574bb3b74592c..6d7b77121eada562092a3f702049cedf93f2e8ac 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/malloc.h>
 #include <linux/types.h>
index a1859cb985789eb54f90998ea215f3b4db6639e2..9cf4c7b8d85fe4e84867deda1eb2906bdd134e0a 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef __MSND_CLASSIC_H
 #define __MSND_CLASSIC_H
 
+#include <linux/config.h>
+
 #define DSP_NUMIO              0x10
 
 #define        HP_MEMM                 0x08
index 62eaaa49c087f2d2ea50e0c23f4857549d4d9c8e..2b88be089b1c0480703c6bdcf78b7a7bc295c233 100644 (file)
@@ -24,7 +24,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/malloc.h>
 #include <linux/types.h>
index 69bac917a92b247a0c91f7f1aab15dba1dafebb5..1c07f957897e47c20272c7491efea7f6a658fb31 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef __MSND_PINNACLE_H
 #define __MSND_PINNACLE_H
 
+#include <linux/config.h>
+
 #define DSP_NUMIO              0x08
 
 #define        HP_DSPR                 0x04
index fb6a00d6bbcb104c0e7e6f40358f9ef6cd67ba4b..a6b48053e644f6a17ecd556917d7bec6eaeb0044 100644 (file)
@@ -34,7 +34,6 @@
  *     locking at some point in 2.3.x.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/malloc.h>
 #include <linux/types.h>
index 0869c6e079bce9909ca94e61409dc9bd0c30ff30..e2d79b1ed786856027f385cc55c8a3de0fd8c02e 100644 (file)
@@ -23,6 +23,7 @@
 
 */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index 0cba5b92aacceb5869b3c5491316118d627cf70c..064e4fcf57dda28b1fac0132164e82d888fb2eab 100644 (file)
@@ -201,7 +201,7 @@ void fbcon_ilbm_putcs(struct vc_data *conp, struct display *p, const char *s,
 #if defined(__BIG_ENDIAN)
                d = *cdat1++<<24 | *cdat2++<<16 | *cdat3++<<8 | *cdat4++;
 #elif defined(__LITTLE_ENDIAN)
-               d = *cdat1++ | *cdat2++<<8 | *cdat3++<<16 | *cdat4++<<32);
+               d = *cdat1++ | *cdat2++<<8 | *cdat3++<<16 | *cdat4++<<24;
 #else
 #error FIXME: No endianness??
 #endif
index 576a8e5a0c411887cdb23f5bbba1cdf2013e1852..1b949e5c88bbefc1ce74a722dd5e0b2f25975c4f 100644 (file)
@@ -10,6 +10,7 @@
  *  more details.
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
index 5db5178b1fa2aa002a826b1474a5cc86b1ce520b..8af3c3b34cb2c3f478efb2b906c86fe035d6399e 100644 (file)
@@ -10,6 +10,7 @@
  *  more details.
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
index 5e177b6d7e98b7b2d1eeb4f71f2156bae53185f9..d5779f15b5a965535fdfb0d244952ebdb676ddf2 100644 (file)
@@ -10,6 +10,7 @@
  *  more details.
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
index 251eb2977037101893f34119b836077eee2736b3..2694664df0d8727dc50e8c60bbd99725acf3477e 100644 (file)
@@ -6,7 +6,6 @@
  * No! -- Jes
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 20c2b13cab9f06b7b4ac207eb0d393643bb191c6..1b55b8ea7f9a915b7737f12e6fb1fbfe134b3898 100644 (file)
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
index 0b4ba9b4c52b857b7337ab8472bc28480db94210..5331bce982f229c42df4080e260e86c444227524 100644 (file)
@@ -232,7 +232,7 @@ static int get_kstat(char * buffer)
 
 #ifdef __SMP__
        len = sprintf(buffer,
-               "CPU  %u %u %u %lu\n",
+               "cpu  %u %u %u %lu\n",
                kstat.cpu_user,
                kstat.cpu_nice,
                kstat.cpu_system,
index a4e847e641d3d25863d0455b8c12ff1a2e776350..7ab56a4b8b8239f99b2ac164a5e0beba0d3d5699 100644 (file)
@@ -297,21 +297,25 @@ static int do_poll(unsigned int nfds, struct pollfd *fds, poll_table *wait)
 
                current->state = TASK_INTERRUPTIBLE;
                for (fdpnt = fds, j = 0; j < nfds; j++, fdpnt++) {
+                       int fd;
                        unsigned int mask;
-                       struct file * file;
 
-                       mask = POLLNVAL;
-                       /* poll_wait increments f_count if needed */
-                       file = fcheck(fdpnt->fd);
-                       if (file != NULL) {
-                               mask = DEFAULT_POLLMASK;
-                               if (file->f_op && file->f_op->poll)
-                                       mask = file->f_op->poll(file, wait);
-                               mask &= fdpnt->events | POLLERR | POLLHUP;
-                       }
-                       if (mask) {
-                               wait = NULL;
-                               count++;
+                       mask = 0;
+                       fd = fdpnt->fd;
+                       if (fd >= 0) {
+                               /* poll_wait increments f_count if needed */
+                               struct file * file = fcheck(fd);
+                               mask = POLLNVAL;
+                               if (file != NULL) {
+                                       mask = DEFAULT_POLLMASK;
+                                       if (file->f_op && file->f_op->poll)
+                                               mask = file->f_op->poll(file, wait);
+                                       mask &= fdpnt->events | POLLERR | POLLHUP;
+                               }
+                               if (mask) {
+                                       wait = NULL;
+                                       count++;
+                               }
                        }
                        fdpnt->revents = mask;
                }
index d41e6977ce42d9edc1aa41a93107aa64301b8957..293af753415ba5c30b3a3c3307afa411f1444027 100644 (file)
@@ -3,7 +3,7 @@ Mon Dec 15 1997   Krzysztof G. Baranowski <kgb@manjak.knm.org.pl>
 
 Fri Jan 23 1998   Krzysztof G. Baranowski <kgb@manjak.knm.org.pl>
        *    inode.c: corrected 1 track offset setting (in sb->sv_block_base).
-                     Originally it was overriden (by setting to zero)
+                     Originally it was overridden (by setting to zero)
                      in detected_[xenix,sysv4,sysv2,coherent]. Thanks
                      to Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl>
                      for identifying the problem.
index b5801e994a2ee78751dda043073fbd3ae4a74a04..6c31360fd6e46f6c983c3aa3399e7942c64208fc 100644 (file)
@@ -1,11 +1,11 @@
 #
-# Makefile for the Linux SystemV/Coherent-filesystem routines.
+# Makefile for the Linux SystemV/Coherent filesystem routines.
 #
 # Note! Dependencies are done automagically by 'make dep', which also
 # removes any old dependencies. DON'T put your own dependencies here
-# unless it's something special (ie not a .c file).
+# unless it's something special (not a .c file).
 #
-# Note 2! The CFLAGS definitions are now in the main makefile...
+# Note 2! The CFLAGS definitions are now in the main makefile.
 
 O_TARGET := sysv.o
 O_OBJS   := ialloc.o balloc.o inode.o file.o dir.o symlink.o namei.o \
index 2bb4422202d8e05ab2861f121089e265fc87a3ce..f4cf216c5d944dc1281e494cf2774084949748fe 100644 (file)
@@ -36,7 +36,7 @@
 static ssize_t sysv_file_write(struct file *, const char *, size_t, loff_t *);
 
 /*
- * We have mostly NULL's here: the current defaults are ok for
+ * We have mostly NULLs here: the current defaults are OK for
  * the coh filesystem.
  */
 static struct file_operations sysv_file_operations = {
@@ -220,7 +220,7 @@ static ssize_t sysv_file_write(struct file * filp, const char * buf,
                return -EINVAL;
        }
 /*
- * ok, append may not work when many processes are writing at the same time
+ * OK, append may not work when many processes are writing at the same time
  * but so what. That way leads to madness anyway.
  * But we need to protect against simultaneous truncate as we may end up
  * writing our data into blocks that have meanwhile been incorporated into
index 9130672d0496a17b9d80ec9df73d02cddc379b1b..7c919caff637be3a49f5281f9bfaaa6dd93c25ba 100644 (file)
@@ -24,7 +24,7 @@
 
 /*
  * Truncate has the most races in the whole filesystem: coding it is
- * a pain in the a**. Especially as I don't do any locking...
+ * a pain in the a**, especially as I don't do any locking.
  *
  * The code may look a bit weird, but that's just because I've tried to
  * handle things like file-size changes in a somewhat graceful manner.
index 0f45e2fc32abb3384fd938b4a4d14354523ba0ba..a5c4659d33380d25facee89ac40e222263a72f84 100644 (file)
 #define __NR_capget            184
 #define __NR_capset            185
 #define __NR_sigaltstack       186
+#define __NR_sendfile          187
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */
 
index 0a13816da42b4467a7277b3f1a5bc9c10ecb3aed..079735e034ea5f2fd3c472640eae28b17b394dfa 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _M68K_PGTABLE_H
 #define _M68K_PGTABLE_H
 
+#include <linux/config.h>
 #include <asm/setup.h>
 
 #ifndef __ASSEMBLY__
index a28fed4f321ba29e51f0eb5090a9f3191d48defa..845201332d00692af246b5013083278b86b36f0a 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef _LINUX_CONSOLE_COMPAT_H_
 #define _LINUX_CONSOLE_COMPAT_H_
 
+#include <linux/config.h>
+
 #undef video_num_columns
 #undef video_num_lines
 #undef video_size_row
index 5eb9928dc11a702e876dcab19da50609d0fee26c..4d8afd25d173543a0c862753ba1023e04abe653c 100644 (file)
@@ -10,8 +10,6 @@
  */
 #define CUR_DEFAULT CUR_UNDERLINE
 
-#include <linux/config.h>
-
 #define NPAR 16
 
 struct vc_data {
index d9659636834378b1d5763720a29f35adb123a52f..12627e680813a6b206347f014a02e10b76647232 100644 (file)
@@ -4,8 +4,6 @@
  * Interface between console.c, tty_io.c, vt.c, vc_screen.c and selection.c
  */
 
-#include <linux/config.h>
-
 extern int sel_cons;
 
 extern void clear_selection(void);
@@ -60,8 +58,6 @@ extern void putconsxy(int currcons, char *p);
 
 /* how to access screen memory */
 
-#include <linux/config.h>
-
 static inline void scr_writew(unsigned short val, unsigned short *addr)
 {
        /* simply store the value in the "shadow screen" memory */
index f44d1c0ac61ae2447a1bd7ab2a55af73df7d6092..26cea095ee10434ad8cbe19fb6650799fdba3699 100644 (file)
@@ -567,6 +567,23 @@ static inline unsigned long generic_file_readahead(int reada_ok,
        return page_cache;
 }
 
+/*
+ * "descriptor" for what we're up to with a read.
+ * This allows us to use the same read code yet
+ * have multiple different users of the data that
+ * we read from a file.
+ *
+ * The simplest case just copies the data to user
+ * mode.
+ */
+typedef struct {
+       size_t written;
+       size_t count;
+       char * buf;
+       int error;
+} read_descriptor_t;
+
+typedef int (*read_actor_t)(read_descriptor_t *, const char *, unsigned long);
 
 /*
  * This is a generic file read routine, and uses the
@@ -576,23 +593,14 @@ static inline unsigned long generic_file_readahead(int reada_ok,
  * This is really ugly. But the goto's actually try to clarify some
  * of the logic when it comes to error handling etc.
  */
-
-ssize_t generic_file_read(struct file * filp, char * buf,
-                         size_t count, loff_t *ppos)
+static void do_generic_file_read(struct file * filp, loff_t *ppos, read_descriptor_t * desc, read_actor_t actor)
 {
        struct dentry *dentry = filp->f_dentry;
        struct inode *inode = dentry->d_inode;
-       ssize_t error, read;
        size_t pos, pgpos, page_cache;
        int reada_ok;
        int max_readahead = get_max_readahead(inode);
 
-       if (!access_ok(VERIFY_WRITE, buf, count))
-               return -EFAULT;
-       if (!count)
-               return 0;
-       error = 0;
-       read = 0;
        page_cache = 0;
 
        pos = *ppos;
@@ -620,12 +628,12 @@ ssize_t generic_file_read(struct file * filp, char * buf,
  * Then, at least MIN_READAHEAD if read ahead is ok,
  * and at most MAX_READAHEAD in all cases.
  */
-       if (pos + count <= (PAGE_SIZE >> 1)) {
+       if (pos + desc->count <= (PAGE_SIZE >> 1)) {
                filp->f_ramax = 0;
        } else {
                unsigned long needed;
 
-               needed = ((pos + count) & PAGE_MASK) - pgpos;
+               needed = ((pos + desc->count) & PAGE_MASK) - pgpos;
 
                if (filp->f_ramax < needed)
                        filp->f_ramax = needed;
@@ -678,20 +686,20 @@ success:
 
                offset = pos & ~PAGE_MASK;
                nr = PAGE_SIZE - offset;
-               if (nr > count)
-                       nr = count;
                if (nr > inode->i_size - pos)
                        nr = inode->i_size - pos;
-               nr -= copy_to_user(buf, (void *) (page_address(page) + offset), nr);
-               release_page(page);
-               error = -EFAULT;
-               if (!nr)
-                       break;
-               buf += nr;
+
+               /*
+                * The actor routine returns how many bytes were actually used..
+                * NOTE! This may not be the same as how much of a user buffer
+                * we filled up (we may be padding etc), so we can only update
+                * "pos" here (the actor routine has to update the user buffer
+                * pointers and the remaining count).
+                */
+               nr = actor(desc, (const char *) (page_address(page) + offset), nr);
                pos += nr;
-               read += nr;
-               count -= nr;
-               if (count)
+               release_page(page);
+               if (nr && desc->count)
                        continue;
                break;
        }
@@ -709,7 +717,7 @@ no_cached_page:
                         */
                        if (page_cache)
                                continue;
-                       error = -ENOMEM;
+                       desc->error = -ENOMEM;
                        break;
                }
 
@@ -738,11 +746,14 @@ no_cached_page:
                if (reada_ok && filp->f_ramax > MIN_READAHEAD)
                        filp->f_ramax = MIN_READAHEAD;
 
-               error = inode->i_op->readpage(filp, page);
-               if (!error)
-                       goto found_page;
-               release_page(page);
-               break;
+               {
+                       int error = inode->i_op->readpage(filp, page);
+                       if (!error)
+                               goto found_page;
+                       desc->error = error;
+                       release_page(page);
+                       break;
+               }
 
 page_read_error:
                /*
@@ -750,15 +761,18 @@ page_read_error:
                 * Try to re-read it _once_. We do this synchronously,
                 * because this happens only if there were errors.
                 */
-               error = inode->i_op->readpage(filp, page);
-               if (!error) {
-                       wait_on_page(page);
-                       if (PageUptodate(page) && !PageError(page))
-                               goto success;
-                       error = -EIO; /* Some unspecified error occurred.. */
+               {
+                       int error = inode->i_op->readpage(filp, page);
+                       if (!error) {
+                               wait_on_page(page);
+                               if (PageUptodate(page) && !PageError(page))
+                                       goto success;
+                               error = -EIO; /* Some unspecified error occurred.. */
+                       }
+                       desc->error = error;
+                       release_page(page);
+                       break;
                }
-               release_page(page);
-               break;
        }
 
        *ppos = pos;
@@ -766,9 +780,146 @@ page_read_error:
        if (page_cache)
                free_page(page_cache);
        UPDATE_ATIME(inode);
-       if (!read)
-               read = error;
-       return read;
+}
+
+static int file_read_actor(read_descriptor_t * desc, const char *area, unsigned long size)
+{
+       unsigned long left;
+       unsigned long count = desc->count;
+
+       if (size > count)
+               size = count;
+       left = __copy_to_user(desc->buf, area, size);
+       if (left) {
+               size -= left;
+               desc->error = -EFAULT;
+       }
+       desc->count = count - size;
+       desc->written += size;
+       desc->buf += size;
+       return size;
+}
+
+/*
+ * This is the "read()" routine for all filesystems
+ * that can use the page cache directly.
+ */
+ssize_t generic_file_read(struct file * filp, char * buf, size_t count, loff_t *ppos)
+{
+       ssize_t retval;
+
+       retval = -EFAULT;
+       if (access_ok(VERIFY_WRITE, buf, count)) {
+               retval = 0;
+               if (count) {
+                       read_descriptor_t desc;
+
+                       desc.written = 0;
+                       desc.count = count;
+                       desc.buf = buf;
+                       desc.error = 0;
+                       do_generic_file_read(filp, ppos, &desc, file_read_actor);
+
+                       retval = desc.written;
+                       if (!retval)
+                               retval = desc.error;
+               }
+       }
+       return retval;
+}
+
+static int file_send_actor(read_descriptor_t * desc, const char *area, unsigned long size)
+{
+       ssize_t written;
+       unsigned long count = desc->count;
+       struct file *file = (struct file *) desc->buf;
+       struct inode *inode = file->f_dentry->d_inode;
+
+       if (size > count)
+               size = count;
+       down(&inode->i_sem);
+       set_fs(KERNEL_DS);
+       written = file->f_op->write(file, area, size, &file->f_pos);
+       set_fs(USER_DS);
+       up(&inode->i_sem);
+       if (written < 0) {
+               desc->error = written;
+               written = 0;
+       }
+       desc->count = count - written;
+       desc->written += written;
+       return written;
+}
+
+asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, size_t count)
+{
+       ssize_t retval;
+       struct file * in_file, * out_file;
+       struct inode * in_inode, * out_inode;
+
+       lock_kernel();
+
+       /*
+        * Get input file, and verify that it is ok..
+        */
+       retval = -EBADF;
+       in_file = fget(in_fd);
+       if (!in_file)
+               goto out;
+       if (!(in_file->f_mode & FMODE_READ))
+               goto fput_in;
+       retval = -EINVAL;
+       in_inode = in_file->f_dentry->d_inode;
+       if (!in_inode)
+               goto fput_in;
+       if (!in_inode->i_op || !in_inode->i_op->readpage)
+               goto fput_in;
+       retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, in_file->f_pos, count);
+       if (retval)
+               goto fput_in;
+
+       /*
+        * Get output file, and verify that it is ok..
+        */
+       retval = -EBADF;
+       out_file = fget(out_fd);
+       if (!out_file)
+               goto fput_in;
+       if (!(out_file->f_mode & FMODE_WRITE))
+               goto fput_out;
+       retval = -EINVAL;
+       if (!out_file->f_op || !out_file->f_op->write)
+               goto fput_out;
+       out_inode = out_file->f_dentry->d_inode;
+       if (!out_inode)
+               goto fput_out;
+       retval = locks_verify_area(FLOCK_VERIFY_WRITE, out_inode, out_file, out_file->f_pos, count);
+       if (retval)
+               goto fput_out;
+
+       retval = 0;
+       if (count) {
+               read_descriptor_t desc;
+
+               desc.written = 0;
+               desc.count = count;
+               desc.buf = (char *) out_file;
+               desc.error = 0;
+               do_generic_file_read(in_file, &in_file->f_pos, &desc, file_send_actor);
+
+               retval = desc.written;
+               if (!retval)
+                       retval = desc.error;
+       }
+
+
+fput_out:
+       fput(out_file);
+fput_in:
+       fput(in_file);
+out:
+       unlock_kernel();
+       return retval;
 }
 
 /*