Commit 8772d71c authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.80pre2

parent 7a024f46
VERSION = 2 VERSION = 2
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 79 SUBLEVEL = 80
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
...@@ -90,11 +90,12 @@ ifeq ($(CONFIG_BLK_DEV_IDE),y) ...@@ -90,11 +90,12 @@ ifeq ($(CONFIG_BLK_DEV_IDE),y)
L_OBJS += ide-probe.o L_OBJS += ide-probe.o
else else
ifeq ($(CONFIG_BLK_DEV_IDE),m) ifeq ($(CONFIG_BLK_DEV_IDE),m)
MX_OBJS += ide.o MIX_OBJS += ide.o
ifeq ($(CONFIG_PROC_FS),y) ifeq ($(CONFIG_PROC_FS),y)
M_OBJS += ide-proc.o M_OBJS += ide-proc.o
endif endif
M_OBJS += ide-probe.o M_OBJS += ide-mod.o
MX_OBJS += ide-probe.o
endif endif
endif endif
...@@ -118,7 +119,6 @@ ifeq ($(CONFIG_BLK_DEV_PS2),y) ...@@ -118,7 +119,6 @@ ifeq ($(CONFIG_BLK_DEV_PS2),y)
L_OBJS += ps2esdi.o L_OBJS += ps2esdi.o
endif endif
ifeq ($(CONFIG_BLK_DEV_DTC2278),y) ifeq ($(CONFIG_BLK_DEV_DTC2278),y)
L_OBJS += dtc2278.o L_OBJS += dtc2278.o
endif endif
...@@ -250,3 +250,6 @@ else ...@@ -250,3 +250,6 @@ else
endif endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
ide-mod.o: ide.o ide-proc.o
$(LD) $(LD_RFLAG) -r -o $@ ide.o ide-proc.o
...@@ -87,16 +87,6 @@ static int ide_getxdigit(char c) ...@@ -87,16 +87,6 @@ static int ide_getxdigit(char c)
return digit; 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) static int xx_xx_parse_error (const char *data, unsigned long len, const char *msg)
{ {
char errbuf[16]; char errbuf[16];
...@@ -254,24 +244,6 @@ static int proc_ide_write_config ...@@ -254,24 +244,6 @@ static int proc_ide_write_config
return xx_xx_parse_error(start, startn, msg); 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 static int proc_ide_read_config
(char *page, char **start, off_t off, int count, int *eof, void *data) (char *page, char **start, off_t off, int count, int *eof, void *data)
{ {
...@@ -311,6 +283,34 @@ static int proc_ide_read_imodel ...@@ -311,6 +283,34 @@ static int proc_ide_read_imodel
} }
#endif /* CONFIG_PCI */ #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 static int proc_ide_read_type
(char *page, char **start, off_t off, int count, int *eof, void *data) (char *page, char **start, off_t off, int count, int *eof, void *data)
{ {
......
...@@ -97,10 +97,18 @@ CONFIG_SBDSP=y ...@@ -97,10 +97,18 @@ CONFIG_SBDSP=y
endif endif
endif endif
ifdef CONFIG_SB
ifneq ($(CONFIG_UART401),Y)
CONFIG_UART401=y ifdef CONFIG_SB
endif ifeq ($(CONFIG_SB),m)
ifneq ($(CONFIG_UART401),Y)
CONFIG_UART401=m
endif
else
ifneq ($(CONFIG_UART401),Y)
CONFIG_UART401=y
endif
endif
endif endif
ifdef CONFIG_TRIX ifdef CONFIG_TRIX
......
...@@ -321,8 +321,8 @@ struct inode { ...@@ -321,8 +321,8 @@ struct inode {
struct list_head i_dentry; struct list_head i_dentry;
unsigned long i_ino; unsigned long i_ino;
unsigned long i_count;
kdev_t i_dev; kdev_t i_dev;
unsigned short i_count;
umode_t i_mode; umode_t i_mode;
nlink_t i_nlink; nlink_t i_nlink;
uid_t i_uid; uid_t i_uid;
......
...@@ -140,10 +140,13 @@ struct fs_struct { ...@@ -140,10 +140,13 @@ struct fs_struct {
NULL, NULL \ NULL, NULL \
} }
/* Maximum number of active map areas.. This is a random (large) number */
#define MAX_MAP_COUNT (65536)
struct mm_struct { struct mm_struct {
struct vm_area_struct *mmap, *mmap_cache; struct vm_area_struct *mmap, *mmap_cache;
pgd_t * pgd; pgd_t * pgd;
int count; int count, map_count;
struct semaphore mmap_sem; struct semaphore mmap_sem;
unsigned long context; unsigned long context;
unsigned long start_code, end_code, start_data, end_data; unsigned long start_code, end_code, start_data, end_data;
...@@ -155,7 +158,7 @@ struct mm_struct { ...@@ -155,7 +158,7 @@ struct mm_struct {
}; };
#define INIT_MM { \ #define INIT_MM { \
&init_mmap, NULL, swapper_pg_dir, 1, \ &init_mmap, NULL, swapper_pg_dir, 1, 1, \
MUTEX, \ MUTEX, \
0, \ 0, \
0, 0, 0, 0, \ 0, 0, 0, 0, \
......
...@@ -220,6 +220,7 @@ static inline int dup_mmap(struct mm_struct * mm) ...@@ -220,6 +220,7 @@ static inline int dup_mmap(struct mm_struct * mm)
*tmp = *mpnt; *tmp = *mpnt;
tmp->vm_flags &= ~VM_LOCKED; tmp->vm_flags &= ~VM_LOCKED;
tmp->vm_mm = mm; tmp->vm_mm = mm;
mm->map_count++;
tmp->vm_next = NULL; tmp->vm_next = NULL;
dentry = tmp->vm_dentry; dentry = tmp->vm_dentry;
if (dentry) { if (dentry) {
...@@ -272,6 +273,7 @@ struct mm_struct * mm_alloc(void) ...@@ -272,6 +273,7 @@ struct mm_struct * mm_alloc(void)
*mm = *current->mm; *mm = *current->mm;
init_new_context(mm); init_new_context(mm);
mm->count = 1; mm->count = 1;
mm->map_count = 0;
mm->def_flags = 0; mm->def_flags = 0;
mm->mmap_sem = MUTEX; mm->mmap_sem = MUTEX;
/* /*
......
...@@ -173,6 +173,10 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len, ...@@ -173,6 +173,10 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
if (off + len < off) if (off + len < off)
return -EINVAL; return -EINVAL;
/* Too many mappings? */
if (mm->map_count > MAX_MAP_COUNT)
return -ENOMEM;
/* mlock MCL_FUTURE? */ /* mlock MCL_FUTURE? */
if (mm->def_flags & VM_LOCKED) { if (mm->def_flags & VM_LOCKED) {
unsigned long locked = mm->locked_vm << PAGE_SHIFT; unsigned long locked = mm->locked_vm << PAGE_SHIFT;
...@@ -452,6 +456,7 @@ asmlinkage int sys_munmap(unsigned long addr, size_t len) ...@@ -452,6 +456,7 @@ asmlinkage int sys_munmap(unsigned long addr, size_t len)
*/ */
int do_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; struct vm_area_struct *mpnt, *next, *free, *extra;
int freed; int freed;
...@@ -466,7 +471,8 @@ int do_munmap(unsigned long addr, size_t len) ...@@ -466,7 +471,8 @@ int do_munmap(unsigned long addr, size_t len)
* every area affected in some way (by any overlap) is put * every area affected in some way (by any overlap) is put
* on the list. If nothing is put on, nothing is affected. * 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) while(mpnt && mpnt->vm_end <= addr)
mpnt = mpnt->vm_next; mpnt = mpnt->vm_next;
if (!mpnt) if (!mpnt)
...@@ -508,6 +514,7 @@ int do_munmap(unsigned long addr, size_t len) ...@@ -508,6 +514,7 @@ int do_munmap(unsigned long addr, size_t len)
free = free->vm_next; free = free->vm_next;
freed = 1; freed = 1;
mm->map_count--;
remove_shared_vm_struct(mpnt); remove_shared_vm_struct(mpnt);
st = addr < mpnt->vm_start ? mpnt->vm_start : addr; st = addr < mpnt->vm_start ? mpnt->vm_start : addr;
...@@ -518,9 +525,9 @@ int do_munmap(unsigned long addr, size_t len) ...@@ -518,9 +525,9 @@ int do_munmap(unsigned long addr, size_t len)
if (mpnt->vm_ops && mpnt->vm_ops->unmap) if (mpnt->vm_ops && mpnt->vm_ops->unmap)
mpnt->vm_ops->unmap(mpnt, st, size); mpnt->vm_ops->unmap(mpnt, st, size);
flush_cache_range(current->mm, st, end); flush_cache_range(mm, st, end);
zap_page_range(current->mm, st, size); zap_page_range(mm, st, size);
flush_tlb_range(current->mm, st, end); flush_tlb_range(mm, st, end);
/* /*
* Fix the mapping, and free the old area if it wasn't reused. * 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) ...@@ -534,7 +541,7 @@ int do_munmap(unsigned long addr, size_t len)
kmem_cache_free(vm_area_cachep, extra); kmem_cache_free(vm_area_cachep, extra);
if (freed) if (freed)
current->mm->mmap_cache = NULL; /* Kill the cache. */ mm->mmap_cache = NULL; /* Kill the cache. */
return 0; return 0;
} }
...@@ -560,6 +567,7 @@ void exit_mmap(struct mm_struct * mm) ...@@ -560,6 +567,7 @@ void exit_mmap(struct mm_struct * mm)
if (mpnt->vm_ops->close) if (mpnt->vm_ops->close)
mpnt->vm_ops->close(mpnt); mpnt->vm_ops->close(mpnt);
} }
mm->map_count--;
remove_shared_vm_struct(mpnt); remove_shared_vm_struct(mpnt);
zap_page_range(mm, start, size); zap_page_range(mm, start, size);
if (mpnt->vm_dentry) if (mpnt->vm_dentry)
...@@ -567,6 +575,10 @@ void exit_mmap(struct mm_struct * mm) ...@@ -567,6 +575,10 @@ void exit_mmap(struct mm_struct * mm)
kmem_cache_free(vm_area_cachep, mpnt); kmem_cache_free(vm_area_cachep, mpnt);
mpnt = next; 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 /* 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) ...@@ -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 vm_area_struct **pprev = &mm->mmap;
struct dentry * dentry; struct dentry * dentry;
mm->map_count++;
/* Find where to link it in. */ /* Find where to link it in. */
while(*pprev && (*pprev)->vm_start <= vmp->vm_start) while(*pprev && (*pprev)->vm_start <= vmp->vm_start)
pprev = &(*pprev)->vm_next; pprev = &(*pprev)->vm_next;
...@@ -668,6 +682,7 @@ void merge_segments (struct mm_struct * mm, unsigned long start_addr, unsigned l ...@@ -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_start = mpnt->vm_end;
mpnt->vm_ops->close(mpnt); mpnt->vm_ops->close(mpnt);
} }
mm->map_count--;
remove_shared_vm_struct(mpnt); remove_shared_vm_struct(mpnt);
if (mpnt->vm_dentry) if (mpnt->vm_dentry)
dput(mpnt->vm_dentry); dput(mpnt->vm_dentry);
......
...@@ -799,9 +799,6 @@ __initfunc(static void ic_do_bootp_ext(u8 *ext)) ...@@ -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)); ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path));
break; break;
} }
if (ic_gateway == INADDR_NONE && b->relay_ip)
ic_gateway = b->relay_ip;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment