Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.4.1 /kernel/fork.c

Filename:/kernel/fork.c
Lines Added:5
Lines Deleted:3
Also changed in: (Previous) 2.4.1-pre12  2.4.1-pre11  2.4.1-pre10  2.4.1-pre9  2.4.1-pre8  2.4.1-pre6 
(Following) 2.4.1-ac9  2.4.1-ac10  2.4.1-ac11  2.4.1-ac12  2.4.1-ac13  2.4.1-ac14 

Location
[  2.4.1
  [  kernel
     o  fork.c

Patch

diff -u --recursive --new-file v2.4.0/linux/kernel/fork.c linux/kernel/fork.c
--- v2.4.0/linux/kernel/fork.c   Wed Jan  3 20:45:26 2001
+++ linux/kernel/fork.c   Mon Jan 22 15:54:06 2001
@@ -134,7 +134,6 @@
    mm->mmap_cache = NULL;
    mm->map_count = 0;
    mm->cpu_vm_mask = 0;
-   mm->swap_cnt = 0;
    mm->swap_address = 0;
    pprev = &mm->mmap;
    for (mpnt = current->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) {
@@ -193,6 +192,7 @@
 }
 
 spinlock_t mmlist_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED;
+int mmlist_nr;
 
 #define allocate_mm()   (kmem_cache_alloc(mm_cachep, SLAB_KERNEL))
 #define free_mm(mm)   (kmem_cache_free(mm_cachep, (mm)))
@@ -246,6 +246,7 @@
 {
    if (atomic_dec_and_lock(&mm->mm_users, &mmlist_lock)) {
       list_del(&mm->mmlist);
+      mmlist_nr--;
       spin_unlock(&mmlist_lock);
       exit_mmap(mm);
       mmdrop(mm);
@@ -326,6 +327,7 @@
     */
    spin_lock(&mmlist_lock);
    list_add(&mm->mmlist, &oldmm->mmlist);
+   mmlist_nr++;
    spin_unlock(&mmlist_lock);
 
    if (retval)
@@ -445,7 +447,7 @@
    if (size > __FD_SETSIZE) {
       newf->max_fdset = 0;
       write_lock(&newf->file_lock);
-      error = expand_fdset(newf, size);
+      error = expand_fdset(newf, size-1);
       write_unlock(&newf->file_lock);
       if (error)
          goto out_release;
@@ -464,7 +466,7 @@
       read_unlock(&oldf->file_lock);
       newf->max_fds = 0;
       write_lock(&newf->file_lock);
-      error = expand_fd_array(newf, open_files);
+      error = expand_fd_array(newf, open_files-1);
       write_unlock(&newf->file_lock);
       if (error) 
          goto out_release;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.