void flush_all_signals (void)
{
- spin_lock_irq(¤t->sighand->siglock);
flush_signals(current);
+ spin_lock_irq(¤t->sighand->siglock);
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
}
break;
if (!ti->listen[j].sock)
break;
- if (tcp_sk(ti->listen[j].sock->sk)->accept_queue)
+ if (!reqsk_queue_empty(&inet_csk(ti->listen[j].sock->sk)->icsk_accept_queue))
return 1;
}
return 0;
set_fs(KERNEL_DS);
cap_raise (current->cap_effective, CAP_SYS_CHROOT);
- err = chroot(dir);
+ err = sys_chroot(dir);
if (!err)
- chdir("/");
+ sys_chdir("/");
current->cap_effective = saved_cap;
set_fs(oldmm);
/*
* Look up the HTTP and FTP document root.
- * (typically they are shared, but can be
+ * (typically they are shared, but can be
* different directories.)
*/
docroot = &tux_proto_http.main_docroot;
start_log_thread();
nr_tux_threads = tux_threads;
- if (nr_tux_threads < 1)
+ if (nr_tux_threads < 1)
nr_tux_threads = 1;
- if (nr_tux_threads > CONFIG_TUX_NUMTHREADS)
+ if (nr_tux_threads > CONFIG_TUX_NUMTHREADS)
nr_tux_threads = CONFIG_TUX_NUMTHREADS;
tux_threads = nr_tux_threads;
struct k_sigaction *ka;
cpu = ti->cpu;
-#if CONFIG_SMP
+#ifdef CONFIG_SMP
{
- unsigned int mask;
- cpumask_t cpu_mask, map;
+ unsigned int home_cpu;
+ cpumask_t map;
- mask = 1 << ((cpu + tux_cpu_offset) % num_online_cpus());
+ home_cpu = (cpu + tux_cpu_offset) % num_online_cpus();
+ map = cpumask_of_cpu(home_cpu);
- mask_to_cpumask(mask, &cpu_mask);
- cpus_and(map, cpu_mask, cpu_online_map);
- if(!(cpus_empty(map)))
- set_cpus_allowed(current, map);
+ cpus_and(map, map, cpu_online_map);
+ if (!(cpus_empty(map)))
+ set_cpus_allowed(current, map);
}
#endif
ti->thread = current;
if (count)
continue;
Dprintk("flush_all_requests: %d requests still waiting.\n", ti->nr_requests);
-#if TUX_DEBUG
+#ifdef CONFIG_TUX_DEBUG
count = print_all_requests(ti);
Dprintk("flush_all_requests: printed %d requests.\n", count);
#endif
GOTO_ERR_no_unlock;
mimetype[ret] = 0;
Dprintk("got MIME type: %s.\n", mimetype);
- ret = strncpy_from_user(expires, u_info->cache_control, MAX_URI_LEN);
- if (ret >= 0)
- expires[ret] = 0;
+ ret = strncpy_from_user(expires, u_info->cache_control, MAX_URI_LEN);
+ if (ret >= 0)
+ expires[ret] = 0;
else
expires[0] = 0;
- Dprintk("got expires header: %s.\n", expires);
+ Dprintk("got expires header: %s.\n", expires);
add_mimetype(extension, mimetype, expires);
ret = 0;
case -1:
break;
default:
- req->in_file.f_pos = 0;
+ req->in_file->f_pos = 0;
add_req_to_workqueue(req);
break;
}
INC_STAT(user_fetch_cachemisses);
goto fetch_missed;
}
- req->in_file.f_pos = 0;
+ req->in_file->f_pos = 0;
add_req_to_workqueue(req);
}
TUX_BUG();
if (!capable(CAP_SYS_ADMIN)
- && (action != TUX_ACTION_CONTINUE_REQ) &&
- (action != TUX_ACTION_STOPTHREAD))
+ && (action != TUX_ACTION_CONTINUE_REQ) &&
+ (action != TUX_ACTION_STOPTHREAD))
goto userspace_actions;
switch (action) {
current->tux_exit = tux_exit;
if (ti->thread)
TUX_BUG();
- Dprintk("TUX: current open files limit for TUX%d: %ld.\n", nr, current->rlim[RLIMIT_NOFILE].rlim_cur);
+ Dprintk("TUX: current open files limit for TUX%d: %ld.\n", nr, current->signal->rlim[RLIMIT_NOFILE].rlim_cur);
lock_kernel();
ret = user_req_start_thread(ti);
unlock_kernel();
req = ti->userspace_req;
if (req)
zap_userspace_req(req);
-
+
lock_kernel();
ret = user_req_stop_thread(ti);
unlock_kernel();
if (!req->dentry)
GOTO_ERR_unlock;
-
+
ret = copy_from_user(&u_addr, &u_info->object_addr,
sizeof(u_addr));
if (ret)
int tux_init(void)
{
+ if (init_tux_request_slabs())
+ return -ENOMEM;
+
start_sysctl();
-#if CONFIG_TUX_MODULE
+#ifdef CONFIG_TUX_MODULE
spin_lock(&tux_module_lock);
sys_tux_ptr = __sys_tux;
tux_module = THIS_MODULE;
void tux_cleanup (void)
{
-#if CONFIG_TUX_MODULE
+#ifdef CONFIG_TUX_MODULE
spin_lock(&tux_module_lock);
tux_module = NULL;
sys_tux_ptr = NULL;
spin_unlock(&tux_module_lock);
#endif
-
end_sysctl();
+
+ free_tux_request_slabs();
}
module_init(tux_init)