--- linux-2.4.20-quota-ctx/kernel/sys.c 2003-01-30 14:40:56.000000000 +0000 +++ new/kernel/sys.c 2003-03-17 21:52:38.000000000 +0000 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -1089,6 +1090,8 @@ } } +spinlock_t ip_info_lock = SPIN_LOCK_UNLOCKED; + /* Decrease the reference count on the ip_info struct Free the struct if the reference count reach 0. @@ -1096,13 +1099,13 @@ void sys_release_ip_info (struct iproot_info *ip_info) { if (ip_info != NULL){ - down_write (&uts_sem); + spin_lock(&ip_info_lock); ip_info->refcount--; if (ip_info->refcount == 0){ - // printk ("vfree s_info %d\n",p->pid); + // printk ("%5d vfree ip_info 0x%08x\n", current->pid, ip_info ); vfree (ip_info); } - up_write (&uts_sem); + spin_unlock(&ip_info_lock); } } /* @@ -1111,9 +1114,9 @@ void sys_assign_ip_info (struct iproot_info *ip_info) { if (ip_info != NULL){ - down_write (&uts_sem); + spin_lock(&ip_info_lock); ip_info->refcount++; - up_write (&uts_sem); + spin_unlock(&ip_info_lock); } }