]> git.neil.brown.name Git - history.git/commitdiff
Import 2.1.80pre2 2.1.80pre2
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:14:28 +0000 (15:14 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:14:28 +0000 (15:14 -0500)
Makefile
drivers/block/Makefile
drivers/block/ide-proc.c
drivers/sound/Defines
include/linux/fs.h
include/linux/sched.h
kernel/fork.c
mm/mmap.c
net/ipv4/ipconfig.c

index 2d5c48b4bb02353df4c233b6f6d96945e8299747..719235cff08ca7e7ae8cbd02a7ca47ec603db94e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 1
-SUBLEVEL = 79
+SUBLEVEL = 80
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
 
index 22f5daebd55608b1cc9f962052905f3595bf5038..8721e5dd192cda88c805dffdaffcd77de5ca6abd 100644 (file)
@@ -90,11 +90,12 @@ ifeq ($(CONFIG_BLK_DEV_IDE),y)
   L_OBJS += ide-probe.o
 else
   ifeq ($(CONFIG_BLK_DEV_IDE),m)
-  MX_OBJS += ide.o
+  MIX_OBJS += ide.o
   ifeq ($(CONFIG_PROC_FS),y)
     M_OBJS += ide-proc.o
   endif
-  M_OBJS += ide-probe.o
+  M_OBJS += ide-mod.o
+  MX_OBJS += ide-probe.o
   endif
 endif
 
@@ -118,7 +119,6 @@ ifeq ($(CONFIG_BLK_DEV_PS2),y)
 L_OBJS += ps2esdi.o
 endif
 
-
 ifeq ($(CONFIG_BLK_DEV_DTC2278),y)
 L_OBJS += dtc2278.o
 endif
@@ -250,3 +250,6 @@ else
 endif
 
 include $(TOPDIR)/Rules.make
+
+ide-mod.o: ide.o ide-proc.o
+       $(LD) $(LD_RFLAG) -r -o $@ ide.o ide-proc.o
index 86718864ae928e3dce6063bf99a5d8a7296ed986..102e641ff28c6ef2c54621a1043b76af322c1a8e 100644 (file)
@@ -87,16 +87,6 @@ static int ide_getxdigit(char c)
        return digit;
 }
 
-static int ide_getdigit(char c)
-{
-       int digit;
-       if (isdigit(c))
-               digit = c - '0';
-       else
-               digit = -1;
-       return digit;
-}
-
 static int xx_xx_parse_error (const char *data, unsigned long len, const char *msg)
 {
        char errbuf[16];
@@ -254,24 +244,6 @@ parse_error:
        return xx_xx_parse_error(start, startn, msg);
 }
 
-static int proc_ide_read_drivers
-       (char *page, char **start, off_t off, int count, int *eof, void *data)
-{
-       char            *out = page;
-       int             len;
-       ide_module_t    *p = ide_modules;
-       ide_driver_t    *driver;
-
-       while (p) {
-               driver = (ide_driver_t *) p->info;
-               if (p->type == IDE_DRIVER_MODULE && driver)
-                       out += sprintf(out, "%s version %s\n", driver->name, driver->version);
-               p = p->next;
-       }
-       len = out - page;
-       PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
-}
-
 static int proc_ide_read_config
        (char *page, char **start, off_t off, int count, int *eof, void *data)
 {
@@ -311,6 +283,34 @@ static int proc_ide_read_imodel
 }
 #endif /* CONFIG_PCI */
 
+static int ide_getdigit(char c)
+{
+       int digit;
+       if (isdigit(c))
+               digit = c - '0';
+       else
+               digit = -1;
+       return digit;
+}
+
+static int proc_ide_read_drivers
+       (char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+       char            *out = page;
+       int             len;
+       ide_module_t    *p = ide_modules;
+       ide_driver_t    *driver;
+
+       while (p) {
+               driver = (ide_driver_t *) p->info;
+               if (p->type == IDE_DRIVER_MODULE && driver)
+                       out += sprintf(out, "%s version %s\n", driver->name, driver->version);
+               p = p->next;
+       }
+       len = out - page;
+       PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
+}
+
 static int proc_ide_read_type
        (char *page, char **start, off_t off, int count, int *eof, void *data)
 {
index 62d2f17733f40295211273a6eac038d9d69ac807..7f53bafc446d4c097660416c660e3250dbcbf28b 100644 (file)
@@ -97,10 +97,18 @@ CONFIG_SBDSP=y
 endif
 endif
 
-ifdef CONFIG_SB
-ifneq ($(CONFIG_UART401),Y)
-CONFIG_UART401=y
-endif
+
+
+ifdef CONFIG_SB 
+  ifeq ($(CONFIG_SB),m)
+    ifneq ($(CONFIG_UART401),Y)
+      CONFIG_UART401=m
+    endif
+  else
+    ifneq ($(CONFIG_UART401),Y)
+      CONFIG_UART401=y
+    endif
+  endif
 endif
 
 ifdef CONFIG_TRIX
index dab098db63888034e82cd98c04a828d0a0806416..d8320b773ad44e4970e82f64fd223ca96868ba18 100644 (file)
@@ -321,8 +321,8 @@ struct inode {
        struct list_head        i_dentry;
 
        unsigned long           i_ino;
+       unsigned long           i_count;
        kdev_t                  i_dev;
-       unsigned short          i_count;
        umode_t                 i_mode;
        nlink_t                 i_nlink;
        uid_t                   i_uid;
index cc664653b466df15bf4fd2a7b0a081da46b50158..ed896058edf1a39402e4269a4164c8c65138beab 100644 (file)
@@ -140,10 +140,13 @@ struct fs_struct {
        NULL, NULL \
 }
 
+/* Maximum number of active map areas.. This is a random (large) number */
+#define MAX_MAP_COUNT  (65536)
+
 struct mm_struct {
        struct vm_area_struct *mmap, *mmap_cache;
        pgd_t * pgd;
-       int count;
+       int count, map_count;
        struct semaphore mmap_sem;
        unsigned long context;
        unsigned long start_code, end_code, start_data, end_data;
@@ -155,7 +158,7 @@ struct mm_struct {
 };
 
 #define INIT_MM {                                      \
-               &init_mmap, NULL, swapper_pg_dir, 1,    \
+               &init_mmap, NULL, swapper_pg_dir, 1, 1, \
                MUTEX,                                  \
                0,                                      \
                0, 0, 0, 0,                             \
index 6df2783115a8e580c567e54acb256496ba92330c..09849f7eb4f83f758c0cb70a1a416f61dd13f686 100644 (file)
@@ -220,6 +220,7 @@ static inline int dup_mmap(struct mm_struct * mm)
                *tmp = *mpnt;
                tmp->vm_flags &= ~VM_LOCKED;
                tmp->vm_mm = mm;
+               mm->map_count++;
                tmp->vm_next = NULL;
                dentry = tmp->vm_dentry;
                if (dentry) {
@@ -272,6 +273,7 @@ struct mm_struct * mm_alloc(void)
                *mm = *current->mm;
                init_new_context(mm);
                mm->count = 1;
+               mm->map_count = 0;
                mm->def_flags = 0;
                mm->mmap_sem = MUTEX;
                /*
index 6066efeca5f3ad22724412a5a345fcd9e2c40bb9..b555fbaaeb4ef963662cf1739ae93886448ff148 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -173,6 +173,10 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
        if (off + len < off)
                return -EINVAL;
 
+       /* Too many mappings? */
+       if (mm->map_count > MAX_MAP_COUNT)
+               return -ENOMEM;
+
        /* mlock MCL_FUTURE? */
        if (mm->def_flags & VM_LOCKED) {
                unsigned long locked = mm->locked_vm << PAGE_SHIFT;
@@ -452,6 +456,7 @@ asmlinkage int sys_munmap(unsigned long addr, size_t len)
  */
 int do_munmap(unsigned long addr, size_t len)
 {
+       struct mm_struct * mm;
        struct vm_area_struct *mpnt, *next, *free, *extra;
        int freed;
 
@@ -466,7 +471,8 @@ int do_munmap(unsigned long addr, size_t len)
         * every area affected in some way (by any overlap) is put
         * on the list.  If nothing is put on, nothing is affected.
         */
-       mpnt = current->mm->mmap;
+       mm = current->mm;
+       mpnt = mm->mmap;
        while(mpnt && mpnt->vm_end <= addr)
                mpnt = mpnt->vm_next;
        if (!mpnt)
@@ -508,6 +514,7 @@ int do_munmap(unsigned long addr, size_t len)
                free = free->vm_next;
                freed = 1;
 
+               mm->map_count--;
                remove_shared_vm_struct(mpnt);
 
                st = addr < mpnt->vm_start ? mpnt->vm_start : addr;
@@ -518,9 +525,9 @@ int do_munmap(unsigned long addr, size_t len)
                if (mpnt->vm_ops && mpnt->vm_ops->unmap)
                        mpnt->vm_ops->unmap(mpnt, st, size);
 
-               flush_cache_range(current->mm, st, end);
-               zap_page_range(current->mm, st, size);
-               flush_tlb_range(current->mm, st, end);
+               flush_cache_range(mm, st, end);
+               zap_page_range(mm, st, size);
+               flush_tlb_range(mm, st, end);
 
                /*
                 * Fix the mapping, and free the old area if it wasn't reused.
@@ -534,7 +541,7 @@ int do_munmap(unsigned long addr, size_t len)
                kmem_cache_free(vm_area_cachep, extra);
 
        if (freed)
-               current->mm->mmap_cache = NULL; /* Kill the cache. */
+               mm->mmap_cache = NULL;  /* Kill the cache. */
        return 0;
 }
 
@@ -560,6 +567,7 @@ void exit_mmap(struct mm_struct * mm)
                        if (mpnt->vm_ops->close)
                                mpnt->vm_ops->close(mpnt);
                }
+               mm->map_count--;
                remove_shared_vm_struct(mpnt);
                zap_page_range(mm, start, size);
                if (mpnt->vm_dentry)
@@ -567,6 +575,10 @@ void exit_mmap(struct mm_struct * mm)
                kmem_cache_free(vm_area_cachep, mpnt);
                mpnt = next;
        }
+
+       /* This is just debugging */
+       if (mm->map_count)
+               printk("exit_mmap: map count is %d\n", mm->map_count);
 }
 
 /* Insert vm structure into process list sorted by address
@@ -577,6 +589,8 @@ void insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vmp)
        struct vm_area_struct **pprev = &mm->mmap;
        struct dentry * dentry;
 
+       mm->map_count++;
+
        /* Find where to link it in. */
        while(*pprev && (*pprev)->vm_start <= vmp->vm_start)
                pprev = &(*pprev)->vm_next;
@@ -668,6 +682,7 @@ void merge_segments (struct mm_struct * mm, unsigned long start_addr, unsigned l
                        mpnt->vm_start = mpnt->vm_end;
                        mpnt->vm_ops->close(mpnt);
                }
+               mm->map_count--;
                remove_shared_vm_struct(mpnt);
                if (mpnt->vm_dentry)
                        dput(mpnt->vm_dentry);
index 24c8d120103a916d65a0c554c0adb1d5bfc37ee6..e297aefdc477f314cba2952d1f66b444f931580e 100644 (file)
@@ -799,9 +799,6 @@ __initfunc(static void ic_do_bootp_ext(u8 *ext))
                                ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path));
                        break;
        }
-
-       if (ic_gateway == INADDR_NONE && b->relay_ip)
-               ic_gateway = b->relay_ip;
 }